1826319 Members
3597 Online
109692 Solutions
New Discussion

moving disks

 
jim bidebo
Regular Advisor

moving disks

running 10.20.

going to move a volyme group to another computer. the volymegroup name is vg01 and got one pysical disk. on the vg is one logical volyme. (vg01 doesnt excist on the destination computer)

which way should i go? what steps should i take before i remove the disk? and what steps should be made to add the disk to the new computer?
9 REPLIES 9
Stefan Farrelly
Honored Contributor

Re: moving disks


Easy. Simply unmount the lvol on the current system, devactivate the volume group and vgexport it.

Move the disk to the new server, connect it up, ensure you can see if with ioscan and it has a device file (may have to use the insf command on it) then create a new /dev/vgXX directory and its group file (doesnt have to be vg01, could be any name, mknod /dev/vgXX/group c 64 0x0?0000 where the ? is unique - ensure other VG's arent using the same value), then vgimport vgXX /dev/dsk/cXXXXX and your done! It will create the single logical volume which you can then mount.
Im from Palmerston North, New Zealand, but somehow ended up in London...
James R. Ferguson
Acclaimed Contributor

Re: moving disks

Hi Jim:

On the server that's going to give up the vg:

# vgexport -p -v -s -m /tmp/vg01.mapfile /dev/vg01

Then copy the mapfile to the receiving server and do:

# mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0x010000
# vgimport -s -m /tmp/vg01.mapfile vg01
# vgchange -a y vg01
# vgcfgbackup vg01

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: moving disks

Hi Jim:

BTW, drop the '-s' option from the 'vgexport'/'vgimport'. Doing so will remove the vg name from /etc/lvmtab and remove the associated device files from the exporting system. The 's'harable option prevents this, and I don't think this is what you want.

...JRF...
Bill Hassell
Honored Contributor

Re: moving disks

Another way which is very easy with your single volume group is to use SAM. Simply shutdown the old system, remove the disk(s) and reconnect to the new system. Then power up the new system and run SAM. Go to the Disks then Volume Group menus, and finally, Action->Import at which point SAM will scan all of your attached disks.

SAM will display all the unknown volume groups by reading the VG signature at the front of each disk. Highlight the disk you want to import, then down below, fill in the volume group name (as in: vg01). If you used the default lvol1, lvol2, etc names then perform the task and the job is done.

If you do not have standard lvol names, you can create the mapfile with vgexport as mentioned before, or you can simply rename the lvol files (be sure you rename rlvol and lvol), or manually create the mapfile. It's format is incredibly simple:

1 lvol1
2 lvol2
3 lvol3
4 lvol4
...

which means you can manually create it.


Bill Hassell, sysadmin
Sanjay_6
Honored Contributor

Re: moving disks

jim bidebo
Regular Advisor

Re: moving disks

this is what i get if i run vgexport... is this normal?

# vgexport -p -v -m /tmp/vg01.mapfile /dev/vg01
Beginning the export process on Volume Group "/dev/vg01".
Volume group "/dev/vg01" is still active.
/dev/dsk/c0t1d0
Santosh Nair_1
Honored Contributor

Re: moving disks

This is normal output from vgexport. However, if you're planning on moving the VG and the disk out of your system, you'd have to also:

umount all the filesystems from this VG
vgchange -a n VG (deactivate the VG)
then vgexport -s -m /tmp/vg.map VG

then take the disk out and move it to the destination system. Copy over the map file.

mkdir /dev/VG
mknod /dev/VG/group c 64 0x0nn0000 where nn is unique
vgimport -s -m /tmp/vg.map VG
vgchange -a y VG

then update the /etc/fstab file to include the mounts from this VG and finally mountall.

-Santosh
Life is what's happening while you're busy making other plans
Frederic Sevestre
Honored Contributor

Re: moving disks

Hi Jim,
Every thing is ok. The vgexport -p (preview) is used only to get the mapfile and the disks list. You may find the mapfile on the current directory
If you really want to export your vg, you'll have to desactivate it before :
vgchange -a n vgxx

Regards

Fr?d?ric
Crime doesn't pay...does that mean that my job is a crime ?
Isaac_4
Frequent Advisor

Re: moving disks


- The first thing that you should know is the quantity of logical volumes you have in VG to care

the above-mentioned to be able to execute with success the vgimport

- I pass two it is to make the following steps

mkdir /dev/VGNAME

mknod /dev/VGNAME/group c 64 0x0nn0000

vgimport -m /tmp/vgfile -v /dev/vgname /dev/dsk/cxtxdx

The file vgfile can generate it manually and it should contain the following thing according to the quantity of lvols that you had in the VG.
#cat /tmp/vginfo
lvol1
lvol2
lvol3 etc...




vgchange -a and vg01

The file /etc/lvmtab is not necessary to generate it again because when the vgimport this file is executed it is upgraded.

After this to carry out a fsck for each lvol and to verify the consistency of the filesystem
The time is gold