Linux creating CD-ROM ISO images from a CD, DVD, Blu-ray

dd is a perfect tool for copy a file, converting and formatting according to the operands. dd command works on Linux and a Unix-like system whose primary job is to convert and copy files. It can create exact CD-ROM ISO image or create a new CD/DVD iso image. This is useful for making a backup, as well as for hard drive installations, require a working the use of ISO images.

Creating an ISO image from a CD, DVD, or BD on a linux

ADVERTISEMENTS

How do I use dd command on Linux to create an ISO image?

Put CD or DVD into CDROM/DVDROM drive.

Do not mount CD/DVD. Verify if the cd is mounted or not with the mount command:
$ mount

If CD/DVD was mounted automatically unmount it with the help of umount command:
$ sudo umount /dev/cdrom
OR
$ sudo umount /mnt/cdrom/

Warning: Reading and writing partitions or data from it has the VERY REAL potential to cause DATA LOSS. Use common sense. BACKUP ANYTHING YOU DO NOT WANT TO LOSE! Wrong command line option can result in DATA LOSS.

Create CD-ROM/DVD ISO image with dd command:
$ sudo dd if=/dev/cdrom of=/tmp/cdimg1.iso
Where,

  • if=/dev/cdrom: Read data from /dev/cdrom in raw format
  • of=/tmp/cdimg1.iso>: Write to FILE named /tmp/cdimg1.iso i.e. create an ISO image

How to create an ISO disk image from a CD-ROM, DVD or Blu-ray disk

First get blocksize. I am using /dev/dvdrom or /dev/sr0. Use the grave accent (`cmd`) or ($(cmd)) to perform a command substitution:
blocks=$(isosize -d 2048 /dev/sr0)
Now run dd command and display progress bar while using dd command:
$ sudo dd if=/dev/sr0 of=/tmp/output.iso bs=2048 count=$blocks status=progress
Now you can use cdimg1.iso or output.iso for hard disk installation or as a backup copy of CD/DVD media. Please note that dd command is standard UNIX command and you should able to create backup/iso image under any UNIX like operating system. You can restore hard disk drive from a previously generated ISO image using the dd command itself:
$ sudo dd if=/path/to/my/iso.img of=/dev/sdd bs=4096 conv=noerror

See also:

🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
17 comments… add one
  • Aatch Jan 6, 2008 @ 11:09

    This has cemented my love of *nix. I already knew that you could mount disk images using mount, but the using of dd to make a disk image. That was the best bit. I have the need to make alot of images, for various reasons. And its faster than on windows. (In my experience anyway).

  • iceblox Oct 23, 2008 @ 13:52

    You better add some blocksize parameter using bs=$something or it will take quite a while…

  • Benjamin M. Strozykowski Feb 19, 2009 @ 11:52

    This just made my day, thank you. For some reason, Brasero wouldn’t copy the cd, but dd did it without error.

    Thank you very much!

  • José Roberto Aug 23, 2009 @ 7:57

    I didn’t know i could do this directly 😛

    I used to do:
    dd if=/dev/cdrom1 of=./image.img
    img2iso image.img image.iso

    Thank you! 😀

  • Adso Sep 2, 2009 @ 23:33

    It works, thanks!

  • leroy Feb 15, 2010 @ 3:44

    I have a Dual booted pc (Linux/XP) I would like to take the Windows XP partition and create an ISO for a VM. Is it possible? I expect when XP wakes up in a VM environment there might be a few problems with hardware recognition but that can be addressed later.

  • Rafael Dec 21, 2010 @ 17:09

    It works fine. Thanks.

  • Vikram Dec 24, 2010 @ 8:56

    Why is it necessary to unmount the CD-ROM first?

    • Aaron Jan 22, 2011 @ 22:31

      Using this method is reading the bits straight from the device. If it is mounted, then the device will be “in use” as it is already mounted to another folder. You could still use dd to make an image of the mounted location (i.e., /media/mounteddisk) but then it would be like burning a folder to disk instead of getting the exact formatting of a CD.

  • Maikel B Feb 19, 2011 @ 13:19

    You just made my day 🙂

    Thnx

  • Donny Apr 4, 2011 @ 17:55

    Thank You
    its great to work in the terminal
    i love Linux

  • DeepThnker May 14, 2011 @ 16:38

    Thanks!
    Iam using fedora 14 and all the gui programs are buggy, crashing and sometimes they have problems with certain CDs,but
    dd… and the other command line tools.. they never leaves me in the lurch!

    • satish Jul 22, 2011 @ 1:44

      Thanks

  • OM PRAKASH SINGH Dec 5, 2011 @ 15:04

    Hello friends
    I need your help in installing redhat linux5 on my laptop compaq presario cq40 having windows vista operating system. when I am installing linux then it is not recognizing my partition and dvdram drive asking for the location of linux image. I have formated one partition with ext3 but it is not seen by windows. how ever when loading linux it detects my hard disk but not finding image. I don’t know how to load the image of linux in cd from windows vista operating system. if you can help me in this regard then I will remain thankful to you.
    thanks
    OP Singh

    • Joe Feb 28, 2012 @ 21:00

      just don’t do it.

  • Luiz Augusto Feb 18, 2012 @ 16:31

    Very good!
    Thanks

  • Navazkhan Sep 25, 2014 @ 15:54

    Where,

    if=/dev/cdrom: Read from /dev/cdrom (raw format)
    of=/tmp/cdimg1.iso: write to FILE cdimg1.iso i.e. create an ISO image

    FOR CORRECTION:

    if=/dev/cdrom (will not be constant) cdrom name will change, check for the correct name.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.