In Debian Wheezy If I make a ram disk with
mke2fs -m 0 /dev/ram0
mount /dev/ram0 /mnt/ramdisk
I get a ram disk 3.9M in size. I could really do with 16M, is there a way of making the ram disk bigger?
You can for example create a ramdisk with 8MB size like so mkfs -q /dev/ram1 8192
. So you just have to put the size of the ramdisk as the last parameter to mkfs.
But why didn't you think about using tmpfs? tmpfs is great because it is capable of using swap and the memory is dynamically allocated.
You can create a tmpfs like that: mount -t tmpfs -o size=16M,mode=700 tmpfs /data/tmpfs
.
For more information take a look at the "Mount options for tmpfs" in man mount
.
try this one: http://naze.mine.nu/?p=409
Create a mount point , for example /mnt/vmtmpfs:
mkdir /mnt/vmtmpfs
Change rights on this directory (according to what you want to do):
chmod 777 /mnt/vmtmpfs
Now mount it and precise it’s size:
mount -t tmpfs -o size=1024M tmpfs /mnt/vmtmpfs
To have it automatically created at startup, edit /etc/fstab and add :
tmpfs /mnt/vmtmpfs tmpfs defaults,size=1g 0 0