Re: /dev/root: which approach ? [PATCH]

From: Miquel van Smoorenburg
Date: Wed Mar 10 2004 - 15:22:51 EST

In article <20040310120145.248ae62d.akpm@xxxxxxxx>,
Andrew Morton <akpm@xxxxxxxx> wrote:
>Miquel van Smoorenburg <miquels@xxxxxxxxxx> wrote:
>> Currently if you boot from a blockdevice with a dynamically
>> allocated major number (such as LVM or partitionable raid),
>> there is no way to check the root filesystem. The root
>> fs is still read-only, so you cannot create a device node
>> anywhere to point fsck at.
>> This was discussed on the linux-raid mailinglist, and I proposed
>> (as proof of concept) a simple check in bdget() to see if the
>> device is being opened is the /dev/root node and if so redirect
>> it to the current root device. This is a 8-line patch, the only
>> disadvantage I can think of is that for an open file, inode->i_rdev
>> is then different from blockdevice->bd_dev.
>The /dev/root alias resolution looks nice to me, which probably means that
>it has a fatal flaw.
>Is it not possible to create a device node on ramfs or ramdisk and point
>fsck at that?

Yes, I thought of that too. But that wouldn't be trivial for
existing installations, unless you're the maintainer of the
distributions init package. Oh wait .. ;)

Anyway, it seemed to me to be very useful, and since /proc/mounts
already refers to /dev/root it seemed to fit in naturally hence
the proposed patches. If the definitive answer is "do it in
userspace" then that's OK too.


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