Home » Linux » Applications » Split Huge Files Using Ubuntu Linux

Split huge files in Ubuntu or any other Linux distro

Recently I’ve bought WD TV media player for streaming full HD movies (primarily in 1080p resolution) to my home TV from external storage like usb HDD or ipod classic. You might already know that size of average HD movie rip is more than 4GB (e.g. full HD Avatar movie image is literally 21 GB mkv file) so it’s just impossible to store such huge files on any FAT32 formatted HDD or ipod. My ipod classic 160 GB is windows formatted so it uses FAT32 filesystem where maximum file size is 4 GB. As far as ipod cannot be formatted into ext3 but still be able to play music (just sweet dreams) I have to split huge files to 3.99GB parts and store them to my ipod for later reassemble. When it’s time to watch the some HD movie stored at ipod it’s required to assemble those 3.99 GB parts into one solid file, transfer it to media player and then actually watch the movie.

Rather long preface but solution is quite simple. If u run Ubuntu you can try lxsplit utility for breaking files into parts (binary packages for other Linux distributions as well as source code are available at lxsplit project’s homepage.):

sudo apt-get install lxsplit

In order to split some file in 3.99GB parts use the following command:

lxsplit -s /path/to/hugemoviefile.mkv 3999M

Depending on size of hugemoviefile.mkv you will get several parts hugemoviefile.mkv.001, hugemoviefile.mkv.002 and so on stored in current directory. It means that if you’re going to store those parts on some external storage like ipod you can do the following:

cd /media/ipod/
lxsplit -s /path/to/hugemoviefile.mkv 3999M

and hugemoviefile.mkv.001.. will saved in /media/ipod/ directory regardless where hugemoviefile.mkv is located.

Now coming to assembling procedure. It’s just as easy as splitting:

lxsplit -j hugemoviefile.mkv.001

Once done you will get hugemoviefile.mkv saved in current directory.

Have an interesting article? You’re welcome to contact me and get it published at LinuxScrew.com!

SHARE:
Photo of author
Author
My name is Stefan, I'm the admin of LinuxScrew. I am a full-time Linux/Unix sysadmin, a hobby Python programmer, and a part-time blogger. I post useful guides, tips, and tutorials on common Linux and Programming issues. Feel free to reach out in the comment section.

Leave a Comment