Replacing Failed disk

Go to solution
Regular Advisor

Replacing Failed disk

Hi Gurus,

I want to replace a failed disk.

Can you pls provide me detailed step by step of tasks to be performed before the disk replacement and after the disk is inserted, as i'm a beginner in HP-UX.

Pls find the output of the current status.

DSLARCM1:/home/root> lvdisplay -v /dev/vg04/lvol1|grep -i stale
LV Status available/stale
0000 /dev/dsk/c0t4d0 0000 stale /dev/dsk/c3t2d0 0000 current
0001 /dev/dsk/c0t4d0 0001 stale /dev/dsk/c3t2d0 0001 current
0002 /dev/dsk/c0t4d0 0002 stale /dev/dsk/c3t2d0 0002 current
0003 /dev/dsk/c0t4d0 0003 stale /dev/dsk/c3t2d0 0003 current
0005 /dev/dsk/c0t4d0 0005 stale /dev/dsk/c3t2d0 0005 current
0006 /dev/dsk/c0t4d0 0006 stale /dev/dsk/c3t2d0 0006 current
0007 /dev/dsk/c0t4d0 0007 stale /dev/dsk/c3t2d0 0007 current
0496 /dev/dsk/c0t4d0 0496 stale /dev/dsk/c3t2d0 0496 current
0504 /dev/dsk/c0t4d0 0504 stale /dev/dsk/c3t2d0 0504 current
0505 /dev/dsk/c0t4d0 0505 stale /dev/dsk/c3t2d0 0505 current
0506 /dev/dsk/c0t4d0 0506 stale /dev/dsk/c3t2d0 0506 current
0507 /dev/dsk/c0t4d0 0507 stale /dev/dsk/c3t2d0 0507 current

That vg04 VG is having only one LV.

Thanks in Advance,
Bharat Katkar
Honored Contributor

Re: Replacing Failed disk


1. Unmount the filesystems from VG04
2. # dd if=/dev/dsk/c0t4d0 of=/dev/null
This will identify the bad blocks in the disk.
3. Use lvsplit to disengage the mirrors and keep you copy on /dev/dsk/c3t2d0 safe.
4. remove /dev/dsk/c0t4d0 and insert new disk.
5. pvcreate
6. Use lvmerge to again mirror your LV

Use lvmerge command carefully. see man lvsplit and lvmerge.

Hope that helps.
You need to know a lot to actually know how little you know
Regular Advisor

Re: Replacing Failed disk

Thanks for your response.

Can I use lvreduce to unmirror the second copy?

Can i know the exact syntax for these commands?
D Anderton

Re: Replacing Failed disk

First thing confirm the disk has failed and you don't just need to perform an lvsync.

Use ioscan -fnCdisk and check for NO-HW.

Sometime LVM can report the wrong disk has failed when in a mirror, use dd to confirm the failed disk. dd if=/dev/dsk/c0t4d0 of=/dev/null this will hang on a failed disk.

Remove the failed disk from the vg.

lvreduce -m 0 /dev/vg04/lvol1 /dev/dsk/c0t4d0

vgreduce /dev/vg04 /dev/dsk/c0t4d0

replace disk

ioscan -fn

pvcreate /dev/rdsk/c0t4d0

vgextend /dev/vg04 /dev/dsk/c0t4d0

lvextend -m1 /dev/vg04/lvol1

Regular Advisor

Re: Replacing Failed disk

Thanks Damien..

Exactly i need the above commands.

but ioscan of my system is not showing as NO_HW or unidentified sort of error messages.

# ioscan -fnC disk
Class I H/W Path Driver S/W State H/W Type Description
disk 4 10/0.5.0 sdisk CLAIMED DEVICE SEAGATE ST32171W

can we do anything without replacing this disk.

Can i run lvreduce and vgreduce commands on the mounted filesystem? i believe i can.. correct me, if i'm wrong.

D Anderton

Re: Replacing Failed disk

lvreduce, vgreduce, vgextend etc..etc.. can all be performed online.

Perform the dd to confirm you do have a failed disk, if not it could be that the mirror is just out of sync (stale) :

lvsync /dev/vg04/lvol1

This is not a swap device is it ?

If this is a swap device your lvol will always have stale extents after a reboot if the Mirror Write Consistancy is turned on.

If you confirm you have a failed disk and this is critical data ensure you get a backup.

Regular Advisor

Re: Replacing Failed disk

Yes Damian..

It's not a swap device..

can i run the dd command on a single disk online?

shall i use this command to check the disk status:

dd if=/dev/dsk/c0t4d0 of=/dev/null

D Anderton

Re: Replacing Failed disk

Yes use the dd command online, if the disk is failed your session will probably hang, the command itself will take a while as it is reading the whole disk.