Linux how to move a large file

linuxtar

I had an ISO file that was over 4GB. When I tried to copy or move the file from my computer to a USB key, I remember getting some error about the file being too large for the operating system to move.

So then I ran this command to have tar break it up into a disk1.tar and a disk2.tar:

tar -c -M --tape-length=2002400 --file=disk1.tar bigfile.iso

Once done, I copied the file onto USB. Now when I try to put the file back together, I ran the command:

tar -x -M --file=disk1.tar

But I get the error

tar: Archive value 4209604608 is out of off_t range 0..2147483647
tar: Exiting with failure status due to previous errors

So my question is how do I move a large file from my computer to a USB key? I even tried SFTP the file from one server to another, and it also complained about file being too large.

Best Answer

If you have a network connection then just do a ssh pipe.

ssh user@host "cat > file.remote" < file.local

If you need to split the file for media then use split to break it up and cat to fuse it back together.

split -b 1G file.local filexfer
cat filexfer* > file.remote

Note that all this assumes that the remote filesystem is actually capable of storing files that large.