Exporting Vg

 
SOLVED
Go to solution
SYS ADMIN_7
Advisor

Exporting Vg

Hi Guys

one small help

I have one hdd with one vg and 2 lvs on that.
Now i want to shift the hdd to other bayb in the disk array without loosing the data.

Is the following proedure is fine

1) unmount the fs on this vg ( i mean lv)
2) deacivate the vg
3) export the vg with -m option ( to create the map file)
4) physically connectb the hdd in other slot
5) import the vg with the new physical path.

What is the significance of -s option.

Rgds
Suraj
4 REPLIES 4
Bharat Katkar
Honored Contributor
Solution

Re: Exporting Vg

Hi Suraj,

1. Create Map File first.

# vgexport -p -v -m vgmapfilename /dev/vgxx
** Note the -p option here see man vgexport

2. Unmount the Filesystems

3. Deactivate the VG

# vgchange -a n /dev/vgxx

4. Insert the HDD in new slot.

5. Import the VG

# vgimport -m vgmapfilename /dev/vgxx

6. Activate the VG

# vgchange -a y /dev/vgxx

7. Mount the Filesystems.

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

Re: Exporting Vg

your steps are correct except use -s option also while you export the VG. This way when you import you do not have to give the new physical path for the hard disk because they will change.

-s option will put the VGID in the map file and then when you import with -s option it will check all the disks that match the VGID and import all those disks without youi having to give the physical paths.

just type vgimport -s -m mapfile /dev/newvgname when importing after moving.

Re: Exporting Vg

hi,

i m not sure at 100% but if i have good memories i think vgexport and import -s is the shared mode . This system is really cool when you have an array of disk and two servers . In fact with this option you can give the visibility of one vg on two servers .

for example you have a vg with some fs. all the informations on your fs never change ,they are here only in order to be consult: you want to mount it in read mode .

You do a map on one server with -s options.
you desactivate your vg
you import the vg on the second server.
you activate the vg in read modeon the twos
you mount in read mode .
it's okay


PS you can mount one in r/w and one in read, but if you write on one side, the other don't update the information. it's only a snapshot at mounted time


Sorry for my english
The beaver
Gary L. Paveza, Jr.
Trusted Contributor

Re: Exporting Vg

The -s option is for shared mode, however it's also very useful in this case. With the -s option, there is no need to specify the devicefile when vgimporting. Just use the -s option. The system will go out and scan for the proper disks.