[TriLUG] how to make an arbitrarily sized ramdisk?

rpjday rpjday at mindspring.com
Thu Oct 4 06:19:47 EDT 2001


On Wed, 3 Oct 2001, Donald Ball wrote:

> hey guys, i'm trying to allocate 64M of memory and mount it as a
> filesystem. i've gotten this far:
>
> mke2fs /dev/ram0
> mount /dev/ram0 /mnt/ramdisk
>
> but that just uses that 4M default ramdisk size. it would seem that you
> can change the size of a ramdisk like so:
>
> rdev -r /dev/ram0 65536
>
> but that doesn't change anything. any clues for me?

i messed with building ramdisks on the fly once upon a time and,
just from memory, what i did was:

# dd if=/dev/zero of=/dev/ram0 bs=1k count=4096

to allocate 4M on (in this case) /dev/ram0.  then,

# mke2fs /dev/ram0
# mount /dev/ram0 /mnt		(for instance)

the whole point of not using initrd was so i could build these
things as i needed them, and of different sizes (/dev/ram1, /dev/ram2,
and so on.)

however, i just tried this under seawolf and it *refuses* to let me
dd more than 4M.  i *swear* i used to be able to build >4M ramdisk
filesystems like this.  i'm going to have to go back through my
notes and see if i've done something differently.

also, when i did this, it wasn't clear if there is a single command
that will list my existing ramdisks.  is there one?  it also wasn't
clear how to free the ramdisk memory when i no longer needed it.

any clues? :-)

rday

-- 
Robert P. J. Day
Eno River Technologies, Durham NC
Unix, Linux and Open Source training


Microsoft:  Committed to putting the "backward" into "backward compatibility."




More information about the TriLUG mailing list