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

Olaf Hering
2004-01-07T20:53:05Z

On Wed, Jan 07, Linus Torvalds wrote:

>
>
> On Fri, 2 Jan 2004, Greg KH wrote:
> >
> > Doesn't the kernel always create the main block device for this device?
> > If so, udev will catch that.
>
> But udev should probably also create all the sub-nodes if it doesn't
> already.
>
> And it really has to create _all_ of them, exactly because there's no way
> to know ahead-of-time which of them will be available.
>
> Then, user space can just access "/dev/sda1" or whatever, and the act of
> accessing it will force the re-scan.

How would that work? I mean, what will a tool that cares about a block
event do? It will run a fdisk/parted -l /udev/sda to figure out what partitions
are there (just to skip an extended partition sda5, as example) and
finds no media. That tool will never run again on sda, unless a new
block add event comes in. So some sort of polling is required for that
class of devices.

If we create sda1 - sda15, you mean a mount /udev/sda15 /mnt is supposed
to fail with -ENODEV instead of -ENOENT?

--
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG