Backing up an optical disk on a Linux system preserves installers, media, and archived data in a single ISO file that is easy to store and reuse. An ISO image duplicates the layout and content of a CD, DVD, or Blu-ray so the data stays available even when the original media becomes scratched or the drive is removed. Creating a local copy also simplifies virtual machine usage and network-based installations.
Under Linux, an optical drive usually appears as a block device such as /dev/sr0 that exposes fixed-size sectors from the disk. Reading this device from start to end produces the same byte-for-byte stream the drive would present to the operating system while the disk is inserted. Using a low-level copy tool against the raw device makes it possible to capture the entire filesystem and boot structures into a single image file.
Creating an ISO image of a disk requires sufficient free storage for the full size of the medium and access to sudo for reading the raw device. Incorrect parameters in copy commands can overwrite data or produce incomplete backups if the target path is wrong or the disk contains unreadable sectors. Verifying disk size beforehand and comparing checksums after the copy helps avoid silent corruption and confirms the backup is reliable.
Steps to create image from optical media in Linux:
- Open a terminal on the Linux system with an account that can use sudo.
$ whoami user
- Identify the device name of the optical drive.
$ dmesg | egrep -i 'cdrom|dvd|cd/rw|writer' [ 6.834672] sr 3:0:0:0: [sr0] scsi3-mmc drive: 1x/1x writer dvd-ram cd/rw xa/form2 cdda tray [ 6.835440] cdrom: Uniform CD-ROM driver Revision: 3.20
The optical drive typically appears as sr0 with type rom; exact naming can differ between physical hardware and virtual machines.
- Insert the optical disk (CD, DVD, or Blu-ray) into the drive.
- Check the raw size of the disk through its block device.
$ sudo fdisk -l /dev/sr0 Disk /dev/sr0: 748 MiB, 784334848 bytes, 382976 sectors Disk model: VMware SATA CD01 Units: sectors of 1 * 2048 = 2048 bytes Sector size (logical/physical): 2048 bytes / 2048 bytes I/O size (minimum/optimal): 2048 bytes / 2048 bytes Disklabel type: dos Disk identifier: 0x73a9f942 Device Boot Start End Sectors Size Id Type /dev/sr0p1 * 0 1531903 1531904 2.9G 0 Empty /dev/sr0p2 1215132 1222619 7488 14.6M ef EFI (FAT-12/16/32)
The reported size indicates the minimum free space required for the resulting ISO image.
- Verify that the target filesystem has enough free space for the ISO image.
$ df -h /home/user/ Filesystem Size Used Avail Use% Mounted on /dev/sda2 20G 5.2G 14G 28% /
Choose a directory with available space greater than or equal to the size reported for /dev/sr0.
- Create a sector-by-sector ISO image from the optical disk using dd.
$ sudo dd if=/dev/sr0 of=/home/user/cdimage.iso status=progress 757838336 bytes (758 MB, 723 MiB) copied, 24 s, 31.6 MB/s 1531904+0 records in 1531904+0 records out 784334848 bytes (784 MB, 748 MiB) copied, 24.5369 s, 32.0 MB/s
An incorrect of= target in the dd command can overwrite existing data and cause irreversible file loss.
- Compare checksums of the raw device and the ISO image to confirm a bit-identical copy.
$ sudo md5sum /dev/sr0 /home/user/cdimage.iso 9a659c92b961ef46f5c0fdc04b9269a6 /dev/sr0 9a659c92b961ef46f5c0fdc04b9269a6 /home/user/cdimage.iso
Matching checksums confirm that the backup ISO image is an exact copy of the optical disk.
- Optionally mount the ISO image read-only to inspect its contents after creation.
$ sudo mkdir -p /mnt/iso $ sudo mount -o loop,ro /home/user/cdimage.iso /mnt/iso
Mounting the ISO image provides a quick visual confirmation that files and directory structure are present and readable.
- Unmount the ISO image from the temporary mount point when inspection is complete.
$ sudo umount /mnt/iso
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
Comment anonymously. Login not required.
