Splitting up folders for burning to DVD with dirsplit

I have a complicated directory hierarchy on a Linux server with several gigabytes of files that I would like to backup to DVDs and be able to easily copy to another computer. The directories and subdirectories don’t easily divide into chunks of convenient size. I thought about using the tar command with the -M or --multi-volume option, or piping it into split. Several forums and websites suggest this. This isn’t an ideal solution because then you need to create a disc image containing a file larger than 4GB which isn’t supported by ISO9660 (typical CD format). So you would need to create a UDF image using mkudffs which can support larger files, but even then, the large multi-part tar archive may not be easily read by the receiving machine.

A better solution was suggested by Hubert Kario on Stack Exchange. He recommends using the dirsplit command which comes with some of the CD and DVD tools. The man page for dirsplit was written in 2004 so it’s hardly a new piece of software, and yet few people online seem to mention it, or perhaps I was just searching for the wrong keywords.

I ran the following commands as suggested by the dirsplit help text.

dirsplit -e2 my/data/folder
genisoimage -D -r --joliet-long -graft-points -path-list vol_1.list -V MY_DISK_1 -o my_data_1.iso
genisoimage -D -r --joliet-long -graft-points -path-list vol_2.list -V MY_DISK_2 -o my_data_2.iso

The -e option determines how folders are split up, whether a single folder should be stored on a single disc or whether files from the same folder can be on different discs. By default, dirsplit outputs catalog files which can be used by genisofs to create ISO images. These catalog files are essentially a list of files to be included in each disc image. The default size for each disc image is suitable for a DVD, just over 4GB.

I’m not sure exactly what the genisoimage options do and I haven’t yet burnt and tested the DVDs, but it looks promising and was very straightforward.

This entry was posted on Monday, February 27th, 2012 at 07:58:05 Europe/London and is filed under Linux. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a reply