Get mountpoint path from device name

256 views Asked by At

Suppose I have a path to the Bluray device, let us assume /dev/sr0.

How can I get the mountpoint from it? I understand it should be somewhere in /media/user/.

Can a single Bluray disk have more filesystems on it, therefore multiple mountpoints?

Terminal command or Python code needed. Must work at least on Linux (possibly Windows).

1

There are 1 answers

0
ArekBulski On

Here is what I just found:

$ udevadm info -q all -n /dev/sr0

yields, among other data fields:

S: disk/by-id/*dvd drive model and serial numer*
S: disk/by-label/*mountpoint name*
S: disk/by-uuid/*disk serial number*
E: DEVNAME=/dev/sr0
E: ID_MODEL=*dvd drive model*
E: ID_SERIAL_SHORT=*dvd drive serial number*

E: ID_FS_UUID=*disk serial number*
E: ID_FS_VOLUME_SET_ID=*full label, not a short*
E: ID_FS_LABEL=*disk label*
E: ID_FS_LOGICAL_VOLUME_ID=*disk label*