3

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 and DEVTYPE.

Does anyone know the required subsystem and DEVTYPE for a usb mass storage device?

Alternatively, can anyone tell me where I could find a list of all subsystems and DEVTYPEs?

0

1 Answer 1

1
  • 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 enter ls, once with the device connected to your machine and once without. Find the missing sdX 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 be partition. If anyone knows, please comment or add an answer!

1
  • Thank you, nice to know about it. Seems OK, DEVTYPE=partition only if I point directly to the partition itself /dev/sdXy like: /dev/sda1
    – user.dz
    Mar 15, 2014 at 11:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .