Operating System - HP-UX
1833759 Members
2310 Online
110063 Solutions
New Discussion

Re: vgexport and vgimport

 
SOLVED
Go to solution
kunjuttan
Super Advisor

vgexport and vgimport

hi all,
when we have to use vgexport and vgimport comand?
14 REPLIES 14
Vishu
Trusted Contributor

Re: vgexport and vgimport

hey Dipesh,

I was waiting for your thread only. :)

have you tried going thru the man pages or on internet. if you did, where is your dount. "What these commands do" cannot be a doubt.

So, preferably try finding out yourself first. Its a good suggestion. If you want to be a good System Admin, then first try things finding out yourself.

I hope you understand what i m trying to say :)
kunjuttan
Super Advisor

Re: vgexport and vgimport

Thanx vishu.I had gone through some docs.But I am getting confused between vgexport and vgcfgbackup??
Vishu
Trusted Contributor

Re: vgexport and vgimport

I really appreciate your effort.

1) vgexport - export an LVM volume group and its associated logical volumes. It remove the specified VG from the /etc/lvmtab file and associated device files including vg_name from the /dev/ directory. It is useful while moving your disks across system, renaming your VGname etc.

2) vgcfgbackup - create or update LVM volume group configuration backup file. It saves the LVM configuration for a volume group in a default or alternate configuration backup file (/etc/lvmconf directory by default). vgcfgbackup runs automatically each time an LVM command changes the LVM configuration. It is useful when you have a corrupted LVM header of a disk by restoring VG configurations on that disk.
R.K. #
Honored Contributor
Solution

Re: vgexport and vgimport

Hi Dipesh..

Few points..

vgexport:
- Can be used to remove existance to vg entirely from server
- To create map file with details of vg like VGID, names of lvols etc for future use.
- Can be done to get back a VG (say if you do not know which disks are involved in this VG)
- Example
# more vg00.mapfile
VGID 09342e62418b9aab
1 lvol1
2 lvol2
3 lvol3
4 lvol4
5 lvol5
6 lvol6
7 lvol7
8 lvol8

vgcfgbackup:
- to backup vg configuration
- holds information of disks involved in this vg
- Can be done on any one disk in a vg (say replacement disk)
- Example
# strings vg00.conf.new
CONFIG01
/dev/vg00
/dev/rdsk/c1t2d0
-- junk characters--


Hope you got some idea..
Don't fix what ain't broke
Bijeesh
Respected Contributor

Re: vgexport and vgimport

hi,
.....by using vgexport,it will remove all the VG related configurations from the server ,but the data on the disk will be untouched, which we can import on the same server later or on another one.

kunjuttan
Super Advisor

Re: vgexport and vgimport

Thaks gurus.I have somemore doubts-
1)Is it necessory to deactivate the vg before vgexport?
2)I got the below command from docs.here it is showing exporting vg01.So what is the /tmp/vg01.map file?where it will be stored?What is for -v and -m?
#vgexport -v -m /tmp/vg01.map vg01
3)I think data will be intact.right?
4)And while connecting to another box,it will take the vg01 as what if vg01 is already available with that box?


R.K. #
Honored Contributor

Re: vgexport and vgimport



1)Is it necessory to deactivate the vg before vgexport?
yes

2)I got the below command from docs.here it is showing exporting vg01.So what is the /tmp/vg01.map file?where it will be stored?What is for -v and -m?
#vgexport -v -m /tmp/vg01.map vg01

Full path is given in your command itself
/tmp/vg01.map

-v Print verbose messages including the names of the physical volumes associated with this volume group.


3)I think data will be intact.right?
Yes...untouched

4)And while connecting to another box,it will take the vg01 as what if vg01 is already available with that box?
Yes..but you need to move those disks to another server, then follow:
# mkdir /dev/vgXX --> (you could also choose another VG name)
# mknod /dev/vgXX/group c 64 0xXX0000
# vgexport -v -s -m /tmp/vgXX.map vgXX


Don't fix what ain't broke
kunjuttan
Super Advisor

Re: vgexport and vgimport

Thanks RK.But the last point is not clear.
4)And while connecting to another box,it will take the VG01 AS WHAT IF VG01 IS ALREADY AVAILABLE WITH THAT BOX???
Yes..but you need to move those disks to another server, then follow:
# mkdir /dev/vgXX --> (you could also choose another VG name)
# mknod /dev/vgXX/group c 64 0xXX0000
# vgexport -v -s -m /tmp/vgXX.map

Are you tellig to change the vg name?
And I think after connecting the disk to other server we have to do vgimport.??
R.K. #
Honored Contributor

Re: vgexport and vgimport

Hi Again..


>> Are you tellig to change the vg name?
You can change the name of VG if you want or if another VG of same name do not exist in other server. Else use the same name for VG.

>> And I think after connecting the disk to other server we have to do vgimport.??
Yes, as the data is present on these disks we will remove them and replace them to another server, create VG (mkdir..mknod..) and then we will do vgimport with the same mapfile that was created by vgexport command on the previous server. So after executing vgimport command, it will search for disks having same VGID (mentioned in mapfile) and include them as part of this newly created VG. Then it will same as earlier VG in previous server.
Don't fix what ain't broke
Pete Randall
Outstanding Contributor

Re: vgexport and vgimport

I think RK is saying that if you export vg01 from one box and try to import it on another box that already has a vg01, you will need to change the name by following the steps he's outlined.


Pete

Pete
kunjuttan
Super Advisor

Re: vgexport and vgimport

Thanks RK,..
kunjuttan
Super Advisor

Re: vgexport and vgimport

Hi,
If I am changing the disk from one cotroller to other of the same server,Is it require to do vgexport??
R.K. #
Honored Contributor

Re: vgexport and vgimport

Hi Dipesh..

Probably..vgscan will be required beacuse the disk name will be changed and existing lvmtab will no longer work.

Don't fix what ain't broke
kunjuttan
Super Advisor

Re: vgexport and vgimport

Thanks..