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
--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
-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.