1753873 Members
7591 Online
108809 Solutions
New Discussion юеВ

vgexport

 
SOLVED
Go to solution
Sharon Bi
Frequent Advisor

vgexport

Dear All,

I have a R390 here. There are 8 hard disks connecting to it. I am going to replace 4 of them (9G) with four 18G disks. I am not sure what shall I do before I take out those 4 disks. Is it:
vgexport ?p ?v ?m vg05.mapfile /dev/vg05
vgexport ?p ?v ?m vg06.mapfile /dev/vg06
vgexport ?p ?v ?m vg07.mapfile /dev/vg07
vgexport ?p ?v ?m vg08.mapfile /dev/vg08

After I envoke these commands, then I can power down the enclosure, take out the disks, put in new disks , turn the power back on and then do pvcreate/vgcreate/lvcreate. Is this the correct procudure?

Thanks you very much for your help!
4 REPLIES 4
Dave Wherry
Esteemed Contributor

Re: vgexport

Sharon,
vgexport is not going to help you. When you do a vgexport the data stays on those physical disks. When you remove the disks, the data goes with them. The new disks have no data on them and nothing to vgimport.
There are a few of options for you.
The first way is to backup all of the data. Delete the logical volumes and volume groups. Swap the disks and recreate your volume groups and logical volumes. Then restore all of the data.
If you have enough space on those original disks you could move data around to free up one disk at a time. Copy it, mirror it, even pvmove might help. Free up one disk at a time and then swap it. You can then move data onto the new disk and free up another of the old ones. Just keep repeating this.
Denver Osborn
Honored Contributor
Solution

Re: vgexport

Sharon,

If your intent is to remove those volume groups, replace the drives, then recreate the volume groups (if the max pe per pv is too low for the 18GB drives)and lvols then restore the data from backup... It sounds like you have the idea right. The only thing different would be;

1. deactivate the volume groups first; unmount any filsystems associated w/ vg's then vgchange -a n /dev/vg??

2. vgexport -v /dev/vg??
you wouldn't need -p to preview or -m for a map file. This will essentially remove the vg's from the box.

3. depending on the disk enclosure (hot pluggable?) you might have to power the box off, then replace drives and power the system back up for it to properly recognize them.

4. recreate the volume groups
mkdir /dev/vg??
mknod /dev/vg??/group c 64 0x0?0000
pvcreate /dev/rdks/c?t?d?
vgcreate /dev/vg?? /dev/dsk/c?t?d?

5. Finally recreate the logical volumes, and the filesystems then mount them up and restore data from tape.

Before doing any changes you may want to get a print out of you /etc/fstab and "ll /dev/*/group" which can be used in recreating the group files.

I hope this helps you out with your task, if that was your intent to remove and recreate them from scratch.
surendhar prakash.J
Frequent Advisor

Re: vgexport

Hi

Vgexport will remove the volume group from your system.but data will be safe.
first you find whether all in same volume group or different.If it is same volume group you will not have any problem.if it's sits with some other volume group, you need to do "vgreduce"

find out the physical voume by using "ioscan"

#ioscan -fnC disk |pg ( this will scan all physical disk)

you can find device file for all disks

#vgdisplay -v |pg (this will list all volume group with physical volumes)
by using vgdisplay you can find out which physical volume sits in which volume group

Then you find out howmany logical volume sits in each volume group (which you are going remove) and find out what type of file system of each logical volume.

take a backup of your all logical volume by using "sam" or using "tar"

#vgexport /dev/vgXX ( this will export (remove) the volume group named in XX)

Now you can remove exiting physical volume and add the new physical disk then reboot the system

Adding the disk steps as follows:-

1)#ioscan -fnC disk |pg (find new physical disk device file)

2)#pvcreate /dev/rdsk/cXtXd0 (do it for all new physical disk only)

3)#vgcreate /dev/dsk/cXtXd0

4)#lvcreate -L XXXX /dev/vgXX (XXXX-size of your logical volume)

5)#newfs -F hfs/vxfs /dev/vgXX/rlvolX (X is name of your logical volume)

6) create a mount point directory and mount it

7) modify the /etc/fstab accordingly

8) restore the old backup

and one more way

you can move your physical volume one to one by using "pvmove" see the man page for pvmove "#man pvmove"

Best of luck

J.suren.
Tim Malnati
Honored Contributor

Re: vgexport

Basically you have it right. vgexport is the best utility to use to eliminate volumes from the system. It is far easier to perform than breaking them down manually (lvremove, vgremove, etc) and has the side benefit of having the old drives quickly back to where they were should something go wrong (what if you have a bad tape). Be sure to label the old drives as your removing them so they can easily returned to their original locations should the need arise. I disagree with not keeping map files though (in another thread), you will want them around should you need to bring any of the original drives back. It can be done without them (not easy), but why chance it.

There are a variety of other good comments on this thread, so I won't repeat them. Personally, I prefer to copy data from one drive to another instead of using tape. If you have Mirrordisk, advanced JFS, adequate pe per pv and and a spare disk slot; you can do the entire job without any lost time on these volumes at all.

One additional thing. By default, the kernel is configured with ten volume group communication channels. I notice that you have used at least eight of them (and probably vg00 brings it to nine). The /dev/vgXX/group devices are what I'm talking about here. Reusing a channel is ok, but you will be in a world of hurt if you assign a channel to more than one volume group.