How To Split A Large Files To Multiple Parts Using “tar”.
Written by Jahangir on October 10, 2008 – 7:26 am -Process to split file
Here you have to use two extra command line options to split the file over multiple parts. The standard syntax are -M (–multi-volume) which tells Tar you want to split the file over multiple files. Then you need to tell Tar how big that file is, so that it can create files of the correct size. To do this you use the –tape-length option, where the value you pass is number x 1024 bytes.
The example below shows the syntax to used tar to split large file in to multiple parts. Let’s say the large file name trulymanaged.tgz is of 3 GB and we need to fit this file on to the parts of 700 Meg files.
# tar -c -M -v –tape-length=716800 –file=file1.tar trulymanaged.tgz
v :- Output in verbose mode.
M :- Option to split the file over multiple files.
c :- Option to create the tar file.
The value 716800 is 700 x 1024, which will create a 700 Meg file called file1.tar and then Tar will prompt for volume 2 like below :-
Prepare volume #2 for ‘file1.tar’ and hit return:
We have to fire the following command to continue the writing :-
n file2.tar
This instructs Tar to continue writing the remaining of trulymanaged.tgz to a file named file2.tar. You will then be prompted with the line below, and you can now hit return to continue.
Prepare volume #2 for `file2.tar’ and hit return:
You have to continue this process until your large file has been splited completely, increase the file number in the filename each time you are prompted.
Below screen shot demonstrate this process.

Putting the File Back Together
The process is similar like creating files, putting the large files back together from its split-up files. Following is the syntax used to re-create the large file from the file1.tar and file2.tar and the number of files which is been created at the time of splitting.
# tar -x -M -v –file=file1.tar trulymanaged.tgz
trulymanaged.tgz
Prepare volume #2 for `file1.tar’ and hit return: n file2.tar
Prepare volume #2 for `file2.tar’ and hit return:
Below screen shot demonstrate this process.

Tags: Is there a way to split a larger file into multiple chunks using tar, split big file, Split Big File Using "tar", Split files using tar, split tar file into two (or more) files, Split the file in tar, split the file over multiple parts
Posted in Dedicated Server Hosting, linux, Linux VPS Hosting | 8 Comments »




















March 24th, 2009 at 10:31 am
This looks very cumbersome. Everytime typing the name sof all the volumes. Why not use split:
$ split –verbose –bytes=5m -d check.mpg check
creating file `check00′
creating file `check01′
creating file `check02′
creating file `check03′
creating file `check04′
thats it. When you want to join just concatenate them
$ cat check01 check02 check03 check04 > check.mpg
March 19th, 2010 at 12:11 pm
[...] of the Winelands region of Cape Town. Taste internationally acclaimed wines while feasting your eyeHow To Split A Large Files To Multiple Parts Using tar …Here you have to use two extra command line options to split the file over multiple parts. … Below [...]
December 12th, 2011 at 3:58 am
[...] so I’ve just had a read through this page after a way to improve my current backup solution on my Debian server. Tar seems to be offering a [...]
October 10th, 2012 at 7:10 am
If the file is particularly large:
nohup split –verbose –bytes=1000m -d bigFile.tgz fileprefix &
February 22nd, 2014 at 6:39 am
[...] so I’ve just had a read through this page after a way to improve my current backup solution on my Debian server. Tar seems to be offering a [...]
March 7th, 2015 at 1:55 am
[...] so I’ve just had a read through this page after a way to improve my current backup solution on my Debian server. Tar seems to be offering a [...]
June 12th, 2015 at 6:56 pm
[...] so I’ve just had a read through this page after a way to improve my current backup solution on my Debian server. Tar seems to be offering a [...]
October 21st, 2015 at 6:19 am
[...] so I’ve just had a read through this page after a way to improve my current backup solution on my Debian server. Tar seems to be offering a [...]