Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I put a DVD into the DVD drive, it appears in Nautilus Places, but is not automatically mounted. (this is by personal choice).

In this unmounted state, mount (of course) reports nothing, and likewise for df..
but Nautilus is aware of the DVD hardware unit and has read the Label; which it shows in Places

So it seems to me that Nautilus has already accessed the DVD devices (Did it temporarily mount it?)...

The main point of my question was to determine how to find the device Id of an unmounted device .. but as I've been writing this, I now think it may not be as simple as that...

This issue came up because I wanted to test this command
cat iso-pieces.* | growisofs -Z /dev/dvd=/dev/stdin,
but then realized that I didn't know how to get my DVD's device Id.
... and does the above command requires a mounted device, or does it write directly to the device? ... as you can see, I'm a bit vague about devices :)
Come to think of it maybe Nautalus read the DVD device directly, because when all is said and done, something has to read/write directly to it.

info growisofs says:

Under Linux it will most likely be an ide-scsi device such as "/dev/scd0

How can I find this Id via a script?

share|improve this question
    
So you haven't got /dev/scd0 what you wrote too? Or what do you mean about "device id", the name of the device entry in /dev, like that /dev/scd0? You may want to examine entires like /dev/dvd, usually udev (which manages /dev entries) creates it as a symlink for the proper device of your dvd drive. You can use than /dev/dvd with growisofs (or other tools) but for sure you can also use the entry symlink of /dev/dvd points to. Anyway I am not sure what you mean about "id" when you already mentioned even /dev/dvd when you wrote "I wanted to test this command". –  LGB Feb 16 '11 at 9:57
    
@LGB: Thanks, you've clarified it for me (make it an answer).. When Nautilus mounts the DVD, the device shows in mount and dfas /dev/sr0 this is what I mean by the device Id. By device Id, I meant /dev/sr0 (which is what mine is).. and maybe "address" is a better word.. I didn't realize that /dev/dvd was a symlink, because when I looked for it, it didn't show up with locate or Nautilus Search, sudo or otherwise (maybe that's because it is a symlink).. I see now.. /dev/dvd and /dev/dvd1 for my second DVD drive. Problem solved (make an answer and I'll accept it).. readlink found them –  Peter.O Feb 16 '11 at 11:15
1  
Ok, I did, and thanks. I haven't post that as an answer, because I have the thought that I should answer when I feel it is really that, not just a guessing comment :) But it's nice if I could help anyway. –  LGB Feb 16 '11 at 13:01
add comment

3 Answers 3

up vote 4 down vote accepted

So here it is my comment as an answer finally: if you think about those entries in /dev as "device ids" then you have already the answer: it's maybe /dev/scd0 as you wrote. You may want to examine entires like /dev/dvd, usually udev (which manages /dev entries) creates it as a symlink for the proper device of your dvd drive. You can use than /dev/dvd with growisofs (or other tools) but for sure you can also use the entry symlink of /dev/dvd points to. As you noted too, it's nice to examine the output of command mount when your media is mounted, so you know the device name from it then!

share|improve this answer
add comment

If you want to start from a more what-controller-is-it-attached-to sense of device, you can use udev's by-path symlinks, e.g.:

/dev/disk/by-path/pci-XXXX:XX:XX.X-scsi-X:X:X:X

share|improve this answer
    
An interesting piece of information... I was looking at that directory the other day, and wondering exactly what it was all about... Hardware is definitely not my forte, and every piece of info helps.., It seems I need to take a good look at what udev is all about.. (google to the rescue! "udev is the device manager for the Linux kernel".) ... Thanks –  Peter.O Feb 18 '11 at 10:03
add comment

Just to restate what has been already said in the comments, running ls on the DVD device should show the 'real' device it is linked to:

ls -l /dev/dvd

lrwxrwxrwx 1 root root 3 2011-05-28 10:46 /dev/dvd -> sr0

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.