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.

Comments (8)

Loading... Logging you in...
  • Logged in as
nice ubuntu blog, I add you to my blogroll .
Why not using the 7zip to compress the files?

It says it gets better results than RAR...

Take a look: http://www.7-zip.org
you left out an explanation about the R flag in your description. This is troubling because in my experience, rar acts recursively using that flag but it just kind of piles all the files into the same spot, instead of retaining directories. Any advice on that?
Nice post!! just what I was looking for! Add the info onf my blog, taling about this blog!! www.randallstory.blogspot.com
Thanks, I was needing this!
I was looking for splitting when adding files to archive and i found this site.Thanks for splitting part.BTW man rar or readme of rar SUCKS.
thanks a lot
Thanks mate, much appreciated. I'd been using lxsplit, but it just didn't quite cut it. Thanks for the information.

Post a new comment

Comments by

Clicky Web Analytics