Operating System - HP-UX
1837792 Members
12256 Online
110120 Solutions
New Discussion

How to recover data from LVM bootable disk

 
FTSE SysAdmin
Frequent Advisor

How to recover data from LVM bootable disk

Hi,

I've upgrade 2 bootable LVM disks replacing the disks.

Now I'm trying to get the configs from the previous disk into the new one... I tried to use the following however LVL didn't manage to activate the group....

mkdir /dev/vg0r
mknod /dev/vg0r/group c 64 0x01000
vgimport -v vg0r /dev/dsk/c2t6d0 (this point all logical volumes devices were created)
vgchange -a y vg0r
(from this point... LVL said that couldn't activate the group)

Would someone has a better procedure to retrieve the data? (restore from backup isn't an option unfortunately)
Miguel Ribeiro
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: How to recover data from LVM bootable disk

You could use this procedure to clone(mirror) the entire boot disk to the new boot disk one at a time.

pvcreate -B /dev/rdsk/c1t0d0 #use real disk

mkboot -l /dev/rdsk/c1t0d0
mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c1t0d0 # use real disk


# mkboot -b /usr/sbin/diag/lif/updatediaglif -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?

If you are running 64-bit OS:

# mkboot -b /usr/sbin/diag/lif/updatediaglif2 -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?


vgextend /dev/vg00 /dev/dsk/c1t0d0 # same thing

# 1 may need to be 2 here ...
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t0d0

# real disk. repeat for other lvols

lvlnboot -r /dev/vg00/lvol3 # root fs /
lvlnboot -s /dev/vg00/lvol2 #swap
lvlnboot -d /dev/vg00/lvol2 #swap/dump
lvlnboot -b /dev/vg00/lvol1
lvlnboot -R
lvlnboot -v
setboot
setboot -a 52.1.0 # second disk

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: How to recover data from LVM bootable disk

Your problem is that your minor device number is 16X too small; you are missing a hex '0'. 0x01000 should be 0x010000.

You should also make certain that 0x010000 is not used by any other VG's on this box.

vgexport /dev/vg0r and start over.
If it ain't broke, I can fix that.
FTSE SysAdmin
Frequent Advisor

Re: How to recover data from LVM bootable disk

I'm sorry I typed incorrectly ... is 0x010000...

updating my 1st post.

I'm getting "quorum not present, or some physical volume are missing" so LVM can't mount coz an mirror issue...

Thanks for your replys
Miguel Ribeiro
Bernhard Mueller
Honored Contributor

Re: How to recover data from LVM bootable disk

You have only one disk of the mirrored pair so you need to activate without quorum:

vgchange -a y -q n vg0r

Regards,
Bernhard