Re: removable media revalidation - udev vs. devfs or static /dev

Éric Brunet
2004-01-08T10:33:11Z

In ens.mailing-lists.linux-kernel, you wrote:
> Exactly. It works today, because:
>
> - the device nodes are there.
>
> Ergo: udev should create the device nodes
>
> - the kernel autopartitions the device on any open (both main device and
> the subpartitions) when it notices a changed media. No polling
> required.
>
> Ergo: the kernel should continue to do this.

Maybe I don't understand the issues, maybe I am going to say something
stupid, but couldn't the problem be solved by adding an extra option to
mount, which would say: if device is a main device and no filesystem on
it, then try to open all subpartitions in turn till a filesystem is
found.

This way, I could just put in fstab
/dev/sda /mnt/media auto mymagicoption 0 0

mount first access sda, forcing a partition read. /dev/sda1 is created
by udev and mount finds it during its scan.

Complexity is in userspace. No polling, no extra device nodes. Policy is
in userspace (what should mount do when it finds two partitions ?
Creates subdirectories ? Fails ? Mount the first one ? The largest one ?
Just add as many mount options as you wish !). Plus it solves an extra
problem: I have zip disks with no partition tables (everything in
/dev/sda), and zip disks with filesystem sometimes in sda1, sometimes in
sda4. Right now, writing a fstab is difficult.

What did I miss ?

Éric Brunet