Operating System - HP-UX
1834162 Members
2602 Online
110064 Solutions
New Discussion

Mounting lvm disk that was 2nd disk from another system.

 
SOLVED
Go to solution
Dee_3
Regular Advisor

Mounting lvm disk that was 2nd disk from another system.

I have a user that has an rp5400 (L box) with 2 disks (non-mirrored) on 11.00 o/s. The primary disk crashed and needed to be replaced. The user had critical data on these disks (because of disk errors, we hope the data is on the 2nd disk), so the Tech replaced both disks and pulled the 2 original disks out. The user has sent these disks to me. I have a similar system with 1 disk and 1 volume group. I am looking to put their 2nd disk in my system to try to access this data. I have found a resolution where I could add a temporary volume group on my system, use vgimport to import this disk, and use vgchange to activate it. Further it suggests the option of using sam to do these steps. I am looking for any real-life experiences with this type of situation and/or suggestions or concerns or any different suggestion for my situation. Thanks, Terri Christensen.
5 REPLIES 5
Patrick Wallek
Honored Contributor
Solution

Re: Mounting lvm disk that was 2nd disk from another system.

Here are the steps I would take in this case:

# mkdir /dev/vg03
# mknod /dev/vg03/group c 64
# vgimport -v /dev/vg03 /dev/dsk/c?t?d?

# mkdir /mnt1
...
# mkdir /mnt?

Make temporary mount points for the LV's on the disk. The vgimport command should show you which LV's were imported from the disk.

From that point:

# mount /dev/vg03/lvol? /mnt?

And mount the LVs.

This should allow you to see the data on the disk.

The only problem you might have is if both disks were in the same VG. In that case the vgimport may or may not work. All you can do is try it and see what happens. Hopefully the system you have to try this on is a test system. vgimport'ing a disk shouldn't effect a system, but you just never know.

Good luck.
Sridhar Bhaskarla
Honored Contributor

Re: Mounting lvm disk that was 2nd disk from another system.

Hi Terri,

If that volume group had both the disks in and if one disk is bad, then it is mostly likely that you will lose the data.

You can atmost cover the filesystems that were only part of disk2 (good one). You cannot get the data for the file systems that were either on disk1 (bad) or sharing disk1 and disk2.

Follow exactly the procedure given by Patrick. However, if disk1 is bad, you will not be able to activate the VG. You will need to use "vgchange -a y -q n vg03" to get it activated. See if you recover data by mounting all the file systems under /dev/vg03.

Try vgimport -v vg03 /dev/dsk/ /dev/dsk first.

If it fails, try with only disk2 and then use vgchange as I mentioned above.

Yes. I have real life experience with this situation and I could be able to recover only the data from the file systems that were sitting exclusively on the good disks.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Ravi_8
Honored Contributor

Re: Mounting lvm disk that was 2nd disk from another system.

Hi,
i had the same situation once,
basically you should know what all the lvols present on the second disk.
do the vgimport of second disk and mount those lvols on to present OS, if you doesn't know the lvols of the second disk you can't proceed. ask your client to send fstab file print if he has
never give up
Edward Finneran
Advisor

Re: Mounting lvm disk that was 2nd disk from another system.

The comment about only being able to reliably recover data on whichever disks are still good is right (i.e. if only one disk is good, you can retrieve info from the filesystems entirely contained on that drive).

The comment that you must know the lv names isn't quick on target. The first process recommended to you will create lvol1, lvol2, etc., and you'll just have to figure them out, unless you have available to you a mapping (map file from vgexport) of logical volume numbers to names (handy to store off to tape or email to some remote system just in case, along with mount point permissions and other useful info).

mmmmm...I'm wondering if the mknod command recommended to you above might be missing the minor number? I always specify it, using a number not already used on the system, as shown by a ls -l /dev/vg*/group.

Good luck.
Dee_3
Regular Advisor

Re: Mounting lvm disk that was 2nd disk from another system.

Thanks so much for the responses. The user actually sent me both disks, and I was very fortunately able to boot from the primary disk (with errors, of course) and access the files I needed. I appreciate all the expertise in the replies, and I have filed them away for future reference. Terri Christensen.