Subject: Re: Help with memory disk
To: None <roberto@redix.it>
From: Frederick Bruckman <fredb@immanent.net>
List: netbsd-help
Date: 05/16/2003 10:27:52
On Fri, 16 May 2003 roberto@redix.it wrote:

> I'd like to setup several memory disk (ramdisk), but I did not find any
> helpful info on the docs (sorry).
> I'd like to know:
>  - what are the kernel options to enable ramdisk?;
>  - which are device files I need?;

The ramdisk needs "pseudo-device md 1" (or > 1), and "/dev/md0a"  and
"/dev/md0d" for one ramdisk; you could do "cd /dev; sh MAKEDEV md1" to
support a second (and so on).

>  - what command to create, mk file sys. and mount?
>
> P.S.: All I've found is for FreeBsd but seems to me inapplicable to NetBsd:
>  mknod /dev/ad0a c 116 0
>  mknod /dev/ad0c c 116 2
>  disklabel -e /dev/ad0c and define a partition a: type 4.2BSD
>  disklabel -B -r /dev/ad0c
>  newfs /dev/ad0a
>  mount /dev/ad0a /memory_fs

The "/dev/MAKEDEV" script does the first two steps (or not, if you
only need one ramdisk), then you'd need to run "mdconfig(8)". (See
also "md(4)".) The rest should be about the same. I've never tried it.

The release build uses "makefs(8)" and "mdsetimage(8)" to create a
file system image and install it into the kernel, which is how the
install disks manage to boot from a ramdisk. If that's what you're
trying to do -- make a bootable image -- you might be able to usurp
the release building mechanism in "/usr/src/distrib/i386/floppies".

Frederick