Linux / UNIX: Find Volume Information From CDs and ISO Images

Q. I can use dd command to create ISO images from a CD but how do I get volume information from CDs and ISO images from a shell prompt?

A. You can use the following commands:
[a] file – To determine file type.

[b] dd – Ultimate convert and copy command.

[c] cdrecord – To record audio or data Compact Disks or Digital Versatile Disks from a master.

[d] isoinfo – A utility to perform directory like listings of iso9660 images.

[e] cd-discid – To read CD and get CDDB discid information.

Task: Read the volume data from an unmounted CD

Use the following command:
file -s /dev/scd0
Sample output:

/dev/scd0: ISO 9660 CD-ROM filesystem data UDF filesystem data (unknown version, id 'NSR01') 'Ubuntu 7.04 i386               ' (bootable)

Task: Read the table of contents of an unmounted CD

Use cdrecord:
cdrecord -v dev=/dev/scd0 -toc
Sample output:

TOC Type: 1 = CD-ROM
scsidev: '/dev/scd0'
devname: '/dev/scd0'
scsibus: -2 target: -2 lun: -2
Linux sg driver version: 3.5.27
Wodim version: 1.1.6
SCSI buffer size: 64512
Device type    : Removable CD-ROM
Version        : 5
Response Format: 2
Capabilities   : 
Vendor_info    : 'TSSTcorp'
Identification : 'CD/DVDW SH-S182D'
Revision       : 'SB04'
Device seems to be: Generic mmc2 DVD-R/DVD-RW.
Current: 0x001A (DVD+RW)
Profile: 0x0015 (DVD-R/DL sequential recording) 
Profile: 0x0016 (DVD-R/DL layer jump recording) 
Profile: 0x002B (DVD+R/DL) 
Profile: 0x001B (DVD+R) 
Profile: 0x001A (DVD+RW) (current)
Profile: 0x0014 (DVD-RW sequential recording) 
Profile: 0x0013 (DVD-RW restricted overwrite) 
Profile: 0x0012 (DVD-RAM) 
Profile: 0x0011 (DVD-R sequential recording) 
Profile: 0x0010 (DVD-ROM) 
Profile: 0x000A (CD-RW) 
Profile: 0x0009 (CD-R) 
Profile: 0x0008 (CD-ROM) 
Profile: 0x0002 (Removable disk) 
Using generic SCSI-3/mmc DVD-R(W) driver (mmc_mdvd).
Driver flags   : SWABAUDIO BURNFREE 
Supported modes: PACKET SAO
Drive buf size : 917504 = 896 KB
Beginning DMA speed test. Set CDR_NODMATEST environment variable if device
communication breaks or freezes immediately after that.
Current Secsize: 2048
HINT: use dvd+rw-mediainfo from dvd+rw-tools for information extraction.
first: 1 last 1
track:   1 lba:         0 (        0) 00:02:00 adr: 1 control: 4 mode: -1
track:lout lba:   2295104 (  9180416) -1:59:74 adr: 1 control: 7 mode: -1

Task: Read the volume data from an ISO image

Type the following command:
isoinfo -d -i /path/to/file.iso
isoinfo -d -i ubuntu-8.04-desktop-i386.iso

Sample output:

CD-ROM is in ISO 9660 format
System id: LINUX
Volume id: Ubuntu 8.04 i386
Volume set id: 
Publisher id: 
Data preparer id: 
Copyright File id: 
Abstract File id: 
Bibliographic File id: 
Volume set size is: 1
Volume set sequence number is: 1
Logical block size is: 2048
Volume size is: 357949
El Torito VD version 1 found, boot catalog is in sector 162
Joliet with UCS level 3 found
Rock Ridge signatures version 1 found
Eltorito validation header:
    Hid 1
    Arch 0 (x86)
    ID ''
    Key 55 AA
    Eltorito defaultboot header:
        Bootid 88 (bootable)
        Boot media 0 (No Emulation Boot)
        Load segment 0
        Sys type 0
        Nsect 4
        Bootoff 9B 155

Task: Find the unique disk number from an unmounted CD

Type the command as follows:
cd-discid /dev/scd0
Sample output:

023bfd01 1 150 15359

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 2 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig 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
2 comments… add one
  • SpawnHappyJake Feb 23, 2011 @ 8:10

    Wow. You guys rock. JSYK, cdrdao and ddpt are pretty cool too. Ddpt is a dd re-write that allows more direct access to hardware if the hardware has a SCSI pass-through interface. And cdrdao seemingly allows more direct access to the hardware without going through Linux’s hardware abstraction (because you can type something like “0,0,0” instead of “/dev/sr0” or “/dev/cdrom” of which the latter two are actual paths to files that link to the hardware through the kernel, i.e., hardware abstractions).

    Oh … and the isoinfo -d -i command works with a hardware abstraction file to find such info off an actual CD, not just images, like such: isoinfo -d -i /dev/sr1
    sample output:
    CD-ROM is in ISO 9660 format
    System id: CD-RTOS CD-BRIDGE
    Volume id: BFN_PC
    Volume set id:
    Publisher id:
    Data preparer id:
    Application id: EASY CD CREATOR 4.2 (285) COPYRIGHT (C) 1996-2000 ADAPTEC, INC.
    Copyright File id:
    Abstract File id:
    Bibliographic File id:
    Volume set size is: 1
    Volume set sequence number is: 1
    Logical block size is: 2048
    Volume size is: 85992
    Joliet with UCS level 3 found
    NO Rock Ridge present

  • Vitaly Nov 5, 2012 @ 18:30

    Thank you, Guy! =)
    This article is really useful!

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum