mount ramdisk rootfs /etc directory to jffs2 filesystem.

Ricard Wanderlof ricard.wanderlof at axis.com
Tue Jan 19 08:17:22 EST 2010


On Tue, 19 Jan 2010, Johnny Hung wrote:

> Okay, I think the steps is below if my rootfs is ramdisk and configure
> files in jffs2,
>
> 1. cp /etc/* /mnt/mtd/etc/    (/mnt/mtd is my jffs2 fs)
> 2. rm -rf /etc/*
> 3. make symbolic links from all /etc/xx to /mnt/mtd/etc/xxx
> 4. remake ramdisk rootfs
>
> It seems all files in ramdisk rootfs /etc all links to /mnt/mtd/etc/
> and try to modify these files is effective after reboot.
> But is this a common way in embedded linux ?

In principle, but it is easier (and cleaner) to make a symbolic link from 
(say) /etc -> /mnt/mtd/etc without linking every individual file and 
directory.

You could also use a jffs2 file system in flash for your rootfs, that way 
you wouldn't need a ramdisk at all.

/Ricard
-- 
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30



More information about the linux-mtd mailing list