Operating System - HP-UX
1753905 Members
10482 Online
108810 Solutions
New Discussion юеВ

recover file system from an lvm disk

 
SOLVED
Go to solution
Dee Jacobs
Advisor

recover file system from an lvm disk

Following a series of unfortunate events, I am left wit an lvm disk which is separated from its original server. There is just one vxfs file system on the disk. If can't be mounted with the typical mount command. Is it possible to retrieve the data from the file system? Perhaps a data recovery utility program?

 

7 REPLIES 7
Patrick Wallek
Honored Contributor

Re: recover file system from an lvm disk

>>If can't be mounted with the typical mount command

 

What happened when you tried this?

 

The usual procedure for doing something like this is to use vgimport to import the disk into its own VG, activate the VG, then mount the LVOL from that disk.

 

If I were to try to import c1t2d0 into a VG, I would do (assuming an LVM 1 VG):

 

# mkdir /dev/vgtest

# mknod /dev/vgtest/group c 64 0x050000

(or whatever minor number is available)

 

# vgimport /dev/vgtest /dev/dsk/c1t2d0

 

If that is successful, then:

 

# vgchange -a y /dev/vgtest

 

# vgdisplay -v /dev/vgtest

to see what LVs are in the VG.

 

Then try to mount the LV(s).

 

Dee Jacobs
Advisor

Re: recover file system from an lvm disk

mount says:

 

# mount -F vxfs /dev/disk/disk13 /test
UX:vxfs mount: ERROR: V-3-20012: not a valid vxfs file system
UX:vxfs mount: ERROR: V-3-24996: Unable to get disk layout version

 

I will try your method. reply later. thanks.

Dee Jacobs
Advisor

Re: recover file system from an lvm disk

# mkdir /dev/vgtest
##  mknod /dev/vgtest/group c 64 0x050000
#
# vgimport /dev/vgtest /dev/disk/disk13
vgimport: Warning:  Volume Group belongs to different CPU ID.
Can not determine if Volume Group is in use on another system. Continuing.
vgimport: Warning: Volume Group contains "2" PVs, "1" specified. Continuing.
vgimport: Volume group "/dev/vgtest" has been successfully created.
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.
#
# vgchange -a y /dev/vgtest
vgchange: Activation mode requested for the volume group "/dev/vgtest" conflicts with configured mode.
#
# vgchange -a e /dev/vgtest
vgchange: Volume group "/dev/vgtest" belongs to a different Cluster.  Activation failed.

 

 

******

Yes it came from a different server and a different vg in that server.

Patrick Wallek
Honored Contributor

Re: recover file system from an lvm disk

OK, do:

 

# vgchange -c n /dev/vgtest

# vgchange -a y /dev/vgtest

 

# vgdisplay -v /dev/vgtest

To verify the LV.

 

Then try mounting your LV.

Patrick Wallek
Honored Contributor

Re: recover file system from an lvm disk

I just noticed the following WARNING in your output:

 

>>vgimport: Warning: Volume Group contains "2" PVs, "1" specified.

 

Since the VG originally had 2 PVs you may need to do:

 

# vgchange -a y -q n /dev/vgtest

 

So vgchange will ignore the quorum requirement for the VG.

Dee Jacobs
Advisor
Solution

Re: recover file system from an lvm disk

Thanks Patrick,

 

I just made a fix that works.

 

The VG was marked cluter aware.   I deleted that.

A mount declared a corrupt file system on /dev/vgtest - reccommended fsck.

fsck cleaned the root block.

mount is now successful. I can recover the data now.

 

THANKS.  WOW!

Patrick Wallek
Honored Contributor

Re: recover file system from an lvm disk

Good news!