How to remove / reduce a dead mirrored drive in HP-UX

April 26th, 2012 | Posted by spritian in HP-UX | LVM

Here are my notes on how to remove and replace a dead mirrored drive on HP-UX 11i v3:

Remove bad mirrored boot disk HP-UX:

Check for stale LEs:

lvdisplay -v -k /dev/vg00/lvol# (1-7 is normal, however your system might have more) (to get key for the next command)

Next we need to remove the bad drive from the LVM, so let’s reduce the lvols (the last integer is the key from the last lvdisplay command):

lvreduce -m 0 -A n -k /dev/vg00/lvol1 0 lvreduce -m 0 -A n -k /dev/vg00/lvol2 0 lvreduce -m 0 -A n -k /dev/vg00/lvol3 0 lvreduce -m 0 -A n -k /dev/vg00/lvol4 0 lvreduce -m 0 -A n -k /dev/vg00/lvol5 0 lvreduce -m 0 -A n -k /dev/vg00/lvol6 0 lvreduce -m 0 -A n -k /dev/vg00/lvol7 0

Now that we’ve reduced the mirror, let’s remove partition 2 from the volgroup:

vgreduce /dev/vg00 /dev/disk/disk62_p2

If we can’t reduce because it’s critically failed, then we need to do this:

vgreduce –f /dev/vg00 /dev/disk/disk62_p2 vgscan –f /dev/vg00

Then confirm:

vgdisplay -v vg00

Here’s an example of a DEAD drive from ioscan:

disk 62 64000/0xfa00/0xd esdisk NO_HW DEVICE offline HP 36.4GST336753LC 2/0/0/2/0.0x6.0x0 /dev/disk/disk62 /dev/disk/disk62_p2 /dev/rdisk/disk62 /dev/rdisk/disk62_p2 /dev/disk/disk62_p1 /dev/disk/disk62_p3 /dev/rdisk/disk62_p1 /dev/rdisk/disk62_p3

Example of REPLACED drive with the old DEAD DSF – Map DSF then Re-add to VG:

STEP1: In order to see the new drive, you need to do this first (AFTER NEW DRIVE IS INSERTED): scsimgr replace_wwid –D /dev/rdisk/disk62

... disk 62 64000/0xfa00/0xd esdisk NO_HW DEVICE offline HP 36.4GST336753LC /dev/disk/disk62 /dev/disk/disk62_p2 /dev/rdisk/disk62 /dev/rdisk/disk62_p2 /dev/disk/disk62_p1 /dev/disk/disk62_p3 /dev/rdisk/disk62_p1 /dev/rdisk/disk62_p3 disk 219 64000/0xfa00/0x20 esdisk CLAIMED DEVICE online HP 36.4GST336753LC 2/0/0/2/0.0x6.0x0 /dev/disk/disk219 /dev/rdisk/disk219 ...

STEP2: Formart disk219

echo "3" > /tmp/partitionfile echo "EFI 500MB" >> /tmp/partitionfile echo "HPUX 100%" >> /tmp/partitionfile echo "HPSP 400MB" >> /tmp/partitionfile idisk -wf /tmp/partitionfile /dev/rdisk/disk219 ioscan -fnNC disk insf -e -C disk

STEP3: Then you can map the new DSF to the old one:

io_redirect_dsf -d /dev/disk/disk62 -n /dev/disk/disk219

STEP4: Make Bootable and fix EFI partitions:

mkboot -e -l /dev/rdisk/disk62 efi_ls -d /dev/rdisk/disk62_p1 lifls -l /dev/rdisk/disk62_p2 mkboot -a "boot vmunix -lq" /dev/disk/disk62 efi_cp -d /dev/rdisk/disk62_p1 -u /EFI/HPUX/AUTO /tmp/x; cat /tmp/x;rm /tmp/x

STEP5: Create PV, Extend VG, and Extend LVs:

pvcreate -f -B /dev/rdisk/disk62_p2 vgextend /dev/vg00 /dev/disk/disk62_p2 lvextend -m 1 /dev/vg00/lvol1 /dev/disk/disk62_p2 lvextend -m 1 /dev/vg00/lvol2 /dev/disk/disk62_p2 lvextend -m 1 /dev/vg00/lvol3 /dev/disk/disk62_p2 lvextend -m 1 /dev/vg00/lvol4 /dev/disk/disk62_p2 lvextend -m 1 /dev/vg00/lvol5 /dev/disk/disk62_p2 lvextend -m 1 /dev/vg00/lvol6 /dev/disk/disk62_p2 lvextend -m 1 /dev/vg00/lvol7 /dev/disk/disk62_p2 lvlnboot -r /dev/vg00/lvol3 lvlnboot -b /dev/vg00/lvol1 lvlnboot -s /dev/vg00/lvol2 lvlnboot -d /dev/vg00/lvol2 lvlnboot -R lvlnboot -v

STEP6: Verify VG and boot paths

vgdisplay -v vg00 setboot -v

If the mirrored disk fails to boot from EFI, boot off the alternate working one, and re-execute setboot -v with the device path (even though it might already be set, set it again since the wwid change).

You can follow any responses to this entry through the RSS 2.0 You can leave a response, or trackback.

2 Responses



Leave a Reply

Your email address will not be published. Required fields are marked *

*