Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
Showing results for 
Search instead for 
Did you mean: 

Moving disk array to another system

Go to solution
John Hietala_1
Occasional Contributor

Moving disk array to another system

I have a disk array on a system with a volume group and logical volume defined. I want to move this disk array to another system and maintain the volume group and logical volumes. How do I do this?
Patrick Wallek
Honored Contributor

Re: Moving disk array to another system

On the current system with the array attached:

# vgexport -m vg??.map -p -v -s /dev/vg??

Or if you want to make sure the VG doesn't exist on the source system, just omit the '-p' option.

Then on the new system.

Copy the vg??.map from the source system.

# mkdir /dev/vg??
# mknod /dev/vg??/group c 64 0x0?0000
# vgimport -m vg??.map -v -s /dev/vg??
# vgchange -a y /dev/vg??

Then add the appropriate entries to /etc/fstab, mount them up and you are ready to go.
Steven E. Protter
Exalted Contributor

Re: Moving disk array to another system

I'd do a backup before I start.

Maybe vgexport the vg and vgimport the vg on the target server.

Steven E Protter
Owner of ISN Corporation
Sridhar Bhaskarla
Honored Contributor

Re: Moving disk array to another system


You will need to do the following steps in a nut shell.

1. Create map files on system A.

vgexport -v -s -m /tmp/ vgxx
vgexport -v -m /tmp/ -f /tmp/vgxx.disks vgxx

Repeat the above for all the volume groups.

Copy,, vgxx.disks and /etc/fstab onto system B into /tmp.

2. Move the Array.

Unmount all the filesystems on system A. Edit /etc/lvmrc and make AUTO_VG_ACTIVATE to 0. Enable only the VGs required to be active inn it. Shutdown the system. Physically disconnect the array and move it to the other
3. Import the VGs on system B.

Shutdown system B if the disk array is scsi. Fiber can be attached online.

#ioscan -f

Create directories and group files for the volume groups

#mkdir /dev/vgxx
#mknod /dev/vgxx/group c 64 0x0?0000

(Use a valid uniq number in the minor portion "?" of mknod)
#vgimport -s /tmp/ vgxx
#vgchange -a y vgxx

Repeat the above for all the VGs. vgxx.disks can tell you the disks configured under each VG on system A. It will help identify the missing disks.

Merge /tmp/fstab and /etc/fstab for the logical volumes corresponding to the new volume group. Create mount points and do
'mount -a' to get the filesystems mounted.


Once you found system B is successfully working, export the sparce VGs on system A.

vgexport vgxx

And restore your old /etc/lvmrc.


You may be disappointed if you fail, but you are doomed if you don't try
A. Clay Stephenson
Acclaimed Contributor

Re: Moving disk array to another system

The easiest method is to use the -s flag of vgexport. This write an identifier to the mapfile that the vgimport command can then use.

On the old system:
vgchange -a n /dev/vg02
vgexport -m /tmp/ -s /dev/vg02
Down the array and disconnect.

FTP/rcp/tar the /tmp/ file to the new system:

On the new system:
Connect and power-up the array.
mkdir /dev/vg02
cd /dev/vg02
mknod group c 64 0x020000

Make sure that you choose a unique minor device number for the group node. By convention, vg00 gets 0x000000, vg01 gets 0x010000, vg10 gets 0x0a0000, ... but that's just a convention.

ioscan -fn
vgimport -m /tmp/ -s /dev/vg02
vgchange -a y /dev/vg01

This method allows you to import the array without worrying about SCSI paths but it may not choose the most optimum SCSI pathing but that can easily be corrected later, if necessary. You next mkdir your mountpoints, add entries to /etc/fstab for any filesystems, and mount the filesystems.
If it ain't broke, I can fix that.