About nixCraft

Topics

Splits directory into multiple with equal size for ISO burning purpose

Posted by Vivek Gite [Last updated: March 5, 2006]

Sometime it is necessary to convert a directory with many multiple files (which are all smaller than a certain medium, eg. DVD) and "splits" it into "volumes,” looking for the optimal order to get the best space/medium-number efficiency.

For example, I have /data/network/mp3 directory size as follows:

$ du -ch

...
....
1.2 GB size

Now I would like to burn all these files on 700MB CD. Since size is 1.2 GB, I need to split it into two ISO files. Therefore, I need to take help of dirsplit command as follows.

1) Create list of files

$ cd /data/network/mp3
$ dirsplit -s 700M -e2 /data/network/mp3
$ ls vol*

Output:

vol_1.list
vol_2.list

Above dirsplit command created two mkisofs catalogs to burn all music (mp3) to 700M CDRs, keep single files in each dir together.

Where,

As you see, it created two files vol_1.list vol_2.list. Now use these files to create two ISO images that can opened on both windows and Linux computer:

$ mkisofs -o vol1.iso -D -r --joliet-long -graft-points -path-list vol_1.list
$ mkisofs -o vol2.iso -D -r --joliet-long -graft-points -path-list vol_2.list
$ ls -l *.iso

Output:

-rw-r--r-- 1 vivek vivek 663M 2006-03-05 05:18 vol1.iso
-rw-r--r-- 1 vivek vivek 510M 2006-03-05 05:19 vol2.iso

Now ISO images are ready and you can burn them using cdrecord or other GUI tools.
Write an ISO (happ.iso) to CD i.e. burn an image:

$ cdrecord -v -dev=ATA:1,0,0 speed=8 vo1.iso
$ cdrecord -v -dev=ATA:1,0,0 speed=8 vo2.iso

dirsplit can ignore some junk files i.e. it can filter file list. For example, don't include other directory while creating split:

$ dirsplit -s 700M -e2 -f '!other' -e2 /data/network/mp3

(Check out all of our posts on Linux)

Tell us how we're doing: Please answer a few questions about your experience to help us improve nixCraft.

You may also be interested in other helpful articles:

Discussion on This Article:

  1. smoke Says:

    is there such tool for win32? (must be cli driven)

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.