Q. How do I blank / format my CDRW / DVD media under Linux using a shell prompt?
A. You can use wodim (cdrecord) to record data or audio Compact Discs on an Orange Book CD-Recorder or to write DVD media on a DVD-Recorder
Task: Find out device name
Find find out your CDRW drive name by entering following command:
$ cdrecord -scanbus
or
$ wodim -scanbus
Output:
scsibus1: 1,0,0 100) 'TSSTcorp' 'CD/DVDW SH-S182D' 'SB04' Removable CD-ROM 1,1,0 101) * 1,2,0 102) * 1,3,0 103) * 1,4,0 104) * 1,5,0 105) * 1,6,0 106) * 1,7,0 107) *
Note that 1,0,0 is the device name you need to use.
Task: Formatting a cd rw on Linux
Insert CD and enter following command to format CDRW (note for formatting DVD use dvd+rw-format command, see below):
$ cdrecord blank=fast dev=1,0,0
OR
$ sudo cdrecord blank=fast dev=1,0,0
Above command will blank a CD-RW and exit or blank a CD-RW before writing. The blanking type is fast, but it may be one of the following:
- all : Blank the entire disk. This may take a long time.
- fast: Minimally blank the disk. This results in erasing the PMA, the TOC and the pregap.
- track Blank a track.
- unreserve Unreserve a reserved track.
- trtail Blank the tail of a track.
- unclose Unclose last session.
- session Blank the last session.
Task: Formatting a dvd rw on Linux
Use dvd+rw-format command to formats dvd disk in the specified dvd drive such as /dev/dvd:
$ dvd+rw-format -force /dev/dvd
OR
$ sudo dvd+rw-format -force /dev/dvd
Task: Using GUI tool – k3b
k3b is a CD/DVD burning tool. It can format CD/DVD RW. First install k3b:
$ sudo apt-get install k3b
Start k3b from menus or just type
$ k3b &
Now click on Tools menu > Erase CDRW to format CDRW
OR
Now click on Tools menu > Format DVD to format DVD
See also:
Updated for accuracy!
🐧 13 comments so far... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Thanks for the guide
Thanks, this was helpful.
Thanks for the tip!
thanks but could u tell, which filesystem it uses to format dvd??
Thanks, this was useful because I made a coaster when I was forced to reboot my system during a write. graveman wasn’t dealing with the leftover CDRW well, but the blanking worked as-expected at the commandline. Then I could write my ISO as usual.
No more obnoxious nonfunctional disks now.. yay!
Yes, a second request for an answer to varun’s question!
Specifically, please tell us the Command Line syntax to select which UDF version will be used, plus the syntax to make sure the -RW disc is formatted as MRW (Mount Rainier) compatible.
Ouch, I see no button to edit the previous post, so:
I think the answer may be different for CD-RWs and DVD±RWs. Please give the syntax for the above requests, for both kinds of disc? Thanks!
@varun / RonCam,
cdrecord – Format cd-rw
dvd+rw-format – Format dvd-rw
mkisofs – Create an hybrid ISO9660/JOLIET/HFS filesystem with optional Rock Ridge attributes. The -dvd-video option passed to mkisofs to generate DVD-Video compliant UDF file system. The -UDF option passed to mkisofs include UDF support in the generated filesystem image.
To create a vanilla ISO-9660 filesystem image in the file cd.iso, where the directory /path/to/dir will become the root directory if the CD, call:
To write DVD, use growisofs:
To create a CD with Rock Ridge extensions of the source directory cd_dir:
To create a HFS hybrid CD with the Joliet and Rock Ridge extensions of the source directory cd_dir:
To create a HFS hybrid CD from the source directory cd_dir that contains Netatalk Apple/Unix files:
HTH.
Thanks to Vivek Gite for the informative reply on how to apply the attributes to CDs and DVDs. I have learned something here!
:-) It will be most appreciated if you could now do the same, for Mount Rainier formatting.
Here’s hoping the somewhat unusual syntax for embedding references works — the preview function is absent!!
Thanks, very helpful…
This article is still very helpful – just used K3b for the first time today for a quick format, and impressed. :)
Thanks! You saved me a lot of time trying to find formatting software on an online store!
thanks!