Skip to content


Making and burning ISO images

There are times when we are faced with either making or burning iso images created by us or downloaded from internet. Most data CDs and DVDs can be accessed on multiple plateforms because they are created using the ISO9660 standard. Using the mkisofs command, we can make iso images from any file and directory structure from any point in Linux file system. To burn ISO images, cdrecord is the tool of choice and there is also growisofs that allows us to create and burn iso images in one step.

Creating iso images

To make iso image of the home/ directory, simply run the following command

mkisofs -o home.iso /home 


The following command will add Joliet and Rock Ridge extensions allowing to store longer file names in a form that makes it usable to Windows systems and support for storing Unix-specific file information. With Joliet and Rock Ridge extensions file names and permissions would appear as they did on the original Linux system when you open the ISO on a Linux or Windows system.

mkisofs -o home2.iso -J -R /home 


You can combine files and directories from different locations and make an iso image of them

mkisofs -o backup.iso -R -J music/  docs/  john.pdf 


mkisofs can add information into the header of the ISO image which can help you identify the contents of that image later. In the following example

mkisofs -o /tmp/home.iso -R -J -p "localhost" -publisher "Created by Linuxgravity Inc" -V "AccountBackup" -A "mkisofs" -volset "1 of 4 of backups, Sep 18, 2009" /home/john/music
I: -input-charset not specified, using utf-8 (detected in locale settings)
Total translation table size: 0
Total rockridge attributes bytes: 260
Total directory bytes: 0
Path table size(bytes): 10
Max brk space used 0
2619 extents written (5 MB)


-p indicates the preparer ID, which could include a phone number, mailing address, or web site for contacting the preparer of the ISO image.
-publisher indicates a 128-character description of the preparer (possibly the company or organization name).
-V indicates the volumeID. Volume ID is important because in many Linux systems this volume ID is used to mount the CD when it is inserted. For example, in the command line systems.
-A option is for the application used to create the ISO image.
-volset option can contain a string of information about a set of ISO images.

Displaying information about ISO images

To display volume name of the iso, run

volname /tmp/home.iso
AccountBackup


To see all header information, we use isoinfo command

isoinfo -d -i /tmp/home.iso
CD-ROM is in ISO 9660 format
System id: LINUX
Volume id: AccountBackup
Volume set id: 1 of 4 of backups, Sep 18, 2009
Publisher id: Created by Linuxgravity Inc
Data preparer id: localhost
Application id: mkisofs
Copyright File id:
Abstract File id:
Bibliographic File id:
Volume set size is: 1
Volume set sequence number is: 1
Logical block size is: 2048
Volume size is: 2619
Joliet with UCS level 3 found
Rock Ridge signatures version 1 found


Mounting ISO image

To access iso images, we first need to mount it on a directory, so create a directory

mkdir /mnt/isoimage

and then mount it


mount -o loop home.iso /mnt/isoimage

To unmount

umount /mnt/isoimage


Burning ISO images with cdrecord

One of the most popular Linux command line tool used for burning CD and DVD images is cdrecord. After you have created an ISO image or downloaded one from the internet, cdrecord makes it easy to store the image on a disc.

Before burning the image to CD or DVD, verify that your drive supports CD/DVD burning and determine the address of the drive. Use the –scanbus option to cdrecord to do that

cdrecord --scanbus
scsibus0:
0,0,0 0) ‘LITE-ON ‘ ‘DVDRW SOHW-1633S’ ‘BS0C’ Removable CD-ROM
0,0,0 1) *
0,0,0 2) *
...


As you can see, it is DVDRW so it can make both CDs and DVDs.

Now to burn the ISO, run the following command (it will use the default settings)

cdrecord -v home.iso


You can specify a specific speed as well

cdrecord -v speed=24 home.iso


To have cd record eject the CD/DVD after burning, use -eject option

cdrecord -eject home.iso


If you have multiple recorders, you can have cdrecord use a specific one either by device name or SCSI name (displayed by scanbus command above)

cdrecord /dev/cdrw home.iso
cdrecord dev=0,2,0 home.iso


The cdrecord command can also burn multi-session CDs/DVDs.The following command will start a multi-burn session

cdrecord -multi home.iso 


To check the session offset for next burn

cdrecord -msinfo
Using /dev/cdrom of unknown capabilities
0,93041


To append another iso to the multi-session CD/DVD, first create the second iso

mkisofs -J -R -o new.iso
-C 0,93041 /home/john/more 


Burn new data to the existing CD/DVD

cdrecord new.iso


You can use multiple -multi burns until the CD is filled up. For the final burn, don’t
use -multi, so that the CD will be closed.

Making and Burning CDs and DVDs with growisofs

growisofs command is special in that it combines two steps of creating the image and then burning it into one step. By default, it creates a multi-session CD/DVD, if not told explicitly to close the session, so you don’t need to do anything special for multi-burn sessions.

The following example creates and burn an ISO, add another ISO to the same DVD and later we close the session.

growisofs -Z /dev/dvd -R -J /home/marry
growisofs -Z /dev/dvd -R -J /home/peter
growisofs -M /dev/dvd=/dev/zero


growisofs accepts the same options as mkisofs so they can be used with growisofs as well.

To improve compatibility with different DVD drives over some multi-session DVD burning procedures, use the -dvd-compat option. For example:

growisofs -dvd-compat -Z /dev/dvd=image.iso


 

Share The Knowledge:
  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • blogmarks
  • Diigo
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • Reddit
  • StumbleUpon
  • Twitter
  • Blogosphere News
  • Identi.ca
  • Slashdot
  • Technorati

Posted in Backup, Centos, Debian, Fedora, Red Hat, Ubuntu.


4 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. mani says

    useful information. Thanks for posting.

  2. Rajib Chanda says

    Thanks a Lot….

  3. id says

    Sounds like a lot of pain compared to MS

  4. Rakesh says

    No pain no gain ;-)



Some HTML is OK

or, reply to this post via trackback.