LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-11-2006, 02:10 AM   #1
Zmyrgel
Senior Member
 
Registered: Dec 2005
Location: Finland
Distribution: Slackware, CentOS, RHEL, OpenBSD
Posts: 1,006

Rep: Reputation: 37
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
 
Old 07-11-2006, 03:53 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
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?
 
Old 07-11-2006, 04:59 AM   #3
Zmyrgel
Senior Member
 
Registered: Dec 2005
Location: Finland
Distribution: Slackware, CentOS, RHEL, OpenBSD
Posts: 1,006

Original Poster
Rep: Reputation: 37
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.
 
Old 07-11-2006, 01:05 PM   #4
tuxangler
Member
 
Registered: Mar 2006
Location: Germany
Distribution: OpenSuSE 10.3 x86-64 SMP - Kernel 2.6.23.14
Posts: 42

Rep: Reputation: 15
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.

Last edited by tuxangler; 07-12-2006 at 03:36 AM.
 
Old 07-12-2006, 02:16 AM   #5
Zmyrgel
Senior Member
 
Registered: Dec 2005
Location: Finland
Distribution: Slackware, CentOS, RHEL, OpenBSD
Posts: 1,006

Original Poster
Rep: Reputation: 37
Ok, thanks for pointing the right direction. I'll check that and see if I can get it to work properly.
 
Old 07-12-2006, 02:31 AM   #6
tuxangler
Member
 
Registered: Mar 2006
Location: Germany
Distribution: OpenSuSE 10.3 x86-64 SMP - Kernel 2.6.23.14
Posts: 42

Rep: Reputation: 15
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.

Last edited by tuxangler; 07-12-2006 at 03:43 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mounting devices LQ496873 Linux From Scratch 1 03-13-2006 07:51 AM
Blew up my NTFS partition with chmod while mounting can it be fixed? PSIPHON Linux - General 1 12-21-2005 12:57 AM
Mounting various SCSI devices KePSuX Linux - Hardware 2 10-08-2004 05:05 PM
Deny Mounting my devices... Gorbachov Linux - Software 5 11-06-2003 12:41 PM
Mounting CD-Devices evilmonkey Linux - Newbie 10 06-16-2003 11:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration