Operating System - HP-UX
1755619 Members
3850 Online
108836 Solutions
New Discussion юеВ

How to import volume group and it's logical volumes

 
SOLVED
Go to solution
Lars Bylander
Frequent Advisor

How to import volume group and it's logical volumes

My L2000 (rp5450) server have 4 disks, 2 disks used for vg00 and 2 disks vg01. Due to failure in one of the disks used by vg00 I have repleaced the vg00 disks and reinstalled using ignit-ux. User data is located on the vg01 disks. I would appreciate some guidance how to import the vg01 disks si they can be used by the newly installed OS (version 11i). I do not have any LVM configuration backup.

Best regards,
Lars Bylander
12 REPLIES 12
Pete Randall
Outstanding Contributor
Solution

Re: How to import volume group and it's logical volumes

vgimport vg01 /dev/dsk/cUtVdW /dev/dsk/cXtYdZ

Assuming your logical volumes used conventional names (lvol1, lvol2, etc), there is no need for a map file.


Pete

Pete
SKR_1
Trusted Contributor

Re: How to import volume group and it's logical volumes

If you know the disk which were there in vg01, then you can directly import the Volume Group.

mkdir /dev/vg01
mknod /dev/vg01/group c 64 0x------
vgcreate
vgimport /dev/vg01 disk name

Thanks

SKR
Lars Bylander
Frequent Advisor

Re: How to import volume group and it's logical volumes

Thank you for your comments.

Will vgimport write anything to the disks to be imported? or is only /etc/lvmtab and eventually /etc/lvmconfig updated?

Executing vgimport with the option preview:
vgimport -m /tmp/vg01.mapfile -p -v /dev/vg01 /dev/dsk/c2t0d0 /dev/dsk/c1t0d0
Beginning the import process on Volume Group "/dev/vg01".
Logical volume "/dev/vg01/lvol20" has been successfully created
with lv number 1.
Logical volume "/dev/vg01/lvol21" has been successfully created
with lv number 1.
Volume group "/dev/vg01" has been successfully created.

The map files used where a copy of the mapfile: /etc/lvmconf/vg01.mapfile
Strange that lv number 1 points to 2 logical volumes!!

Best regards.
Lars
Torsten.
Acclaimed Contributor

Re: How to import volume group and it's logical volumes

What is the contents of your mapfile?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Lars Bylander
Frequent Advisor

Re: How to import volume group and it's logical volumes

The contents of the map file is:
# cat /tmp/vg01.mapfile
1 lvol20
1 lvol21

/Lars
Torsten.
Acclaimed Contributor

Re: How to import volume group and it's logical volumes

This is the problem - should be like this:

# cat /tmp/vg01.mapfile
1 lvol20
2 lvol21


IMHO you don't need a mapfile for your config, unless the lvols should be not named lvol1 and lvol2.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
James R. Ferguson
Acclaimed Contributor

Re: How to import volume group and it's logical volumes

Hi Lars:

As Torsten notes, the mapfile is useful when your logical volume names are *not* standard (i.e. are not 'lvol1', 'lvol2', etc. associated with logical volume #1 and #2, respectively).

However, there is another use of the mapfile, and that is to contain the Volume Group ID (VGID) of the physical disks comprising the volume group. If this is included (by specifying '-s' during 'vgexport' *and* during the subsequent 'vgimport'), then you can avoid having to specify the device files (pv_paths) during the process. The VGID disk signiture is read instead and and all physical disks with a matching VGID collected into a volume group.

This is particularly useful during cold-installations or when disk are moved among servers, or when SANs are rezoned, since one doesn't have to look up pv_paths for the affected disks.

See the manpages for 'vgexport' and 'vgimport' for more information.

Regards!

...JRF...



Lars Bylander
Frequent Advisor

Re: How to import volume group and it's logical volumes

Hi James,

Well I had a disk crash and did not have anything saved from vgexport. Some earlier LVM setup seems to have generated the strange mapfile:

# cat /etc/lvmconf/vg01.mapfile
1 lvol20
1 lvol21

After executing vgimport with preview I think that lvol20 and lvol21 are treated as the same logical volumes.

Anyway, since I do not want risk that data on the vg01 disks are destroyed, does vgimport only write to the config files in /etc?
Torsten.
Acclaimed Contributor

Re: How to import volume group and it's logical volumes

If you are not sure about the mapfile - leave it away and try without.

vgimport -p ...

will preview the results.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!