How can find out the device Id of my unmounted DVD?
Solution 1
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!
Solution 2
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
Related videos on Youtube
Peter.O
Free! Free at last! ... my Windows box died in September 2010 ... and I'm free at last!
Updated on September 17, 2022Comments
-
Peter.O over 1 year
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 fordf
..
but Nautilus is aware of the DVD hardware unit and has read the Label; which it shows in PlacesSo 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?
-
LGB about 13 yearsSo 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".
-
Peter.O about 13 years@LGB: Thanks, you've clarified it for me (make it an answer).. When Nautilus mounts the DVD, the device shows in
mount
anddf
as/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 withlocate
orNautilus 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 -
LGB about 13 yearsOk, 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.
-
-
Peter.O about 13 yearsAn 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
-
Chris about 9 yearsI think
sudo blkid
will show exactly what you're searching for.