Operating System - HP-UX
1826884 Members
3041 Online
109705 Solutions
New Discussion

Re: What files hold the Volume Group info?

 
SOLVED
Go to solution
Phil1970
Advisor

What files hold the Volume Group info?

Hi All,

Hopefully someone may possibly be able to help me with this request.

What files hold the HPUX LVM / VG info?

I seem to remember that /etc/fstab is one, is this correct? I want to backup all relevant files '(cp them to .old)' that contain the VG info so if a disk upgrade fails then I have a way of putting the original files in place and then reinstalling the original drives so that I have a working system. I'm basically removing the old smaller drives, trashing the VG's, rebuilding the VG info on the new larger drives, the restoring the old data.

What files hold the VG / disk info and what are their locations? I'm hoping if there are any problems with the upgrade then I can reinstall the old drives and put the .old files back in place and have a working system as my backout option.

Many thanks in advance.
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: What files hold the Volume Group info?

Hi:

By "disk upgrade" I presume that you mean physical replacement with new physical disks.

If so, 'vgexport' the volume group(s). This cleans up '/etc/lvmtab' and enables you to physically remove the drives. If you don't like the "results" of the rebuilt volume group (via 'vgcreate', etc), a 'vgimport' of the old hardware when replaced will re-instate your old volume group.

Remember, a 'vgexport' does not destroy a volume group configuration; nor the logical volumes and filesystems and data held therein.

Regards!

...JRF...
Phil1970
Advisor

Re: What files hold the Volume Group info?

Hi James,

Many thanks for the quick reply...looking into vgimport / export now. Sounds like this will be the way to go. Out of interest do you know what files hold this info?

If I vgexport, for example vg01, which is held on one of the old drives then add the new drive, will I then still be able to vgcreate vg01 on the new drive or will it think it already has a vg01?

I have two 9gb drives that hold vg01 and vg02. They are not mirrored. They have a max size in the vgdisplay output that means I can't vgextend. So I intend on removing the 9gb drives, replacing with 18gb drives and then setting up the vg01 and vg02 from scratch then restoring the data to them. If i use vgexport can this still be done? Then can I just use the vgimport command if I have any problems and need to revert back to the old disks?

Cheers.
James R. Ferguson
Acclaimed Contributor
Solution

Re: What files hold the Volume Group info?

Hi (again):

The idea of using 'vgexport' is that it cleans up the device files in '/dev' allowing you to reuse a minor number during a 'vgcreate'. Any filesystems and data in any logical volumes in the volume group are untouched. LVM disks have a "header" written to the physcial disk(s) which describe their layout. It is this header that is read by 'vgimport'.

For ease of use (should you want it), do something like:

# vgchange -a n vg01
# vgexport -p -v -s -m /root/vg01.map /dev/vg01

...then replace your physical disks and build your new volume group. If you later decide to restore your original disks with their intact data, do:

# mkdir /dev/vg01
# mknod /dev/vgXY/group c 64 0x010000
# vgimport -s -m /root/vg01.map vg01
# vgchange -a y vg01

The use of the '-s' option addes the VGID (Volume Group ID) to the mapfile describing the logical volumes. When 'vgimport' is run, this ID (signiture) is sought as each physical disk is examined. A match causes that physical disk to be added to '/etc/lvmtab' and the volume group so re-established.

Regards!

...JRF...

James R. Ferguson
Acclaimed Contributor

Re: What files hold the Volume Group info?

Hi (again):

Ooops. Drop the '-p' switch from the 'vgexport'. This enables a preview action without actually doing the export.

Regards!

...JRF...
Phil1970
Advisor

Re: What files hold the Volume Group info?

Hi James,

Just posting back to thank you once more.

The disk upgrade went very smoothly thanks to your information.

Cheers

Phil