Writing CDs, DVDs and Blu-ray discs on Linux today
To burn a disc on Linux today, use xorriso: one program that builds ISO 9660 images and writes them to CD, DVD and Blu-ray. cdrskin is the choice for audio CDs, and growisofs still works for DVD and BD. If you only want to start a Linux installer, skip the disc and write the ISO file to a USB stick instead.
The tools today
| Tool | Package | Good for |
|---|---|---|
xorriso | xorriso (Debian, Ubuntu, Fedora); libisoburn (Arch) | Making ISO images and burning data to CD, DVD, BD; adding sessions; also understands mkisofs and cdrecord options |
cdrskin | cdrskin (Debian, Ubuntu); libburn (Arch) | cdrecord-style burning, including audio CDs |
growisofs | growisofs (Debian, Ubuntu); dvd+rw-tools (Arch) | DVD and BD only |
cdrdao | cdrdao | CD images described by TOC or CUE files (BIN/CUE) |
wodim, genisoimage | wodim, genisoimage (Debian) | Older fork of cdrecord/mkisofs; prefer xorriso or cdrskin |
Graphical programs (K3b for KDE, Brasero for GNOME, Xfburn for Xfce) are front ends to these same back ends; when a GUI fails, the command line usually tells you why. This page uses xorriso and cdrskin from the libburnia project, which drive the burner directly with no extra helper programs.
# Debian, Ubuntu
sudo apt install xorriso cdrskin growisofs
# Fedora
sudo dnf install xorriso
# Arch
sudo pacman -S libisoburn libburn dvd+rw-tools
Find the drive
The first optical drive is /dev/sr0; udev also creates /dev/cdrom and similar links. Ask xorriso which drives it can use:
xorriso -devices
A drive appears only if you have read and write permission on it. In a local desktop session, systemd-logind gives the logged-in user access automatically. Over SSH or from a script, check the owning group with ls -l /dev/sr0 (it is cdrom on Debian and Ubuntu and optical on Arch) and add yourself to it with sudo usermod -aG cdrom $USER, then log in again. A drive that another program is using (for example a file manager that mounted the disc) is not listed.
To see what is on the inserted medium:
xorriso -indev /dev/sr0 -toc
Make an ISO image
Put the files in a folder and build an image. The mkisofs-compatible form is familiar from older guides:
xorriso -as mkisofs -V PHOTOS_2026 -r -J -o photos.iso ./photos
-Vsets the volume label. Keep it to 32 characters from A–Z, 0–9 and underscore; it is what desktops show when the disc is mounted.-radds Rock Ridge (long names and Unix permissions, used by Linux).-Jadds Joliet (Unicode names, used by Windows).
For backups, xorriso's native mode can also record ACLs, extended attributes, hard links and an MD5 checksum per file:
xorriso -outdev backup.iso -for_backup -map /home/me/documents /documents
Check the image before you burn it:
sudo mount -o loop,ro photos.iso /mnt
ls /mnt
sudo umount /mnt
Capacity, roughly: CD 700 MB, single-layer DVD 4.7 GB, dual-layer DVD 8.5 GB, BD 25 GB per layer. xorriso accepts single files of 4 GiB and larger, which current Linux kernels read fine; older systems may not.
Burn an ISO image
This works for any image file, including a Linux distribution's ISO, which stays bootable:
xorriso -as cdrecord -v dev=/dev/sr0 blank=as_needed photos.iso
blank=as_needed erases a rewritable disc first if it contains data and is ignored on blank media. Equivalent commands with the other tools:
cdrskin -v dev=/dev/sr0 -sao photos.iso # CD, DVD or BD
growisofs -dvd-compat -Z /dev/sr0=photos.iso # DVD or BD only
Burn files directly
You do not need an image file on disk first. xorriso builds the file system and writes it in one run:
xorriso -outdev /dev/sr0 -blank as_needed \
-volid PHOTOS_2026 -joliet on \
-map ./photos /photos -map ./videos /videos
-map takes a folder on disk and the path it should have on the disc. growisofs does the same for DVD and BD:
growisofs -Z /dev/sr0 -V PHOTOS_2026 -r -J ./photos
Add files later (multi-session)
Write-once discs (CD-R, DVD±R, BD-R) can take more sessions until they are full, unless they were closed. With xorriso, use -dev instead of -outdev and do not blank:
xorriso -dev /dev/sr0 -map ./more_photos /photos/2026-11
xorriso loads the existing tree, adds the new files and writes a new session that contains both. With growisofs, use -M instead of -Z: growisofs -M /dev/sr0 -r -J ./more_photos.
Erase or format rewritable discs
xorriso -outdev /dev/sr0 -blank as_needed # CD-RW, DVD-RW, DVD+RW, BD-RE
cdrskin -v dev=/dev/sr0 blank=fast # quick erase of CD-RW or DVD-RW
xorriso -outdev /dev/sr0 -format as_needed # format DVD-RW or BD for overwriting
On Blu-ray, growisofs pre-formats blank BD-R and BD-RE media with a 256 MB spare area for defect management, and the drive's verify-while-writing then makes the burn much slower. To skip the formatting, growisofs accepts -use-the-force-luke=spare:none (an option its manual page does not list). xorriso and cdrskin do not format BD-R by default, and -stream_recording on (xorriso) or stream_recording=on (cdrskin) writes at full speed on formatted media.
Audio CDs
Audio tracks must be uncompressed WAV files at 16-bit, 44,100 Hz, stereo. Convert other formats with sox or ffmpeg, and name files so they sort in track order:
for f in *.flac; do sox "$f" -b 16 -r 44100 -c 2 "${f%.flac}.wav"; done
cdrskin -v dev=/dev/sr0 -sao -audio 01.wav 02.wav 03.wav
-sao (session at once) writes the whole session in one pass. cdrskin treats files ending in .wav as audio even without -audio, checking their headers first. Audio CDs work only on CD media, not DVD or BD. For a BIN/CUE image, use cdrdao write --device /dev/sr0 image.cue.
Check the burned disc
Eject and reinsert the disc so the kernel does not read from its cache. Then compare checksums, reading only as many 2,048-byte blocks as the image has (many discs return extra padding at the end):
sha256sum photos.iso
blocks=$(( $(stat -c %s photos.iso) / 2048 ))
dd if=/dev/sr0 bs=2048 count=$blocks status=progress | sha256sum
The two checksums must match. If dd stops with an I/O error, the burn is bad; sudo journalctl -k shows the failing block.
Copy a disc to an ISO file
Find the size of the file system, then copy exactly that much:
isosize -x /dev/sr0
dd if=/dev/sr0 of=disc.iso bs=2048 count=SECTOR_COUNT status=progress
Replace SECTOR_COUNT with the sector count from the first command. For a scratched disc use ddrescue, which retries bad areas. This works for data discs only; audio CDs have no file system, so rip them with a CD ripper instead. Commercial DVD-Video and Blu-ray discs are usually copy-protected, and the law on copying them differs by country.
Write an ISO to USB instead
New computers rarely have an optical drive, and a USB stick is faster and reusable. Most distribution ISO files are "hybrid" images that boot from either. Identify the stick carefully, then write the image to the whole device (not a partition):
lsblk -o NAME,SIZE,MODEL,TRAN
sudo dd bs=4M if=debian-13.iso of=/dev/sdX conv=fsync oflag=direct status=progress
Everything on the target is erased. Replace /dev/sdX with the USB stick shown by lsblk (check the size and model). Writing to the wrong device destroys that disk. Using a /dev/disk/by-id/usb-… name is safer than /dev/sdX.
Graphical tools such as GNOME Disks ("Restore Disk Image") and Fedora Media Writer do the same with fewer chances to pick the wrong disk. See Bootdisk HOWTO for multi-ISO sticks and rescue media.
Mistakes to avoid
- Burning while the disc is mounted: the desktop may auto-mount a disc with a file system. Run
sudo umount /dev/sr0first. - Burning at maximum speed on cheap media. If discs fail to read, burn again at a lower speed (the
speed=option of cdrskin, or-speedin xorriso; see their manuals for the units). - Using
-outdevwhen you meant to append:-outdevwith-blank as_neededstarts a new disc and erases rewritable media. - Expecting long Windows file names without
-J(or-joliet on). - Trusting a burn without checking it. Optical media also age; for long-term archives keep two copies and test them every few years.
The classic CD-Writing HOWTO, from the SCSI-emulation days of 2000, is kept by the Linux Documentation Project at tldp.org.
Sources
- xorriso(1), Debian manual pages
- cdrskin(1), Debian manual pages
- growisofs(1), Debian manual pages
- wodim(1), Debian manual pages
- dd(1), Linux man-pages project
- Optical disc drive, Users and groups and USB flash installation medium, ArchWiki