Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there a way to force an usb drive to always get a specific letter in /dev/sd*? I know about udev symlinks, that does not help.

share|improve this question

1 Answer 1

You need a custom UDEV rule to set this up. Plug the device in and you can find out the vendorid and productid with ...

lsusb 

this will show several lines that look something like this...

Bus 005 Device 003: ID 04fc:0c25 Sunplus Technology Co., Ltd 

From this you can see that ...

  • Vendorid is 04fc
  • Productid is 0c25

As the device is a storage device we will be writing the rule in 60-persistent-storage.rules. So open this file with your prefered editor (for instance sudo vi /etc/udev/rules.d/60-persistent-storage.rules) and add the following line:

KERNEL=="sd*[0-9]",SYSFS{idVendor}=="04fc",SYSFS{idProduct}=="0c25", SYMLINK+="usbdrive"

This informs udev-manager, that if any storage device with vendorid 04fc and productid 0c25 is plugged into the system to add a symlink in /dev with name usbdrive. I used usbdrive but you can use another name if need be.

From now on you can access this drive with /dev/usbdrive.

I used this Source for the example.

share|improve this answer
    
As said in the question, symlinking is not what I want to do. –  Marcus Apr 29 '12 at 16:25
    
udev IS the way to do this but you are welcome to wait for someone else to come up with another method. Doubt it though :) –  Rinzwind Apr 29 '12 at 16:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.