简体   繁体   中英

Splitting large tar file into multiple tar files

I have a tar file which is 3.1 TB(TeraByte)

File name - Testfile.tar

I would like to split this tar file into 2 parts - Testfil1.tar and Testfile2.tar

I tried the following so far split -b 1T Testfile.tar "Testfile.tar"

What i get is Testfile.taraa(what is "aa")

And i just stopped my command. I also noticed that the output Testfile.taraa doesn't seem to be a tar file when I do ls in the directory. It seems like it is a text file. May be once the full split is completed it will look like a tar file?

The behavior from split is correct, from man page online: http://man7.org/linux/man-pages/man1/split.1.html

Output pieces of FILE to PREFIXaa, PREFIXab, ...

Don't stop the command let it run and then you can use cat to concatenate (join) them all back again.

Examples can be seen here: https://unix.stackexchange.com/questions/24630/whats-the-best-way-to-join-files-again-after-splitting-them

split -b 100m myImage.iso
# later
cat x* > myImage.iso

UPDATE Just as clarification since I believe you have not understood the approach. You split a big file like this to transport it for example, files are not usable this way. To use it again you need to concatenate (join) pieces back. If you want usable parts, then you need to decompress the file, split it in parts and compress them. With split you basically split the binary file. I don't think you can use those parts.

You are doing the compression first and the partition later.

If you want each part to be a tar file, you should use 'split' first with de original file, and then 'tar' with each part.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM