I've noticed that each DVD image has a semi-unique uppercase name. Is there a standardized way for me to simply read this name as a non-root user in Linux? I'm on an Ubuntu 12.04 derivative running kernel 3.7. I'd like to simply get the name of any disk currently in the drive like so:
DVD_NAME="$( ./read-dvd-name.sh )"
Best Answer
You could use
blkid
for that:(you need to have read permission to
/dev/dvd
for that).Or:
for which you don't need any special privilege (
udev
(running as root) queries the label name usingblkid
and updates a device database which you query withudevadm
).