LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-23-2017, 05:45 PM   #1
trackstar2000
Member
 
Registered: Apr 2013
Posts: 75

Rep: Reputation: Disabled
Migrating NFS shares


Hello,

We have a nas from Hitachi that will be retiring and moving to a new nas.


On my linux machine called lnx1, I have 5 NFS shares mounted from the Hitachi nas. This is how I am thinking of doing and please advise if there is a better way.

1) mount addtional 5 nfs shares from the new nas on lnx1.

2) copy data from the current mounts to the new mounts. Each night synchronize the data over

3) On date of switch over, just un-mount the nfs shares from both nas after final data copy. Then remount the shares from the new nas to use old directory . Update the IP info in the /etc/fstab

Thanks advance!
TT

Last edited by trackstar2000; 08-23-2017 at 05:53 PM.
 
Old 08-23-2017, 06:49 PM   #2
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,396
Blog Entries: 8

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
rsync is efficient enough that you can do the sync many times per day.

Assuming you have so much data that it will take a while to do the copy, I'd use rsync's bandwidth limit option to restrict how much bandwidth it consumes during the daytime. The, just use ctrl-c to end the rsync process and run an unrestricted rsync during night-time. Note that rsync plays nicely with other software accessing/changing files while it's running. It won't get everything in a single pass that way, of course, but you can just keep on running rsync until it gets everything.
 
Old 08-23-2017, 09:17 PM   #3
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042
The bwlimit option is a good suggestion. If not, you might choke your network or your processor.

Rsync really is nice. You can spend an arbitrary long time copying the bulk of the files. Of course the copies will not be completely up-to-date while time elapses. But then you can do just one last rsync copy just before the migration. Those are relatively few files and it is a quick action.

If the nfs shares are equal on both NAS-es you can change the IP address on the new one to the one the old NAS had. After taking the old NAS off-line or changing its IP address of course.

Once you are using your new NAS, you can do an additional rsync -auv to get any files which were changed anyway just before the migration.

Your biggest challenge is not to mix up source and destination during rsync actions.

jlinkels
 
Old 08-24-2017, 11:26 AM   #4
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 1,770

Rep: Reputation: 797Reputation: 797Reputation: 797Reputation: 797Reputation: 797Reputation: 797Reputation: 797
Quote:
Once you are using your new NAS, you can do an additional rsync -auv to get any files which were changed anyway just before the migration.
This is risky, even with the -u or --update option.
Better have the last rsync completed before you mount it for regular use.
One tip for rsync options:
in addition to -a you should have -H (keep hardlinks) and --delete (delete deleted files).
 
Old 08-24-2017, 11:43 AM   #5
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,396
Blog Entries: 8

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
If it's possible to log into the destination NAS, it's best to run rsync on it directly (to "pull" files) and use the following options:

Code:
rsync -vaxAXH --delete --bwlimit=7500 ...
Running directly on the destination (as root) is the best way to ensure it's able to fully replicate all file permissions etc. Note that rsync will tell you if it was unable to set anything.

Oh, the bwlimit thing is not needed if the NAS's are using wired gigabit ethernet. I give the example of 7500 as something suitable for fast ethernet (100Mbit).

With gigabit ethernet, though, spinning hard drive speeds just aren't fast enough to eat up more than a small fraction of the available bandwidth.
 
Old 09-07-2017, 12:31 AM   #6
trackstar2000
Member
 
Registered: Apr 2013
Posts: 75

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by MadeInGermany View Post
This is risky, even with the -u or --update option.
Better have the last rsync completed before you mount it for regular use.
One tip for rsync options:
in addition to -a you should have -H (keep hardlinks) and --delete (delete deleted files).
Thank you. I had tested the rsync at home with the -a --delete and it was straight forward. I will try the -H option.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to configure an NFS server and mount NFS shares on Ubuntu 14.10 LXer Syndicated Linux News 0 11-26-2014 07:31 PM
LXer: How to configure a NFS server and mount NFS shares on Ubuntu 14.04 LXer Syndicated Linux News 0 07-09-2014 09:00 AM
Migrating NFS service to Linux pablo1999 Linux - Server 3 08-07-2012 05:10 AM
NFS shares sachinh Linux - Server 3 06-19-2008 03:42 AM
Migrating to NFS frkstein Linux - General 1 01-09-2003 08:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration