The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    A question about finding your optical drive in Linux :)

    Discussion in 'Linux Compatibility and Software' started by talin, Aug 1, 2008.

  1. talin

    talin Notebook Prophet

    Reputations:
    4,694
    Messages:
    5,343
    Likes Received:
    2
    Trophy Points:
    205
    Hello,
    I've searched around quite a bit, but can't find a definitive answer. I'm looking for specifically my DVD-RW drive to burn data discs with, using growisofs (I prefer the commandline :) ).
    In kubuntu, I was able to find the device listed as /dev/scd1, but in ubuntu that didn't work, I had to use /dev/dvdrw. My question is, how do I find, definitively, where my optical drive is, preferably through the commandline?
    Thanks. :)
     
  2. lemur

    lemur Emperor of Lemurs

    Reputations:
    524
    Messages:
    1,024
    Likes Received:
    0
    Trophy Points:
    55
    I believe /dev/dvdrw is a symlink automatically created by the installation scripts or perhaps recreated at each boot. It points to the real device.

    There should be no difference between Ubuntu and Kubuntu regarding how the devices are named. Ubuntu and Kubuntu differ only as to which default desktop is installed. Device naming operates at a lower level than that.
     
  3. talin

    talin Notebook Prophet

    Reputations:
    4,694
    Messages:
    5,343
    Likes Received:
    2
    Trophy Points:
    205
    I know, that's the strange part. I tried it, but /dvdrw would not work in kubuntu, likewise, /scd1 would not work in ubuntu.
    That's why I asked. Isn't there some terminal command to bring up the true device symlink?
     
  4. archer7

    archer7 Notebook Evangelist

    Reputations:
    289
    Messages:
    647
    Likes Received:
    0
    Trophy Points:
    30
    This is a bit late, but you might want to look at the man page for udev.

    Here's the discriptor:
    Code:
    NAME
           udev - dynamic device management
    
    DESCRIPTION
           udev provides a dynamic device directory containing only the files for
           actually present devices. It creates or removes device node files in
           the /dev directory, or it renames network interfaces.
    
           Usually udev runs as udevd(8) and receives uevents directly from the
           kernel if a device is added or removed from the system.
    
           If udev receives a device event, it matches its configured rules
           against the available device attributes provided in sysfs to identify
           the device. Rules that match may provide additional device information
           or specify a device node name and multiple symlink names and instruct
           udev to run additional programs as part of the device event handling.
     
  5. szandor

    szandor Notebook Evangelist

    Reputations:
    66
    Messages:
    323
    Likes Received:
    0
    Trophy Points:
    30
    the easiest way to get the device name is:

    Code:
    loki@galileo:~$ grep /dev /etc/fstab
    /dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec 0       0
    loki@galileo:~$
    now you can simply do:

    Code:
    loki@galileo:~$ ls -l /dev/scd0
    brw-rw----+ 1 root cdrom 11, 0 2008-08-04 06:23 /dev/scd0
    loki@galileo:~$ 
    now take note of the block indicator at the beginning which corresponds to major-block 11 which you can further confirm by tracking down the module with:

    Code:
    loki@galileo:~$ lsmod | grep cdrom
    cdrom                  37408  1 sr_mod
    loki@galileo:~$
    which you can use for:

    Code:
    loki@galileo:~$ modprobe -c | grep sr_mod
    alias block-major-11-* sr_mod
    loki@galileo:~$
    which now reaffirms everything back up to /etc/fstab. if you need more information about the drive itself you can use:

    Code:
    loki@galileo:~$ hdparm -i /dev/sr0
    
    /dev/sr0:
    
     Model=MAT****A DVD+/-RW UJ-857G               , FwRev=Z111    , SerialNo=
     Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }
     RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0
     BuffType=unknown, BuffSize=0kB, MaxMultSect=0
     (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0
     IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}
     PIO modes:  pio0 pio1 pio2 pio3 pio4
     DMA modes:  sdma0 sdma1 sdma2 mdma0 mdma1 mdma2
     UDMA modes: udma0 udma1 *udma2
     AdvancedPM=no
     Drive conforms to: Unspecified:  ATA/ATAPI-3,4,5,6,7
    
     * signifies the current active mode
    
    loki@galileo:~$
     
  6. talin

    talin Notebook Prophet

    Reputations:
    4,694
    Messages:
    5,343
    Likes Received:
    2
    Trophy Points:
    205
    Thanks szandor! Just what I was looking for! :)
    Just a question if you may know. Why is it then, that in kubuntu /dev/scd1 worked, but in ubuntu, I have to use /dev/dvdrw?