Re: [Soekris] Smallest possible MFS /dev on OpenBSD

2008-01-21 Thread Stuart Henderson
On 2008/01/21 12:18, Jean-Yves Boisiaud wrote:
 there is no typo, but I forgot to tell that the system I use was old :
 
 uname -a
 OpenBSD xx 3.8 GENERIC#138 i386
 
 and
 
 mount_mfs -i 256 -s 592 -P /var/run/dev swap /dev

http://marc.info/?l=openbsd-miscm=120086358424135w=2 explains why
this doesn't work the same way in 4.2 and suggests an alternative.

___
Soekris-tech mailing list
Soekris-tech@lists.soekris.com
http://lists.soekris.com/mailman/listinfo/soekris-tech


Re: [Soekris] Smallest possible MFS /dev on OpenBSD

2008-01-18 Thread Bill Maas
On Tue, 2008-01-15 at 14:56 +0200, Lars Noodén wrote:
 I've got OpenBSD 4.2 on a net4801 and am mounting /dev in RAM.  I'd like
 to reduce the amount of memory used even further.  Currently only %4 is
 used:
   Filesystem SizeUsed   Avail Capacity  Mounted on
   mfs:21800  853K   34.0K777K 4%/dev
 
 What should I be aware of in /etc/fstab to minimize the memory footprint
 of /dev?  Currently, I have:
   swap /dev mfs rw,-P/dev.base,-i1,-s2300,-c264,-m5,nosuid 0 0

Couldn't resist .. here's ho far I got after about 45 mins. of testing:

# mount_mfs -s 512 -b 32768 -f 32768 -P/var/dev -o nosuid
swap /mnt/test/

# df /mnt/test
Filesystem  512-blocks  Used Avail Capacity  Mounted on
mfs:17962  192   1286467%/mnt/test/

# df -h /mnt/test
Filesystem SizeUsed   Avail Capacity  Mounted on
mfs:17962 96.0K   64.0K   32.0K67%/mnt/test/

Note: '-i' option is ignored here - it doesn't make any noticeable
difference at all. Block and fragment size seem to be the issues here.
With these set to the defaults, I never got past 13%. You would only
need to change the default bpi if you run out of inodes. Maintaining
fragments appears to be pretty disk-intensive, I suspect that if
(blk_siz == frag_siz (or whatever)) then it's turned off altogether.

I couldn't reproduce Jean-Yves' 23.0K (mount_mfs -i 256 -s 592
-P /var/run/dev swap /dev):

# mount_mfs -i 256 -s 512 -P/var/dev -o nosuid swap /mnt/test

# df -h /mnt/test
mfs:29060  143K   15.0K121K11%/mnt/test

I suspect that the '-s' value 592 was a typo, since it was rejected over
here:
mount_mfs: reduced number of fragments per cylinder group from 72 to 64
to enlarge last cylinder group
mount_mfs: inode table does not fit in cylinder group

I can't find any hard data - apart from claims and statements - about
dynamic growth (nor shrinkage!) of the MFS partition, but should any
process hijack /dev e.g. as it's temp dir, then 96K (or 23, if
possible), should be a significant improvement over the 853K in Lars'
original posting, even if it's only a max. value.


Bill

-- 
What's a computer? - MES

___
Soekris-tech mailing list
Soekris-tech@lists.soekris.com
http://lists.soekris.com/mailman/listinfo/soekris-tech


Re: [Soekris] Smallest possible MFS /dev on OpenBSD

2008-01-16 Thread Jean-Yves Boisiaud
  I've got OpenBSD 4.2 on a net4801 and am mounting /dev in RAM.
  I'd like
  to reduce the amount of memory used even further.
  Currently only %4 is
  used:
   Filesystem SizeUsed   Avail Capacity  Mounted on
   mfs:21800  853K   34.0K777K 4%/dev
 
  What should I be aware of in /etc/fstab to minimize the memory
  footprint of /dev?  Currently, I have:
   swap /dev mfs rw,-P/dev.base,-i1,-s2300,-c264,-m5,nosuid 0 0

I think that ramfs is dynamic, ie physical memory is not reserved during 
mount_mfs execution.

To reduce the /dev memory fs space :
- you can reduce the inodes density with -i. Default is one inode for 
8196 bytes.
- delete unused devices.

Here is the command I use on my Soekris targets :
# mount_mfs -i 256 -s 592 -P /var/run/dev swap /dev

And the result is :
# df -h /dev
Filesystem SizeUsed   Avail Capacity  Mounted on
mfs:31196 23.0K6.0K   16.0K27%/dev

Number of files in /dev:
# ls /dev | wc -l
307

 
  Random changes to mfs' parameters aren't getting me anywhere.  There
  should be a rational way of arriving at optimal settings for mfs:
 
  -b block-size
  -c fragments-per-cylinder-group
  -f frag-size
  -i bytes
  -m free-space
  -s size
___
Soekris-tech mailing list
Soekris-tech@lists.soekris.com
http://lists.soekris.com/mailman/listinfo/soekris-tech


Re: [Soekris] Smallest possible MFS /dev on OpenBSD

2008-01-16 Thread Lars Noodén
Jean-Yves Boisiaud wrote:
 ...
 To reduce the /dev memory fs space ...
 - delete unused devices.

What is the safest or most efficient method to go about doing that?

Would the output from dmassage -t be useful there?

Regards,
-Lars
___
Soekris-tech mailing list
Soekris-tech@lists.soekris.com
http://lists.soekris.com/mailman/listinfo/soekris-tech


Re: [Soekris] Smallest possible MFS /dev on OpenBSD

2008-01-16 Thread Stuart Henderson
On 2008/01/16 17:43, Lars Noodén wrote:
 Jean-Yves Boisiaud wrote:
  ...
  To reduce the /dev memory fs space ...
  - delete unused devices.

# du -h /dev 
1.0K/dev/fd
34.0K   /dev

 What is the safest or most efficient method to go about doing that?

The safest and most efficient method is to leave it alone.
If you have a real problem with RAM use, there's probably some
easier and safer way to fix it than shaving off kilobytes here.
But if you're not at that point, why worry? :-)

___
Soekris-tech mailing list
Soekris-tech@lists.soekris.com
http://lists.soekris.com/mailman/listinfo/soekris-tech


Re: [Soekris] Smallest possible MFS /dev on OpenBSD

2008-01-16 Thread Arnaud Feix

Lars Noodén a écrit :

I've got OpenBSD 4.2 on a net4801 and am mounting /dev in RAM.  I'd like
to reduce the amount of memory used even further.  Currently only %4 is
used:
Filesystem SizeUsed   Avail Capacity  Mounted on
mfs:21800  853K   34.0K777K 4%/dev

What should I be aware of in /etc/fstab to minimize the memory footprint
of /dev?  Currently, I have:
swap /dev mfs rw,-P/dev.base,-i1,-s2300,-c264,-m5,nosuid 0 0

Random changes to mfs' parameters aren't getting me anywhere.  There
should be a rational way of arriving at optimal settings for mfs:

 -b block-size
 -c fragments-per-cylinder-group
 -f frag-size
 -i bytes
 -m free-space
 -s size

Regards,
-Lars
  
I have been trying -s1024 but it wont mount I think this is the smallest 
footprint you can have.

But if you find smaller I'm interrested.

Regards






smime.p7s
Description: S/MIME Cryptographic Signature
___
Soekris-tech mailing list
Soekris-tech@lists.soekris.com
http://lists.soekris.com/mailman/listinfo/soekris-tech