System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Recovering VGs and Logical volumens

 
WilliamSmith11
Super Advisor

Recovering VGs and Logical volumens

Hi
My HPUX 11.23 have the OS failed.
There is no Ignite.
I reinstall the OS , I have and external disk enclosure where were configured some VGs and Logical volumen before the failed disk of the OS.

How can I recover the VGs, Logical volumens and data that are in the external disk drives?

Maybe vgscan?

Regards
rperez
3 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: Recovering VGs and Logical volumens

HI:

Following your cold-install, use 'vgscan' in preview mode to expose the missing volume group devices. See the manpages for 'vgscan' for the options appropriate for your release. Having noted the physical devices associated with each volume group, use 'vgimport' to update the '/etc/lvmtab' (or '/etc/lvmtab_p').

If you don't have a mapfile (which appears to be the case), your logical volumes will be named 'lvol1', 'lvol2', etc. for the first, second, etc. logical volume on each volume group. These names can easily be changed after-the-fact, if necessary.

Be sure to activate ('vgchange -a y vgname') each volume group after its import. See the manpages for 'vgscan' and 'vgimport' for more information.

Regards!

...JRF...
SoorajCleris
Honored Contributor

Re: Recovering VGs and Logical volumens

Hi William,

Please find the example below.
when you run #vgscan -p it will tell you which and all PVs are part of single volume group.

# vgscan -p

Following Physical Volumes belong to one Volume Group.
Unable to match these Physical Volumes to a Volume Group.
Use the vgimport command to complete the process.
/dev/dsk/c2t0d0

======================
# mkdir /dev/sooraj

# mknod /dev/sooraj/group c 64 0x010000

# vgimport /dev/sooraj /dev/dsk/c2t0d0
vgimport: Volume group "/dev/sooraj" 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 sooraj
Activated volume group
Volume group "sooraj" has been successfully changed.
===============================
Please note that the LV names will be created as /dev/vgname/lvol1 lvol2 lvol3

If you need the exact name you should have map file created with -m option with vgexport comand.

==> How ever you can mount the filesystems using the defualt LV name and rename later using #mv command to /dev/vgname/rlvol and lvol to the new name.

Regards,
Sooraj
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
Manix
Honored Contributor

Re: Recovering VGs and Logical volumens

Sooraj said it all well !!

in case you have a ols lvmtab ,mapfine then
then the lvol names could be recovered as well
i guess !!

Thanks

Manix
HP-UX been always lovable - Mani Kalra