This howto describe to split big files / directories into multiple archives under Linux using RAR software which can be used to backup, copy onto CDs or download into small chunks where large files downloading is limit to size etc. These files then can be downloaded to any machine to re-assemble again and extract data from it. RAR software developed by RARLAB (http://www.rarlab.com) and have Linux, Windows and MacOS versions.
I am doing this because i need to download CentOS 5.2 DVD ISO of size 3.7GB on my office PC but my office firewall limit me not to download over 1GB file. So I decided to split CentOS 5.2 DVD ISO in small multiple archives each under 1GB and then download and re-assemble on my PC. For this I am using one of my online server running Fedora 7. I will first download full CentOS 5.2 DVD ISO on my online server and then split into small multiple archives to download to my PC.
1) Download RAR Software.
cd /usr/src
wget http://www.rarlab.com/rar/rarlinux-3.8.0.tar.gz
2) Extract and Install RAR Software
tar zxvf rarlinux-3.8.0.tar.gz
cd rar/
make
3) Download CentOS 5.2 DVD ISO
mkdir /usr/src/centos
cd /usr/src/centos
wget http://mirror.its.uidaho.edu/pub/centos/5.2/isos/i386/CentOS-5.2-i386-bin-DVD.iso
You can use any mirror from CentOS site (http://www.centos.org) which is near to your location.
4) Creating Multiple Archive using RAR Software
rar a -m5 -v900M centos-5.2-dvdiso CentOS-5.2-i386-bin-DVD.iso
where
a = Add files to archive.
-m5 = use best compression method (slightly more compressive, but slowest)
-v900M = Create volumes with size – 900M means 900 MegaByte, values can be [k|b|f|m|M|g|G]
more option can be explore by reading /usr/src/rar/rar.txt file
After running above command i get 5 archive files of CentOS 5.2 DVD ISO
root@server1 [/usr/src/centos]# ls -lh
total 7.3G
drwxr-xr-x 2 root root 4.0K Nov 24 07:41 ./
drwxr-xr-x 16 root root 4.0K Nov 24 06:57 ../
-rw-r–r– 1 root root 3.8G Jun 19 19:24 CentOS-5.2-i386-bin-DVD.iso
-rw-r–r– 1 root root 859M Nov 24 07:09 centos-5.2-dvdiso-part.part1.rar
-rw-r–r– 1 root root 859M Nov 24 07:20 centos-5.2-dvdiso-part.part2.rar
-rw-r–r– 1 root root 859M Nov 24 07:31 centos-5.2-dvdiso-part.part3.rar
-rw-r–r– 1 root root 859M Nov 24 07:41 centos-5.2-dvdiso-part.part4.rar
-rw-r–r– 1 root root 134M Nov 24 07:43 centos-5.2-dvdiso-part.part5.rar
So i got 4 files of size 859M and 1 file of size 134M, which are less than 1GB and can be downloaded on my office PC.
Webserver will be better to download files while downloading using internet and samba/nfs can be better for lan connections. For me I am using online server to split the files, so i will download using firefox.
5) Extract files on your PC using WinRAR
Here you go, now you have full CentOS 3.7 GB DVD ISO extracted. You can verify it by checking file size.
Now burn image on DVD and enjoy your work.
… or use split -b 900m -d filename