Burning CD's over the Internet without an ISO File

by Lubos Rendek

Originally appearing at linuxconfig.org
Reprinted with permission.

How many GUI CD/DVD burning applications do you know? Now, how many of them you can name that can burn an ISO image directly from ftp server or burn your remote directory over ssh? If you want to use a GUI burning software in such manner, you would need to mount your remote ftp or ssh directory as a part of a local system. However, this is possible without any extra effort by use of command line interface.

This article will illustrate some command line tricks on how to work with ISO images, and how burning a data from a command line can safe you time. It really highlights a power of Linux command line interface.

Let's start with creating an ISO image.

The following command will create an ISO image from your CD. Insert your CD into CD/DVD drive and execute.

# dd if=/dev/cdrom of=/my/new/iso/image.iso

If you just need to create an ISO image from your local directory, the easiest way to do this is by a following command.

mkisofs -o /my/new/iso/image.iso /path/to/your/files/

To see the content of your new ISO image, you can mount it to any directory within your local filesystem.

# mount -t iso9660 /my/new/iso/image.iso /mnt/iso/ -o loop

Next we can try burn an ISO image with cdrecord. First, retrieve and base name of your burning device with wodim.

# wodim --devices

To burn an ISO image, use a block device's base name retrieved earlier, in combination with a location of your iso image.

# wodim -eject -tao speed=0 dev=/dev/scd0 -v -data /my/new/iso/image.iso

That was easy! Did you know that you can burn your files without prior creation of an ISO image? Here is how to make a copy of your CD.

Note: This requires the separate devices, one for reading and one for burning.

# dd if=/dev/scd0 | cdrecord -v speed=12 dev=/dev/scd1 fs=8 -data -

It is also possible to burn any local data without creating an ISO image first.

# mkisofs -r /path/to/my/files | cdrecord -v speed=12 dev=/dev/scd1 fs=8 -data -

By now, it is clear that we only need to pipe any ISO data to a cdrecord, and therefore we can also burn ISO image directly from FTP source.

Note: High speed internet access is recommended.

# curl http://remote-ftp.rem/linux-distro-image.iso | cdrecord -v speed=12 dev=/dev/scd1 fs=8 -data -

It is also possible to burn your local data on a remote machine over the encrypted ssh tunnel.

# mkisofs -r /path/to/my/files | \
ssh user@remote.machine "cdrecord -v speed=12 dev=/dev/scd1 fs=8 -data -"