switching devices on&off - general misunderstanding?
Alan McKinnon
alan at linuxholdings.co.za
Tue May 9 20:51:18 UTC 2006
On Tuesday 09 May 2006 17:23, Tobias Baldauf wrote:
> Hi all!
>
> One thing that keeps me from using (K)ubuntu as my daily OS is
> definetely that when I plug in my usb-stick two times during one
> session, it is first device sda1 and the second time sda2. Or maybe
> sda and then sdb. The titles don't matter that much.
[snip]
> Why does the OS behave like that? Is this to some advantage I don't
> see? I'd like to plug in a usb-harddrive, have fstab handle the
> rules, shut it down & switch it on later for another time because I
> forgot to copy something. Why is a simple procedure made so
> complicated? I really don't see the reason why these device-labels
> switch all the time...Can't I 'forbid' the OS to do so?
This is all an artifact of the way the kernel is handling hotplug
events. It's terribly complicated...
The solution is udev.
Create custom rules in /etc/udev/rules.d for *your* specific hardware
and specify logical symlinks to the node udev creates.
In other words, when you plug in your USB stick, the real node might
be /dev/sda, /dev/sdb1 or even /dev/humptydumpty for all we care but
there's always a link to it called /dev/flash that _you_ use. Your
HP1234 printer might be /dev/hp1234, etc.
You'll have to do some research, head scratching and figuring out to
use udev properly, the subject isn't as well documented as it could
be. Start with the Ubuntu wiki (I'm not online right now to give a
URL) and I find http://www.reactivated.net/udevrules.php to be useful
--
If only me, you and dead people understand hex,
how many people understand hex?
Alan McKinnon
alan at linuxholdings dot co dot za
+27 82, double three seven, one nine three five
More information about the ubuntu-users
mailing list