I'm trying to write a udev rule to not mount USB devices plugged into my system if they're bootable, but I don't know how to specify in udev if a device is bootable in a rule. Is that possible? If so, what needs to go into my rule?
To be clear, by bootable, I mean the device has an OS that I can boot into at start up.
Best Answer
udev
adds some environment variables to the partition node (leaf node) including partition entry flags for MBR table. Bootable partition should haveID_PART_ENTRY_FLAGS=0x80
.Try this rule and you gonna see all environment variables (source: Pass ATTR{idVendor} as argument in udev script):
A rule that works for me in Ubuntu 14.04: