Subject: Re: Creating real Ram Disk
To: Jeff Arenberg <jeffa9999@yahoo.com>
From: Bill Studenmund <wrstuden@netbsd.org>
List: port-macppc
Date: 01/03/2002 16:31:29
On Wed, 2 Jan 2002, Jeff Arenberg wrote:
> I've read all the posts on the web and have found nothing that actually
> describes the exact steps to creating a ram disk with ffs. I am creating a
> pure RAM based system and I have configured a ram disk with the miniroot
> that gets inserted in the kernel, but now I want a second large (256MB) ram
> disk for file storage. I believe the order is something like:
There are two ways to do it. One is the one used for install kernels, the
other is used for scratch areas.
> 1. Mdconfig /dev/md0x size &
> 2. Something about creating disklabel
> 3. Something about newfs
> 4. Something about mount_mfs
>
> But I have no clue what the actual commands are for steps 2, 3 and 4.
> Everything I've tried yields an error. So for the record, can someone
> please list the steps with the correct commands.
For a scratch-space mfs, which is what it sounds like you want, all you
need is mount_mfs. Looking at the man page you will find it's the same
page as the one for newfs. :-)
The -s option is the one you want, and it sets the size of the file system
in sectors.
The name was chosen so that all you have to do is add a line in fstab for
a file system of type mfs, and the ramdisk gets created for you.
/dev/wd0b /tmp mfs rw,-s=20000 0 0
in fstab creates the /tmp directory on my system. It makes it 10 MB large.
Take care,
Bill