I followed this post to create a ramdisk. After that, when I copy a file to the directory, the file was copied, but memory usage as shown in gnome-system-monitor does not increase. Also, I tried reading the copied file from that directory but the speed is still as slow as reading a disk file. What did I do wrong?


I was wrong and the ramdisk (with either tmpfs or ramfs) had the files in memory. The free -m command does show this, while the gnome-system-monitor will not show it. Also ramfs popup as a mounted drive in nautilus but tmpfs does not.

However, in my case I need to do chmod on the ramdisk folder before I can copy files in, even if the ramdisk mount folder is in my home directory.

up vote 0 down vote accepted

The post in question uses tmpfs, which means it uses a combination of ram and swap. You may want to look into ramfs instead as it only uses ram space. I would imagine the command is similar. You could also use ramdisk which creates a virtual device that you can apply a filesystem to and everything.


"tmpfs will use swap space when neccessary"

source = https://stackoverflow.com/questions/7242484/can-i-over-run-the-tmpfs-size

"If you compare it to ramfs (which was the template to create tmpfs) you gain swapping and limit checking."

source = www.kernel.org/doc/Documentation/filesystems/tmpfs.txt

"The memory used by tmpfs grows and shrinks to accommodate the files it contains and can be swapped out to swap space"

source = http://en.wikipedia.org/wiki/Tmpfs

"Tmpfs uses swap, where as Ramfs doesn't."

source = What is the difference between tmpfs and ramfs

  • Thank you! I tried mount -t ramfs -o size=5120M ramfs /media/ramdisk/ but it does not do anything. – shaoyl85 Mar 23 '14 at 3:46
  • I believe you need to drop the trailing backslash "mount -t ramfs -o size=512m ramfs /media/ramdisk" – mungo Mar 23 '14 at 3:49
  • I tried it and it does not work either... – shaoyl85 Mar 23 '14 at 3:52
  • "sudo mount -t ramfs -o size=20m ramfs /home/example/ram" works for me. Shows up as mounted in nautilus. You are using an existing directory right? – mungo Mar 23 '14 at 4:00
  • It works but in my case I believe it is still using the disk spaces rather than the memory because when I copy a large file into the directory, the memory usage does not increase accordingly. – shaoyl85 Mar 23 '14 at 4:11

In response to your edit you don't need to chmod to copy files to the ramfs, just use gksu nautilus to open nautilus as root then right click on the ramfs mounted folder and change the user permissions to allow your user full permissions. Then you can happily write files to it as a regular user no sudoing required.

  • Thank you, but this is the same as doing sudo chmod on the folder right? I found that every time I do sudo mount to mount the drive, the folder becomes unable to write and I need to chmod or do what you just mentioned again. – shaoyl85 Mar 23 '14 at 20:46

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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