views:

65

answers:

2

I'm trying to find a way to mark a USB flash device in a way that I can programmaticly test for without mounting it or changing the label.

Are there any properties I can modify about a device that will not cause it to behave/look differently to the user?

Running Ubuntu Jaunty.

+1  A: 

You cannot modify this property, but the tuple (vendor_id, product_id, serial_number) is unique to each device, so you can use this as mark that is already there. You can enumerate the devices on the USB bus using lsusb or usblib.

Ber
A: 

Changing the VID/PID might make your device non-usable without custom drivers. HAL isn't supposed to auto-mount your flash drives for you.

That being said, you could always sneak something into the boot sector and/or the beginning part of the drive. There are a lot of spare bytes in there that can be used for custom purposes - both nefarious and otherwise.

sybreon
Re automounting, I mean accessed by an application that *uses* hal :)I'll see what I can do with flipping the MBR bits.
lfaraone