Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I am currently in the process of trying to migrate data from an older Linux server to a new one with the double the hard drive space and a faster processor.
For the past two weeks I have been wrestling with whether my issue was that I was using the wrong software or I had a hardware problem and the more things I try the more confusing it becomes.
The first thing I tried was copying over a 100BaseT ethernet connection using a crossover cable. I tried rsync. I tried mounting the remote system using samba and then using cp and star. The most throughput I was ever able to get was 4GB an hour or about 1MB/sec. I have 750GB in 2.5 million files to transfer, so I decided to try something else and I went and purchased an external USB drive. I tested this on a Windows XP machine and I was able to copy 44GB an hour. I then hooked it up to the Linux machine and reformatted using 4 different file systems. The fastest transfer I was able to get was 10GB an hour on the Linux system. That included using star with the -no -fsync option. I assumed that there was just something wrong with the usb drivers in that version of Linux and I went and purchased a 500GB IDE drive to stick in the old server with plans to copy the 750GB in chunks and then install the drive in the new server and copy the files over and then take it back to the old server. Unfortunately, I am currently getting about 3.5GB an hour on that drive.
Can anyone give me some ideas as to how I can get this data to copy faster? I am really wanting to do a full migration of this server over a weekend and with it taking an hour to transfer 10GB on the fastest method I have found that just won't happen, especially considering that after transferring to the external drive the data from that drive will then have to be uploaded to the new server.
Are you just copying data. Some directories you don't want to copy or backup. E.G. /proc, /sys, /tmp, /media, /mnt.
I think it would be better using nfs instead of samba for mounting the destination directory on the new server. The tar info manual has an example of copying a partition by piping the output of tar to another tar command.
Here is an example:
tar -C / -cf - /var /home /usr | tar -C /mnt/rootdir/ -xf -
The dash for the filename is what allows you to pipe the stream via stdout | stdin.
Rather than mounting a filesystem, you could use ssh or netcat (nc) for transferring the files over a crossover cable.
Using ssh, it works best if you have public key authentication setup.
Here is an example of using tar to transfer files over an ssh tunnel:
Code:
cd Documents/; tar -C ~/Documents/ -cf - amiga* | ssh hpmedia tar -C Documents/ -xvf -
amiga-computer made of snow.jpg
amiga computer survivor.jpg
The initial cd command was only needed because I used a wild card instead of a directory target (It's expanded before cd'ing to Documents). (I didn't want to demonstrate by copying an entire directory.)
You may want to check if all network traffic is that slow on the new server. Do you maybe have two nic devices configured for bonding?
Since you are connecting via a cross-over cable, you could use rsh instead of ssh. Be sure to uninstall it after transferring the files.
Could it be the disk I/O on your old server? Been a while, so my memory is a little fuzzy, but I did find a bookmark to an old O'Reilly article about hdparm. IIRC my disk reads were in the 4-5 MB/sec range before tweaking the drive settings as this article recommends.
This is what the drive gets now:
Code:
root: hdparm -t /dev/hdb
/dev/hdb:
Timing buffered disk reads: 130 MB in 3.02 seconds = 43.02 MB/sec
I have checked hdparm on the drives I am using and they all show acceptable, though not stellar, numbers. For example:
Code:
docserver1:/mnt/removeable # hdparm -tT /dev/hdd
/dev/hdd:
Timing cached reads: 1440 MB in 2.00 seconds = 718.31 MB/sec
Timing buffered disk reads: 172 MB in 3.03 seconds = 56.85 MB/sec
Even at half of that speed I should be able to move 100GB an hour.
Hello jschiwal,
I am basically trying to just move a data directory. Mostly compressed black and white tiff images. I'm not moving any system or settings files, just the scanned images.
I have been working on this some more today. I created an NFS connection between the existing server and the soon to be server and I have been trying to run star in copy mode to copy the files to the new server.
It started out copying data across the crossconnect wire at about 6GB an hour and then it just ground to a halt. I went in and watched top for a while and then ran vmstat.
It seems that whenever star is run it creates two processes. One of the processes seems to stay in an "uninterruptible sleep" and this is the one that shows up most often in top. The other process seems to be the one that actually does the copying since whenever it appears more data is copied to the new server.
I am a little confused since the uninterruptible sleep is supposed to happend when a process is waiting on i/o from what I have read, but the vmstat output is showing that the cpu is spending the majority of its time in the idle state rather than the i/o wait state.
I used star -copy /LocalDirectory . /mnt/nfs_directory
The remote machine is using the XFS file system. It isn't out of inodes.
On a positive note, I started the tar over ssh last night and I am getting 8GB to 12GB an hour over the crossover cable. At least that should finish copying everything some time Sunday afternoon and hopefully I can do an rsync then that will only take a couple of hours and I can finish up the project.
I hadn't heard of "star" before your post so I had to try it out. I'm experiencing the same issues as you just copying from one disk to another on the same machine. I have played around with the different switches and noticed only slight increases in throughput. For example:
Code:
star -fifostats fs=256x1m bs=64x8k -c . | star -xp -C /mnt/hda7/kde-devel
This directory is almost 2.4 GB in size and took 14 minutes to copy.
Anyway, if you find a solution I, for one, would appreciate a post back.
If I come up with anything I will let you know. I found out about 'star' when I googled copying large numbers of files and linux. There were a few posts on different mailing list that said it was the fastest way to copy files. That is definitely not what I have experienced.
I have had good results with tunneling tar through an ssh connection to another machine. At this point I am just letting this job run until it finishes. I think it should be finished Saturday afternoon. I am thinking about using tar to try to do a local copy and see what kind of results I get writing to a USB drive as well as an EIDE drive.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.