Subject: Ramdisk?
To: None <port-arm32@netbsd.org>
From: Dave McConnell <davem@eastcoast.co.za>
List: port-arm32
Date: 11/18/1999 16:19:24
I have a efw questions, somewhat related.....

We need to run diskless, but for now I just wanted to create and mount a
ramdisk.

I built a kernel with an "md" configured in, the MFS defined,
MEMORY_DISK_HOOKS defined
and MEMORY_DISK_SIZE=8192.

On boot I get a message "md0: allocated 4096K (8192 blocks)"
(I guess from the code in md_hooks.c)
but, I can't seem to mount "md0".

If I try

# mount -t mfs -o -s=8192 /dev/md0 /mnt

I get:

mount_mfs: ioctl (GDINFO): Inappropriate ioctl for device
mount_mfs: /dev/md0: can't read disk label; disk type must be specified

If I try
#mount_mfs -T mdroot /dev/md0 /mnt

then it doesn't give an error, but doesn't mount anything either.

I have looked at "dev/md.c" and "dev/md.h" but they don't really give me a
clue....
(It suggests something called md_set_kmem() needs to be called, which I cant
find...??)

Also, what is the difference between defining: MEMORY_DISK_SIZE or
MINIROOTSIZE ?

I see the former is allocated dynamically from kernel VM while the former is
an array (which would grow the kernel size I guess) but why the difference?

I guess the MINIROOTSIZE is when you want to make the memory disk your
"root" filesystem (after injecting the files....) which I still want to get
to, but I'm confused by the intention of MEMORY_DISK_SIZE (if it is not to
simply allocate memory to a memory disk device which can be mounted?)

BTW, I have done
#mount -t mfs -o -s=16384 swap /mnt
and that works OK......but what about my "md" device?

Sorry, hope this is not too many questions.....:-)

Cheers
David