md /tmp mfs rw,-s64m 0 0 in fstab instead of tmpmfs="YES" in rc.conf: no panic

Ronald Klop ronald-freebsd8 at klop.yi.org
Wed Nov 10 14:53:39 PST 2004


On Wed, 10 Nov 2004 11:41:32 +0300,  
<ls+lists.freebsd.org.mailman.listinfo.freebsd-stable93930659 at gambit.com.ru>  
wrote:

>>>>> This host has 192 MB of RAM and 512 MB of swap.
>>>>> 	/sbin/mdmfs -i 4096 -s $1    md $2
>
>>> Kris Kennaway wrote:
>>>> You don't have enough RAM in your system to do that.
>>> I'm running mdmfs WITHOUT "-M" flag.
>
> Ronald Klop wrote:
>> Just set up your tmp from fstab with "md /tmp mfs rw,-s64m 0 0".
>
> 	Swap space is actually used in this case, thank you!
>
>> If you look at the code which handles tmpmfs it is used for diskless  
>> booting.
>
> 	"By default, mdmfs creates a swap-based (MD_SWAP) disk" -- from  
> mdmfs(8).
>
>> So there is no swap usable for ramdisk.
>
> 	Should I send-pr a bug in mdmfs(8)?

Maybe I'm missing something, but tmpmfs works malloc-based by default.
tmpmfs is not an easy way to set up a swap-based ramdisk. It is meant to  
setup diskless systems easily.

# cd /etc/rc.d
# grep -A 2 tmpmfs *
tmp:case "${tmpmfs}" in
tmp-[Yy][Ee][Ss])
tmp-    mount_md ${tmpsize} /tmp
# grep -A 2 mount_md *
initdiskless:mount_md() {
initdiskless-    /sbin/mdmfs -i 4096 -s $1 -M md $2
initdiskless-}

Ronald.

-- 
  Ronald Klop, Amsterdam, The Netherlands


More information about the freebsd-stable mailing list