Gentoo Archives: gentoo-user

From: Alex Schuster <wonko@×××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How to set udev rule?
Date: Sun, 30 Aug 2009 16:18:08
Message-Id: 200908302326.53203.wonko@wonkology.org
In Reply to: Re: [gentoo-user] How to set udev rule? by "Jesús Guerrero"
1 Jesús Guerrero writes:
2
3 > On Sun, August 30, 2009 21:38, Dirk Heinrichs wrote:
4 > > Am Sonntag 30 August 2009 19:29:39 schrieb Alex Schuster:
5 > >> I have to change the bus from usb to scsi, then it works. But what
6 > >> about unmounting? Is is possible to have it unmounted after I pull the
7 > >> memory stick?
8 > >
9 > > How do want to umount something that's not there anymore? You have to
10 > > umount _before_ you pull it.
11 >
12 > You can force the umount using -l (no, it's not documented in the man
13 > page). You can use this to umount a volume *after* it has been physically
14 > removed.
15
16 The -l is not necessary here, a simple umount is enough.
17
18 > And some people use this crap on udev rules to remove the
19 > volume when they unplug the pendrive.
20
21 Yes, this very rule would be nice to have :)
22
23 > Then they wonder why the heck
24 > the file is not where it should be. I guess they never heard of cached
25 > writes.
26 >
27 > The correct thing to do is of course to umount it before,
28 > and then unplug it or whatever.
29
30 I do so, it makes me feel better, but I wonder whether it is _really_
31 necessary. I see Windows users do this all the time, without any problem
32 yet. Of course, the wait a little after writing to it, but a few seconds
33 after the blinking stops seem to be enough. And people are lazy, I know my
34 Linux users _will_ just plug the stick. Using the KDE4 automounter, the
35 device will be unmounted automatically in this case, but I am looking for a
36 solution without KDE4, and as few user interaction as possible. The udev
37 mouting rule is nice, but it leaves a lot of mounts when plugging in and out
38 repeatedly.
39
40 When the system is mostly idle, I guess the writing to the stick would not
41 be delayed for a long time, so this should be quite safe. At least if the
42 data is not that important. And if there are no writes, I see no problem at
43 all.
44
45 There also is the sync option to mount, it should not be used on media with
46 limited number of write cycles, but I also guess that for my purposes this
47 would not matter.
48
49 Wonko

Replies

Subject Author
Re: [gentoo-user] How to set udev rule? "Jesús Guerrero" <i92guboj@×××××.es>
Re: [gentoo-user] How to set udev rule? Dirk Heinrichs <dirk.heinrichs@××××××.de>