Ubuntu – Find size of a blank CD


I can't mount a DVD or CD if it is blank, but I'd like to find out its size before.

With a USB I could easily use fdisk, but that doesn't work with CD or DVD

If possible I'd also like to find out whether it's a DVD or CD. sr0 is the listed block device.

Best Answer

You can do this with udftools

cdrwtool -i -d /dev/sr0 | awk '$1 == "free_blocks" {print $3 * 2048}'

will show the size in bytes.

On an empty DVD I get


and it says 4.7Gb on the disc itself.

If possible i'd also like to find out whether it's dvd or cd.

There are no 4.7Gb cd's. Nor 700Mb dvd's. The size also shows you what kind of medium it is.

There is also

cdrecord -minfo -v

To use it install:

sudo apt install wodim

There is also dvd+rw-mediainfo:

dvd+rw-mediainfo /dev/sr0
Related Question