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

From: Éric Brunet
Date: Thu Jan 08 2004 - 05:34:13 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/