Identify udev subsystems and devtypes
I may have found the answer after some lurking in IRC for a while.
SUBSYSTEM:block DEVTYPE:disk
Here's how I found it. it was suggested this command:
sudo udevadm info --root --name=/dev/sdX
Here 'X' in
sdX
must be replaced by the device that represents your USB mass storage device. If you need to find that out, go to/dev
and enterls
, once with the device connected to your machine and once without. Find the missingsdX
and voila!This also shows properties such as
ID_FS_TYPE
,ID_BUS
,etc...However I'm not too sure about the
DEVTYPE
of USB mass storage devices. There's a chance it could bepartition
. If anyone knows, please comment or add an answer!
Related videos on Youtube
Vineet Kaushik
Updated on September 18, 2022Comments
-
Vineet Kaushik over 1 year
I have to write a python script to monitor for usb mass storage devices. To successfully filter the required media it must be identified by its
subsystem
andDEVTYPE
.Does anyone know the required
subsystem
andDEVTYPE
for a usb mass storage device?Alternatively, can anyone tell me where I could find a list of all
subsystem
s andDEVTYPE
s? -
user.dz about 10 yearsThank you, nice to know about it. Seems OK,
DEVTYPE=partition
only if I point directly to the partition itself/dev/sdXy
like:/dev/sda1