Howto: Create Split .Rar Files in Ubuntu Linux for archiving, filesharing, and backup purposes.

If you need to compress a large part of your hard drive to backup on a filesharing site or backup something larger than a cd/dvd you can use rar to split the file/files into multiple parts, you often see rar files on warez, torrents, and ftp's, here are the directions on creating these files and extracting them.

Lets grab the rar program:
sudo apt-get install rar
Ok lets compress our directory of files:

To compress file(s) to split rar archive know which directory you want to compress, I used /home as an example

rar a -m5 -v5M -R myarchive /home/

Let me break the above command down

rar - starts the program
a - tells program to add files to the archive
-m5 - determine the compression level (0-store (fast)...3-default...5-maximum(slow))
-v5M - determine the size of each file in split archive, in this example you get files with size 5MB (if you wanted files of 512kB size you would write -v512k)
myarchive - name of the archive you are creating
/home/ - is folder of the files you wish to add to the archive

You can read the manual for more options:
man rar
Press q to exit and arrows to scroll up/down
You can also add -p to the command after a and it will prompt you for a password.

To uncompress the archive type:

rar x myarchive.part01.rar

Or right click on file myarchive.part01.rar and choose Extract Here.

Clicky Web Analytics