Operating System - HP-UX
1834508 Members
2358 Online
110068 Solutions
New Discussion

Moving a filesystem from server A to server B

 
SOLVED
Go to solution
Dave Johnson_1
Super Advisor

Moving a filesystem from server A to server B

In a few weeks I will have the need to move a filesystem from server A to server B. I already know how to move the LUNs on the XP from one server to the other (I have done this allot).

What I have not done before is to move the LUNs in such a way as to preserve the volume group, lvol, and filesystem that is stored on the LUNs. What I need are the steps to be taken on server A before the LUNs are moved as well as the steps on server B after they are moved so I can simply mount the filesystem and not have to restore from tape. The filesystem is made up of 22 LUNs from the XP, each is 7040MB in size, so restore from tape is a couple of hours I would like to avoid. The volume group has only 1 lvol in it which is the entire volume group as the filesystem I want to move. I am using striping (size 64K, count 2) if that makes a difference. Both servers are connected with dual FC paths to an XP512, however the "c" numbers are different. Server A has device file names c4tXdY and c6tXdY where Server B has device file names c5tXdY and c7tXdY. I do have the ability to test any suggestions with a small number of LUNs (up to 4).

For those of you who may think this a little trivial (backup A, move the LUNs, restore from tape on B), the real story is I am moving 7 filesystems (each fs is 1 lvol consuming all the space of 1 vg) from A to B and 4 from B to A. The 2 servers are trading roles (moving L2000 as DB server to App layer and N4000 as App layer to DB server). Restore from tape would be more than 10 hours so this would save me a LOT of time if I can do it.

Thank you in advance for any suggestions,
-Dave
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor

Re: Moving a filesystem from server A to server B

Hi Dave:

If I follow correctly, you need to 'vgexport' from server-A; disassociate the physical LUNs from server-A; associate the LUNs with server-B; and 'vgimport' on server-B. Define directory mount points and modify server-B's '/etc/fstab' appropriately, and mount your filesystems.

For the 'vgexport' and subsequent 'vgimport' you can either use the '-s' option to search for matching VGIDs thereby automatically finding your physical disk when they are present on server-B; or you can collect the physical path information into a file during 'vgexport (with the '-f' option); edit those paths to conform to server-B; and then 'vgimport' from server-B using the correct paths.

Have a look at the manpages for 'vgexport' and 'vgimport' for more information. Remember, you can use the 'p'review option to create the path 'outfile' for editing ahead of your actual move. The 'mapfile' holds the logical volume names with the addition of the VGID if the '-s' option is used.

Regards!

..JRF...
Patrick Wallek
Honored Contributor
Solution

Re: Moving a filesystem from server A to server B

What you need to do:

1) Unmount everything on servera
2) Deactivate VGs on servera
3) vgexport -m vg??.map -s -v /dev/vg??
(If you want to preview first, add '-p' to
vgexport)
4) Copy vg??.map files from servera to serverb
5) Move LUNs from servera to serverb on the XP
6) 'ioscan -fnC disk' on serverb
7) 'insf -C disk' on serverb
8) ioscan again to verify disk files are created.
9) 'mkdir /dev/vg??' for all VGs on serverb
10) 'mknod /dev/vg??/group c 64 0x0?0000' for all VGs on serverb
11) 'vgimport -m vg??.map -s -v /dev/vg??' on serverb for all VGs
12) Modify /etc/fstab to add LVOLs
13) 'vgchange -a y vg??' for all VGs on serverb
14) 'mount -a' on serverb

I think this should do it. As a fall back you should have 1, preferably 2, good backups in case something goes terribly wrong.
Steven E. Protter
Exalted Contributor

Re: Moving a filesystem from server A to server B

Shalom Dave,

To be safe, you must do a full backup before you start.

On the soon to be old owner of the fs

vgchange -a -n vg01 #use real vg
vgexport -p -m /tmp/vg01.map vg01
#use ftp whatever to tranfser the map file to the new machine.
# assign luns to new machine

vgexport vg01 # if it exists
cd /dev
mkdir vg01/group c 64 0x0010000 #the last 1 should usually correspond with the 1 in vg01
vgipport -m /tmp/vg01 /dev/dsk/c1t1d0 #use real disk and list them all.

You should lose no data.

But back up anyway.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dave Johnson_1
Super Advisor

Re: Moving a filesystem from server A to server B

I REALLY love this forum. Answers arrive so fast and to get 3 that back each other up arriving with in minutes tells me they are good. Also having seen James and Steven on many answers I have read in the past gives me that warm fuzzy feeling. I will not be able to test this until tomorrow so I will hold off on the points until then.
Thank you all 3, stay tuned,
-Dave
TwoProc
Honored Contributor

Re: Moving a filesystem from server A to server B

Dave, as per James F's post on using the "-s" switch for the vgimport. I used to be afraid of and suspicious of such an "automatic" move. However, slide your maps over as per Patrick W's guidesheet, and go ahead and use the "-s" switch. I became quite confident of using that switch to automagically find my stuff for me with with Service Guard. The package, as presented as standard by HP with the Oracle "fulfillment" option, provided the moves with the "-s" option for the vgimport, and it worked flawlessly each time.

As per the usual caveat applies. Why not create a vg on some test server to that XP and practice moving it around to different servers first. Try it with and without the "-s" option. This is how you'll feel confident and ready to make the move with whatever method you like best.
We are the people our parents warned us about --Jimmy Buffett
Dave Johnson_1
Super Advisor

Re: Moving a filesystem from server A to server B

Last Saturday, I followed the sequence of steps layed out by Patrick Wallek. It worked perfectly. I did this with a new test filesystem several times last week before doing it on the "real" filesystems last Saturday. I did use the -s option to vgimport and had no issues of any kind. Three of the filesystems contained Oracle 9i databases and they are working normally.
Thank you all who provided responses.
-Dave