Subject: Re: Changed mount_mfs behavior?
To: Andrew Cagney <cagney@mac.com>
From: Greg A. Woods <woods@weird.com>
List: current-users
Date: 09/20/2002 18:36:06
[ On Friday, September 20, 2002 at 14:10:03 (-0400), Andrew Cagney wrote: ]
> Subject: Re: Changed mount_mfs behavior?
>
> (the behavour depends on the userland mount command not the kernel).  It 
> changed between 1.5x and 1.6x.  The old man page read:
> 
> The parameters to mount_mfs are the same as those to newfs.  If the -T 
> flag is specified
> (see below), the special file is unused.  Otherwise, it is only used to
> read the disk label which provides a set of configuration parameters for
> the memory based file system.  The special file is typically that of the
> first swap area, since that is where the file system will be backed up
> when free memory gets low and the memory supporting the file system has
> to be paged.  If the keyword ``swap'' is used instead of a special file
> name, default configuration parameters will be used.  (This option is
> useful when trying to use mount_mfs on a machine without any disks).

IMNSHO that wasn't a terribly "smart" default.  The MFS for /tmp should
probably be somewhat smaller than the available swap size, and using the
swap size of one partition in one disklabel when you've got many swap
partitions is equally unhelpful since it's probably smaller than you
want.  Even worse I don't recall any default for the size for "swap"
being given either.

> Yes, some trial and error and I found similar can be added to fstab.  An 
> example of how ``-'' options can be used in fstab would be useful.

This is indicative of the complete lack of useful examples in fstab(5)
and many other similar manual pages!  :-)

Here's what I generally use (varying the value of -s for different
machines as appropriate, of course):

	swap /tmp mfs rw,nodev,nosuid,async,-s=512000 0 0

Note though that it's /sbin/mount which generally reads /etc/fstab and
which invokes the underlying mount_* programs given what it reads and
what it's told to do on its own command-line.  There is an explicit
example of including '-s' for MFS in mount(8).

> Anyway, having to manually specify the file system size is a pain.

You have to specify the MFS filesystem size somewhere -- whether you do
so by specifying a partition to indicate its size from its disklabel, or
you specify it explicitly, or by writing a custom /etc/disktab entry,
what's the difference?  It seems best to me that the size be given very
explicitly right in /etc/fstab where one will no doubt have to look
first for such a parameter anyway.

-- 
								Greg A. Woods

+1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>