1838373 Members
3321 Online
110125 Solutions
New Discussion

Re: vgexport.

 
SOLVED
Go to solution
Sunil_47
Occasional Advisor

vgexport.

Hello.

Could someone please clarify the following regarding vgexport/import? Please bear with me as I am new to this.

1. For a disk to be simply removed, kept aside for a while, reinserted would that need a vgexport prior to it and a vgimport/vgchange after? If so, could you please give the steps? Should the filesystems and mountdirs, space etc be redone?

2. When I vgexport, where would the contents of the disk move to? What is best Network or tape? What's the procedure to store the entire contents of a disk in a safe place? How to restore it back to original condition after reinserting a disk?

Thanks for your help.
11 REPLIES 11
Sudeesh
Respected Contributor
Solution

Re: vgexport.

Sunil,
You are totally mistaken about vgimport/vgexport. Try to pick more about Logical Volume Manager to better understand these concepts.

http://docs.hp.com/en/5990-8172/ch06.html will give you some idea.

vgexport will just remove the system config entries from the HP box and will not do anything on the data(I mean data will remain on disk). These disks can be attached to another system and use vgimport to configure the vg in that system and start using the data.

About your questions:
1.vgimport/vgexport are related to vgs and not physical disks. When you ask "For a disk to be simply removed, kept aside for a while...." does that mean you have only one physical disk in that vg?

2. When you do vgexport, content of the disk remains. So no need of backup/restore.


Sudeesh

The most predictable thing in life is its unpredictability
Pete Randall
Outstanding Contributor

Re: vgexport.

First, vgexport does not back anything up - not to disk, not to tape, not anywhere. The vgexport command simply 'disconnects' a VG from one system, normally in preparation for moving it to another system, though it can be imported back to the same system (sometimes done to change the vg name).

So, the answer to your first question is yes. You would vgexport the VG (which may consist of several disks, by the way). And, no, you don't have to do anything to the filesystems - they remain intact on the disk.

For your second question, the answer is that the contents don't go anywhere, they remain right there on the disk.

The steps are:

1. export
vgexport -s -m /tmp/vg01map /dev/vg01

2. copy the maps to the new system

3. prep the new system
mkdir /dev/vg01
mknod /dev/vg01/group c 64 0x010000

4. import
vgimport -s -m /tmp/vg01map /dev/vg01

5. activate
vgchange -a y /dev/vg01

Note that export can also be run in preview mode, which will build the map file but not actually disconnect the VG.


Pete


Pete
Victor Fridyev
Honored Contributor

Re: vgexport.

Hi,

I don't want to ask you about the reason of removing/inserting the disk...
If you don't want to get error messages when the computer is starting up, you have either remove the volume group from lvmtab or cancel the volume group automatic activation.
In order to remove the vg, unmount all its file systems and run vgexpor vgname.
All information on the disk is untouched, so you (theoretically) don't need any specific backup. Additionally you have to comment out entries for all file system from this volume group in /etc/fstab.
After reinstalling the disk you have to do the following:
mkdir /dev/vgname
mknod /dev/vgname/group c 64 MINOR
vgimport /dev/vgname /dev/dsk/xxxxx
vgchange -a y vgname
(MINOR is a uniq hexa number, you can see it befere export ls -ls /dev/vgname/group)
and uncomment appropriate entries in /etc/fstab

HTH
Entities are not to be multiplied beyond necessity - RTFM
Sunil_47
Occasional Advisor

Re: vgexport.

Hi Viktor and Pete,

I am performing a cold installation. So, I have to remove all disks except root disks.
However, I have to only vgexport the root disk before the installation but I have to vgexport and vgimport all other disks.

vg00 & vg01 info from /strings/lvmtab:

/dev/vg00
!8;e
/dev/dsk/c0t0d0
/dev/dsk/c1t0d0
/dev/vg01
/dev/dsk/c0t1d0
/dev/dsk/c1t1d0

For each non-vg00 disk that I remove, I perform the following prior to disk removal. BTW, I will remove both the mirrors. In our system, each vg has two mirrors.

Below example is for vg01.

1. comment appropriate entries in /etc/fstab
2. vgexport -s -m /tmp/vg01map /dev/vg01
3. copy the map to the new system
4. Remove /dev/dsk/c0t1d0 and /dev/dsk/c1t1d0
5. After reinserting ...
6. mkdir /dev/vg01
7. mknod /dev/vg01/group c 64 MINOR
8. vgimport /dev/vg01 /dev/dsk/c0t1d0
9. vgchange -a y /dev/vg01
10. uncomment appropriate entries in /etc/fstab

Additional Step:

Mirroring /dev/vg01/lvol1:

11. lvextend -m 1 /dev/vg10/lvol1 /dev/dsk/c1t1d0


* Please let me know if this is correct.

* Should the vg map for each vg from above process should be ftped to another system?
Tim D Fulford
Honored Contributor

Re: vgexport.

Hi

> Below example is for vg01.
> 1. comment appropriate entries in /etc/fstab
> 2. vgexport -s -m /tmp/vg01map /dev/vg01
> 3. copy the map to the new system
> 4. Remove /dev/dsk/c0t1d0 and /dev/dsk/c1t1d0
> 5. After reinserting ...
> 6. mkdir /dev/vg01
> 7. mknod /dev/vg01/group c 64 MINOR
> 8. vgimport /dev/vg01 /dev/dsk/c0t1d0
> 9. vgchange -a y /dev/vg01
> 10. uncomment appropriate entries in /etc/fstab

1. Unmount the filesystems first
2. You probably want to do vhchange -a n vg01 before the vgexport
3. OK.. ftp is fine
4. OK
5. OK
6. OK
7. OK
8. vgimport -m /tmp/vg01map /dev/vg01 /dev/dsk/c0t1d0 /dev/dsk/c1t1d0
9. OK
10. do vgcfgbackup vg01 first.. the entries ihn fstab do not exist, so create them & then do "mount ...."
11. Nope my step 8. will have done this for you.. as long as they were originally mirrored..

The above in NOT possible with vg00, if you want to transfer vg00 you would be best using Ignite & re-building the system. There are many reasons why doing the above for vg00 will not work, but not least of which you need a running OS to do the vgimport etc on!!!

Regards

Tim
-
Bharat Katkar
Honored Contributor

Re: vgexport.

Yes TIM has nicely explained it above:

No need to separatelt mirror the volumes becuase vgimport will take care of it.

Only thing i would like to add is when u reinstall the OS anyway fstab may not remain. You will have fresh fstab file. So what you can do is backup your fstab file somewhere or note down the entries.
Then once you are done with the installation and importing part you can simply add the required entries to fstab file.

Hope that helps.
Regards,
You need to know a lot to actually know how little you know
Sunil_47
Occasional Advisor

Re: vgexport.

Hi All,

Thank you very much for the answers. Lastly, could you tell how big a mapfile could be in size? Is there a storage requirement for the mapfile?
Joseph Loo
Honored Contributor

Re: vgexport.

hi sunil,

the size of mapfile is very small, probably will not reach more than 100k, unless u have a lot of logical volumes in that volume grop.

keep the mapfile till u want to vgimport again, otherwise, u may remove it.

regards.
what you do not see does not mean you should not believe
Tim D Fulford
Honored Contributor

Re: vgexport.

Hi

the map file is a few 10's of lines. there is one entry for every LV. So you will have a max of 255 lines.

Tim
-
Sunil_47
Occasional Advisor

Re: vgexport.

Dear members,

I first started with vgexport but realized we will be removing all non root disks and re-insert them later. Here is the list of steps I assembled in order to remove and reinsert the disks. Kindly comment, suggest changes or let me know. Thanks in advance.

1. Unmount all the filesystems first (using umount)
2. Remove the entries from /etc/fstab for these filesystems
3. Delete the mountpoints
4. vgexport -m /tmp/before_vg01 -p /dev/vg01 -- create map1
5. ftp the map1 to the new system
6. lvreduce -m 0 /dev/vg01/lvol1 /dev/dsk/c0t1d0
7. vgreduce /dev/vg01 /dev/dsk/c0t1d0
8. vgexport -m /tmp/after_vg01 -p /dev/vg01 -- create map2
9. ftp the map2 to the new system
10. vgchange -a n /dev/vg01
11. vgexport /dev/vg01

Repeat the above steps for all VGS.

12. Place labels before removing the disks
13. Shutdown the system and remove all non-VG00 disks.
14. Perform the activity
15. Shutdown the system and reinsert all non-VG00 disks.
16. mkdir /dev/vg01
17. mknod /dev/vg01/group c 64 MINOR
18. vgimport -m /tmp/ before_vg01 /dev/vg01 /dev/dsk/c0t1d0 /dev/dsk/c1t1d0
19. vgchange -a y /dev/vg01
20. vgcfgbackup vg01
21. Repeat steps 16-20 for all other VGs
22. create entries in /etc/fstab
23. Mount all the filesystems (using mount)

Bharat Katkar
Honored Contributor

Re: vgexport.

Hi Sunil,
Following steps are not required becuase mapfile1 will have alll mirroring information and once you restore back this map file it works. No need to reduce also keep as it is and do vgexport once you are sure about mapfile1.

6. lvreduce -m 0 /dev/vg01/lvol1 /dev/dsk/c0t1d0
7. vgreduce /dev/vg01 /dev/dsk/c0t1d0
8. vgexport -m /tmp/after_vg01 -p /dev/vg01 -- create map2
9. ftp the map2 to the new system

Accordingly your restoration process also reduces.

Hope that helps.
Regards,
You need to know a lot to actually know how little you know