Subject: Re: mounting a large mfs partition
To: None <netbsd-help@netbsd.org>
From: Marshall Rose <mrose+mtr.netnews@dbc.mtview.ca.us>
List: netbsd-help
Date: 01/03/2003 14:22:35
> hi. i've got a lot of memory on one of my systems, so i want to put up a 1GB
> memory file system.
>
> if i put this line in /etc/fstab
>
> swap /big mfs rw,-s=1g 0 0
>
> then when i mount it, i get:
>
> # mount /big
> Warning: inode blocks/cyl group (141) >= data blocks (29) in last
> cylinder group. This implies 470 sector(s) cannot be allocated.
>
> and i get a file system with about 124MB, e.g.,
>
> # df -k /big
> Filesystem 1K-blocks Used Avail Capacity Mounted on
> mfs:13118 127495 1 121119 0% /big
>
> so, what am i doing wrong?
well, after consulting the source tree, here's the story: mount_mfs is a link to
newfs. when invoked as mount_mfs, the program looks at the RLIMIT_DATA to
determine how large it can make a memory-based filesystem, and, if it doesn't
have enough memory, then it silently reduces the request to something it can
manage.
on my 1.6 system, "ulimit -d" reports 131204KB.
this is perfectly reasonable except for the "silently" part, mount_mfs should
either warn or error.
so, here's my follow-up question: my gut reaction to fixing this is to:
1. rename mount_mfs to mount_mfs2 (you need "mfs" in the filename for
newfs to go into mount_mfs mode)
2. create a three line shell script as mount_mfs:
#!/bin/sh
ulimit -d unlimited
mount_mfs2 "$@"
can someone suggest a better fix.
/mtr