For information on how to install cdrtools, take a look at the 2nd post in this thread
You can make an ISO file out of a folder as follows:
You can burn an ISO file to disc as follows:
mkisofs -fRrlJ -A Disc_Volume_Label_Goes_Here -o name_of_iso_file.iso name_of_folder
But if you don't want to waste time and disk space creating an ISO file, you pipe the output of mkisofs into the input of cdrecord (yes it's as cool as it sounds). As follows:
cdrecord dev=/dev/hda name_of_iso_file.iso
(Note that I've replaced the input and output file names with hyphens)
mkisofs -fRrlJ -A Disc_Volume_Label -o - name_of_folder | sudo cdrecord dev=/dev/hda -
On some systems, including my own, this final command fails because cdrecord wants to be told the track size (maybe some drives won't start burning unless they know the track size?). If anyone has any info on this, get back to me in this thread and we can troubleshoot it. Maybe we could do something like:
Also if I've made any errors post back quickly and I'll fix it.
mkisofs -fRrlJ -A Disc_Volume_Label -o - name_of_folder | sudo cdrecord -tsize=`some_command_that_will_get_the track_size_for_us` dev=/dev/hda -
I got all my info from this site:
Command-line CD-ROM burning in Linux
In trying to figure out why cdrecord was failing on my computer, I stumbled across something. It turns out there's a massive controversy in Linux regarding the cdrtools package (this package contains such programs as mkisofs, cdrecord).
Basically there are two different parties developing a package by the same name, they're both calling it "cdrtools", and they do not get on well with each other. They started out as one group, but then they split. You can read about it here:
Cdrtools - why do Linux distributions create bad forks?
One of the cdrtools packages is way better than the other. One of them is stable, while the other is buggy. Unfortunately it is the buggy one that made it into Ubuntu's repositories.
The buggy version creates symbolic links in "/usr/bin" for files such as mkisofs and cdrecord. If you do the following:
then you'll be able to see what the symbolic link points to. If it points to "wodim", then you've got the buggy version.
ls -l /usr/bin/cdrecord
So without further a do, here's how you get the stable version of cdrtools. You're best off copy-pasting the following into a script called "get_stable_cdrtools.sh", then giving it execution permissions and running it as root as follows:
Here's the code for the script. (This script was written by a guy called IgnorantGuru over on the Ubuntu forums).
chmod +x get_stable_cdrtools.sh
After you do this, you have a fully-functional, non-buggy installation of cdrtools.
# install compiler tools
sudo apt-get install build-essential
# Make sure you're in the home folder
# Make a working folder and change to it
# Download latest cdrtools from http://cdrecord.berlios.de/private/linux-dist.html
tar xzf cdrtools-beta.tar.gz
# CD to the directory cdrtools is in.
# Compile and install
sudo make install
sudo make clean
# Files are installed to /opt/schily
# (you may want to change their ownership to root:root)
sudo chown root:root /opt/schily/bin/*
# Move the following files (some will be links) from /usr/bin to a junk folder...
sudo mkdir /opt/schily/replacedfiles
sudo mv /usr/bin/cdrecord /opt/schily/replacedfiles
sudo mv /usr/bin/genisoimage /opt/schily/replacedfiles
sudo mv /usr/bin/mkisofs /opt/schily/replacedfiles
sudo mv /usr/bin/readom /opt/schily/replacedfiles
sudo mv /usr/bin/wodim /opt/schily/replacedfiles
# Create links:
sudo ln -s /opt/schily/bin/cdrecord /usr/bin/cdrecord
sudo ln -s /opt/schily/bin/mkisofs /usr/bin/genisoimage
sudo ln -s /opt/schily/bin/mkisofs /usr/bin/mkisofs
sudo ln -s /opt/schily/bin/readcd /usr/bin/readom
sudo ln -s /opt/schily/bin/cdrecord /usr/bin/wodim
sudo ln -s /opt/schily/bin/readcd /usr/bin/readcd
sudo ln -s /opt/schily/bin/mkhybrid /usr/bin/mkhybrid
sudo ln -s /opt/schily/bin/cdda2wav /usr/bin/cdda2wav
# Remove working folder
sudo rm -r cdrtools
I still haven't figured out the problem of specifying the track size, and I sent the developers of cdrtools an e-mail about it, but I've a feeling they won't respond because they said they had to cut off "personal support" because they were just getting too many e-mails.
If anyone knows a solution to the "track size" problem, post it here please. I wonder if there's some way of getting mkisofs to say how big the ISO file will be. Maybe something like
If so we could use this as follows:
I've looked through the manual for mkisofs already though and haven't found anything yet.
mkisofs -fRrlJ -A Disc_Volume_Label -o - name_of_folder | sudo cdrecord -tsize=`mkisofs --just-tell-the-size -fRrlJ -A Disc_Volume_Label name_of_folder` dev=/dev/hda -
After 2 days of investigating I finally got to the bottom of it
mkisofs has a command line option "-print-size" that will tell you the size of the ISO it would have created.
So here's how you quickly burn a folder to disc:
You could make a script out of it as follows:
mkisofs -fRrlJ -A Disc_Volume_Label Name_Of_Folder | sudo cdrecord tsize=`mkisofs -quiet -print-size -fRrlJ -A Disc_Volume_Lable Name_Of_Folder` dev=/dev/hda -
And then run the script as:
mkisofs -fRrlJ -A $1 $1 | sudo cdrecord tsize=`mkisofs -quiet -print-size -fRrlJ -A $1 $1` dev=/dev/hda -
Now if you're lucky, this command won't just freeze your command line indefinitely and sit there doing nothing... like it does on my computer... f*** sake. It turns out that since I switched from the buggy cdrtools to the stable cdrtools, it won't burn anything to disc for me anymore even if I try to burn a simple ISO file to disc. Even if I do "cdrecord -scanbus", it just freezes and does nothing Another thing to troubleshoot.