################################## Write DVDs with Common Linux Tools ################################## :Author: Dimitry Dukhovny .. contents:: Especially in government, CDs and DVDs are still in circulation. Check the state of all inserted CDs and DVDs ============================================ .. code-block:: bash :linenos: # Install the cdrskin if it is missing for drive in /dev/sr* do cdrskin dev=${drive} -minfo 2> /dev/null done Pay special attention to the "disk status" line. It will tell whether the disk is finalized or closed against further writing. This is the same as "fixed," "fixated," and "finished" in various documentation. What the "disk satus" means: +------------------------+------------------------------------+ | Status | Meaning | +========================+====================================+ | empty | Blank disk inserted | +------------------------+------------------------------------+ | incomplete/appendable | Disk with content, but not closed | +------------------------+------------------------------------+ | complete | Disk closed, possibly with content | +------------------------+------------------------------------+ Create an ISO ============= In this example we will write the contents of **/home/user/myimage/** to **/home/user/myimage.iso** and label the image "MYIMAGE." .. code-block:: bash :linenos: # On Debian systems, use genisoimage ... genisoimage -JrV MYIMAGE -o /home/user/myimage.iso /home/user/myimage/ # ... or xorrisofs xorrisofs -JrV MYIMAGE -o /home/user/myimage.iso /home/user/myimage/ # On Redhat-like systems, use mkisofs mkisofs -JrV MYIMAGE -o /home/user/myimage.iso /home/user/myimage/ Mount an ISO ============ We will mount our new image, **/home/user/myimage.iso** to a directory we will create for this purpose. .. code-block:: bash :linenos: mkdir /home/user/imagemount sudo mount -o loop /home/user/myimage.iso /home/user/imagemount If this fails, the loop module may be absent. This is improbable, but imaginable. To fix that... .. code-block:: bash :linenos: sudo modprobe loop Burn an ISO to CD or DVD ======================== This is the easy part. This version of the command writes **/home/user/myimage.iso** to **/dev/sr0**. Without the "dev=" option, wodim still tries to guess the best drive for the job. It finalizes the disk by default. .. code-block:: bash :linenos: wodim -v -eject dev=/dev/sr0 /home/user/myimage.iso. .. Make an ISO Boot from USB Drive =============================== This command write **myimage.iso** to a USB disk inserted as **/dev/sdb**. .. code-block:: bash :linenos: dd if=myimage.iso of=/dev/sdb bs=1024k status=progress ..