[BusyBox] Booting from Compact Flash, using ramdisk

vda vda at port.imtp.ilyichevsk.odessa.ua
Wed Mar 10 06:55:28 UTC 2004


On Tuesday 09 March 2004 22:21, Wayne Gowcher wrote:
> Hi,
>
> I'm not 100% sure if this is the right forum to ask
> this question, so if it is not I apologise in advance.
>
> I have an embedded linux system that is booting from
> compact flash, where the file system is mounted read
> write. Everything is OK if the user shuts down the box
> in an orderly fashion, but if they just hit the off
> switch ( which they are likely to do ) file corruption
> seems to ensue.
>
> So to get around this I would like to mount the
> compact flash read only and then use ramdisk(s) to
> hold the stuff that needs to be read write. At the
> moment my system is :
>    1, filsesystem mounted ro.
>    2, ramdisks created for /dev /tmp /var /etc and
> contents of filesystem copied to these 4 ramdisks.
>    These ramdisks are mounted over ro directories /dev
> /tmp /var /etc.
>
> This seems to work but I think it's a bit messy. What
> I would really like to do is create one ramdisk, copy
> /dev /etc/ /tmp /var across to that ram disk and then
> mount it at the " / " directory. But this doesn't seem
> to work. It seems you can't mount other directories
> over " / ", you can only mount to a sub directory (
> anyone know if this is true or not ? )
>
> So my question to the group is :
>
> does anyone know how to mount one ramdisk having /dev
> /etc /tmp /var in it, and all other dirs are read only
> from thr compact flash ?
>
> Is there any other way of doing this ?

Yes.
Make *one* ramdisk, or better yet, tmpfs, and mount it
on, say, /.volatile.

/dev /etc /tmp /var should be symlinked to
/.volatile/etc etc
--
vda



More information about the busybox mailing list