LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Mounting USB devices on fixed locations? (https://www.linuxquestions.org/questions/linux-hardware-18/mounting-usb-devices-on-fixed-locations-462849/)

Zmyrgel 07-11-2006 01:10 AM

Mounting USB devices on fixed locations?
 
Hi,

I own a USB-memorystick and a USB-HD. My problem is that it shifts the device name everytime I connect them so the first device I connect is /dev/sdb and second will be /dev/sdc. Is there someway to force, for example, my USB-stick to be registered as /dev/sdc?

Not a big problem but enough to irritate :(

b0uncer 07-11-2006 02:53 AM

Yeah it's called UDEV. Before that, when people used devfs a lot, things were just like that: you plugged an usb stick in, it was sda, but next time you never knew what it was called. Then came udev, which amongst other things aims at fixing this; you should get the devices under the same name every time. Udev started to be available at kernels 2.4 I think (correct me if I'm wrong) and I think 2.6 series started having it as the default choice, so devfs became obsolete.

So..are you using udev and not devfs, and if so, have you changed your configuartion somehow? Which kernel version are you running?

Zmyrgel 07-11-2006 03:59 AM

Ah, yes. I'm running gentoo-patched kernel version 2.6.16-r12. I do believe that I have the udev :) I haven't configured udev or anything.

tuxangler 07-11-2006 12:05 PM

Here is an idea for an udev-rule under /etc/udev/rules.d

Code:

KERNEL=="sd[a-z]", SYSFS{idVendor}=="10ab", SYSFS{idProduct}=="10c5", NAME="usbstick", MODE="666", GROUP="uucp"
You should fill in the correct values for idVendor and idProduct.
If it wont work play around with KERNEL=="sd[a-z]".
Maybe it has to be KERNEL=="sd*" or KERNEL=="sd*[0-9]".
Then it mounts your Stick as /dev/usbstick.

Zmyrgel 07-12-2006 01:16 AM

Ok, thanks for pointing the right direction. I'll check that and see if I can get it to work properly.

tuxangler 07-12-2006 01:31 AM

Simply place your rule as /etc/udev/rules.d/12-usbstick.rules
Then:
udevcontrol reload_rules

HowTo get your Vendor and Product-ID:
http://www.reactivated.net/writing_u....html#udevinfo
or "lsusb" or "usbview" could help.
There are Numbercodes like Vendor:Product.


All times are GMT -5. The time now is 08:49 PM.