Overriding EEE PC’s drive letter assignment for USB devices

When you plug a USB device into the EEE PC, it makes it look like it has a Windows drive letter by mounting it on something like /media/D: This is fine for a lot of stuff, but I have a USB drive I want to put a VirtualBox virtual machine on, and I don’t want to take the chance that it will be drive E: next week.

So, I made a change that seems to work: I created a file called /etc/udev/rules.d/01-local.rules that overrides the default usb handling just for this device (or devices just like it; I’m not certain that this uniquely identifies a particular device). Put this all one one line:

BUS=="usb", KERNEL=="sd*", SYSFS{serial}=="P975LEG4", NAME="VMs",
OPTIONS+="last_rule",
RUN+="/bin/mount UUID=5cc6f807-0ee2-46a8-a48a-90a2b9b1ab22"

To make this take effect, I make sure the device is unplugged, the run the command sudo udevcontrol reload_rules. I make sure I have a mount point for this device in fstab (and that the mount point exists):

UUID=5cc6f807-0ee2-46a8-a48a-90a2b9b1ab22 /mnt/VMs ext3 auto,users 0 0

Now, when I plug the device in, it doesn’t get a DOS-ish drive letter, no window pops up asking me what I want to do, and it gets mounted where I want it. I still have to umount it when I’m done, but this is progress. How do you find out the serial number of the device? Assuming that it’s recognized as /dev/sdd, you can use:

udevinfo -a -p /block/sdd

You can use the blkid command to get a list of all drives and their UUIDs.

This entry was posted in linux. Bookmark the permalink.

One Response to Overriding EEE PC’s drive letter assignment for USB devices

  1. Eee PC says:

    You should really post this over at EeeUser! There wiki over there is kind of difficult to use but adding information to it like this will help people actually figure this out instead of going nuts looking for it on the forums like I’ve done.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>