Re: [RFC] automount based devfs replacement

From: Erik Andersen (andersen@xmission.com)
Date: Mon Apr 17 2000 - 20:05:35 EST


On Mon Apr 17, 2000 at 08:26:34PM +0200, A. Haumer wrote:
>
[-------snip--------]
> On our diskless clients we boot from the network and mount our root-fs
> from a NFS server read-only. The system is still a fully functional
[-------snip--------]
>
> Before we had devfs we couldnīt really solve the problem of having
> writable devicefiles on a readonly filesystem.

You do not need devfs for this at all. Just do something like the following.
Takes 100k of ramdisk (could use much less if you trim your device list to only
the devices you really need):

    #!/bin/sh
    echo -n "Building device ramdisk: "
    SIZE=100
    INODES=1200
    dd if=/dev/zero of=/dev/ram1 bs=1k count=$SIZE > /dev/null 2>&1
    mkfs.minix -n30 -i $INODES /dev/ram1 $SIZE > /dev/null 2>&1
    mount /dev/ram1 /mnt -t minix -o rw > /dev/null 2>&1
    cp -a /dev/* /mnt > /dev/null 2>&1
    umount /dev/ram1 > /dev/null 2>&1
    mount /dev/ram1 /dev -t minix -o rw > /dev/null 2>&1
    echo "done."

Now you have a readonly root filesystem with writable devicefiles.
Apply similar methods to /tmp, /var, or wherever you need to write
stuff,

 -Erik

--
Erik B. Andersen   Web:    http://www.xmission.com/~andersen/ 
                   email:  andersee@debian.org
--This message was written using 73% post-consumer electrons--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:12 EST