1

An embedded Linux system I am working on has a 4MB ram disk. It is currently formatted with ext2. It seems that even when empty, there is only about 50% free space !

At the moment, it is used for about 50 smallish (1 or 2KB) files that total about 300KB.

Is there a better filing system to use in this case (FAT32?).

I can't make the ram disk any bigger. This system only has 512MB of RAM in total. It's running a very specific version of Debian from years ago, which also can't be changed.

Edit: This seems to be a different problem than I describe. I've just rebooted and when empty, the ram disk is only 1% full.

Neil
  • 11,059
  • 3
  • 31
  • 56

1 Answers1

3

There is the kernel builtin tmpfs that is optimized for this. It is fully POSIX compliant (and supports, e.g. sparse files).

An instance of tmpfs is usually mounted at /dev/shm.

You can mount an additional portion anywhere you want:

mount -t tmpfs -o size=2G none /tmp/myramdisk

Resize an existing mount:

mount -t tmpfs -o remount,size=6G none /tmp/myramdisk

Note that the size indicates a MAXIMUM size

sehe
  • 374,641
  • 47
  • 450
  • 633