Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a giant file (>20 gigs) sitting on my source machine and I need to transfer it to my target machine. For the purposes of this question, let's assume that I do not have network connectivity between the two machines.

I need to break this file into a series of smaller files, write the smaller files to DVD(s), then re-assemble everything on the target machine.

Both source and destination machines are Linux boxes. Is there a way to accomplish this using tar? I have a feeling that I need to use the --multi-volume parameter. What are my options?

I need to be able to specify the size of the volume files, in order to make sure that each one will fit onto a single DVD.

Thanks!

share|improve this question

4 Answers 4

up vote 14 down vote accepted

Use the split command.

split -b 22 m newfile.txt new would split the file "newfile.txt" into three separate files called newaa, newab and newac each file the size of 22 MB.

share|improve this answer
3  
Be careful of creating the prefix "new" that you share with the original file "newfile.txt". Now when you try to do cat new* > newfile.txt it will blow up! –  Robert Martin Oct 17 '11 at 23:54
    
@RobertMartin Good catch! –  duffbeer703 Oct 25 '11 at 0:30

Other answers have covered split to combine them to one master file you just use cat.

share|improve this answer

This can be done easily using split, which should be already available in the base of your distribution since it is part of gnu coreutils.

share|improve this answer

split -b 4000000000 file_name

It will create each file of 4 GB

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.