Re: Mounting only inserted disks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On Sun, Jan 29, 2012 at 11:26, Kai Hendry <hendry@xxxxxxxxxxxxxxxx> wrote:
> It's very unfortunate that udev can't distinguish between bootup from
> device hotplug. :(
> On 29 January 2012 12:23, Kay Sievers <kay.sievers@xxxxxxxx> wrote:
>> Udev's rule engine is not the right place to hookup mounting of
>> arbitrary filesystems, or configure non-trivial network settings like
>> DHCP, or start system daemons, or run any other programs that runs for
>> an unpredictable amount of time. Udev rules should only be used to
>> identify or initially configure hardware, but never to execute system
>> management jobs or things that involve policy or need error handling
>> like filesystem checking or mounting. Running such programs from udev
>> rules will block related events, and might render the entire system
>> unusable. To ensure timely event execution, udev forcefully kills all
>> programs it has executed from rules, and which take longer than 30 or
>> 60 seconds to finish, and mounting and checking disks can take much
>> longer than that.
> I don't expect mounting a disk (or getting an IP for that matter) will
> take longer longer than 30 seconds!

Reality might not always be what you expect. Mounting dumb filesystems
without fsck is broken, even filesystems which do no require it can
take that long in the kernel to get mounted. Many really large
filesystems can take very  long to mount.

>> Udev can send events to services which can act on device changes
>> though. An auto-mounter service can listen to block device events and
>> take the appropriate actions, such a service will not block udev's
>> operations for an unpredictable time. Udisks and systemd for example
>> work like that.
>> Mounting filesystems is just not simple enough to do that in udev, you
>> need a real service to do that properly. Udev rules are just not the
>> right tool for the job, and very likely never will be.
> Crikey. udisks & systemd has a crazy amount of deps and SLOC. Seriously?

Nobody said you need to use it. But you have to get the model right,
and that's certainly what they are doing.

Write your own that does only what you need, if you want; but do it
like they do, with a model that can reliably work, and does not do the
wrong thing like your udev hack.

> I think you guys need to please start sucking less.

I think you need to understand the problem before you pretend you have
solved it and push it to users. System management tasks are not as
easy as you think. What you do with udev here is a completely broken
hack which risks data loss for people who use your tool.

You can do that on your own box, nobody will object to that, but
please do not do that in tools you offer others to use. Other people
are far better of with the tools that people provide that 'suck too
much' in your eyes.

To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

[Linux DVB]     [Video Technology]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Devices]     [Fedora Women]     [ALSA Devel]     [Linux USB]

Add to Google Powered by Linux