On 2007/05/16 19:00, Jean-Yves Boisiaud wrote:
> Stuart Henderson wrote:
>> On 2007/05/16 11:33, Jean-Yves Boisiaud wrote:
>>> I want to limit write accesses on the compact flash, so I mounted / read 
>>> only, with the noatime option. /var is mounted in RAM.
>> Do you know that you need more than fstab(5) changes to mount / RO?
>>> Yes, I could create a mfs partition for /dev, but I think it is too 
>>> dangerous.
>> Works fine, you can use the -P flag to populate from another
>> directory. Copy MAKEDEV into that directory and run it to setup;
>> do the same at upgrade time. Also keep the existing /dev.
> I copied the /dev tree in /var/run/dev, which is detared from /var.tgz 
> during boot. Then I run :
>
> mount_mfs -i 256 -s 592 -P /var/run/dev swap /dev
>
> And it is ok.

With -current, those -i and -s values will give you

$ sudo mount_mfs -i 256 -s 592 swap /mnt
$ sudo df -i /mnt
Filesystem  1K-blocks      Used     Avail Capacity iused   ifree  %iused  
Mounted on
mfs:31139         151         1       143     1%       1     509     0%   /mnt

Same as if you specify -i 1024. I don't know if anything will change
in that regard between now and 4.2, but that's the way it is now.
(yes, I did discover this change on remote kit, but I already
had good remote console access available so it didn't involve 4
hours travel to fix :-)

Don't bother to keep -s super-small; memory is only used to hold
the files that have actually been written, it is not pre-allocated
to the mfs.

Your /dev seems to be missing something.. My production routers
look like this, with over 2x the number of inodes used:

$ grep /dev /etc/fstab
swap /dev mfs rw,nosuid,-s=4096,-i=1024,-P=/dev_src 0 0
$ df -i /mnt
Filesystem  1K-blocks      Used     Avail Capacity iused   ifree  %iused  
Mounted on
mfs:19099        1679        34      1562     2%    1350     952    59%   /dev

Reply via email to