[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 394
  • Last Modified:

Solaris, determine if inserted disk is CD or DVD

I am using Solaris 10.
According to Oracle's system admin manual, inserted CDs and DVDs are mounted as a subdirectory in /cdrom.
I find it strange that DVDs don't have their own mount directory.

How can I determine if a device a CD or a DVD? Because the method of writing data would differ depending on this.
  • 3
  • 2
  • 2
  • +2
1 Solution
# cfgadm -al
Joseph GanSystem AdminCommented:
Using command
# iostat -En

should show the device is a DVD-ROM or a CD-ROM.
mounting of cd or dvd should not be a problem. You may try to use

/usr/platform/`uname -i`/sbin/prtdiag


/usr/platform/`uname -m`/sbin/prtdiag

to find your server hardware details
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Do you intend to write CD/DVDs with tools like cdrdao/growisofs?
bejhanAuthor Commented:
Going to look into all of your replies, just tied up temporarily with something else.

svs: I do not know which tools will be used, I am doing this research preemptively. Is there a reason you ask?
bejhanAuthor Commented:
I think I may have worded my question badly, because none of you seems to understand what I am after.
I want to know how to tell whether the inserted disk is a CD or a DVD (or even a BD). Because when you have a blue-ray drive, for example, all of these types of disks are able to be burned, but the process in doing so will be different.

See below as to why your answer did not suffice:

hossamshaaban: cfgadm -al does not describe whether the inserted disk is CD or DVD, just that the drive is CD/DVD compliant.
Ap_Id                          Type         Receptacle   Occupant     Condition
sata0/2::dsk/c1t2d0    cd/dvd     connected    configured   ok

Open in new window

ganjos: iostat -En does not describe whether the inserted disk is CD or DVD, just drive information (not even what types are supported).
c0t1d0           Soft Errors: 0 Hard Errors: 3 Transport Errors: 0
Vendor: ATAPI    Product: iHAS124   Y      Revision: BL0V Serial No:
Size: 0.00GB <8192 bytes>
Media Error: 0 Device Not Ready: 2 No Device: 1 Recoverable: 0
Illegal Request: 47 Predictive Failure Analysis: 0

Open in new window

omarfarid: /usr/platform/`uname -i`/sbin/prtdiag does not describe whether the inserted disk is CD or DVD, just motherboard information (not even information about the optical disk drive).
System Configuration: System manufacturer System Product Name
BIOS Configuration: American Megatrends Inc. 1305 02/11/2011

==== Processor Sockets ====================================

Version                          Location Tag
-------------------------------- --------------------------
Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz LGA1155

==== Memory Device Sockets ================================

Type    Status Set Device Locator      Bank Locator
------- ------ --- ------------------- --------------------
Unknown in use 0   DIMM0               BANK0
Unknown in use 0   DIMM1               BANK1
Unknown in use 0   DIMM2               BANK2
Unknown in use 0   DIMM3               BANK3

==== On-Board Devices =====================================
Onboard Ethernet

==== Upgradeable Slots ====================================

ID  Status    Type             Description
--- --------- ---------------- ----------------------------
1   in use    PCI Express      PCIEX16_1
2   in use    PCI Express      PCIEX1_1
3   in use    PCI Express      PCIEX1_2
4   in use    PCI              PCI1

Open in new window

Joseph GanSystem AdminCommented:
Product:ATAPI iHAS124 Y is a "SCSI CdRom Device"
bejhanAuthor Commented:
iostat -En doesn't return that information, you had to look it up, and that still doesn't tell me what the type of the inserted disk is!

I am looking for a programatic way to determine if the inserted disk is a CD, DVD or BD so that when my application attempts to write data to the disk it knows how to do so.
Send some raw SCSI commands to the device, interpret the results.  Look how cdrtools does it: prdiskstatus() in cdrecord/scsi_mmc.c

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now