Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 6 down vote accepted

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.

share|improve this answer
Because I had no idea it existed. What a great feature. Many thanks – David Sykes Jan 3 '13 at 19:12

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
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.