Author Topic: Folder stored in RAM as TMPFS for changing files  (Read 2496 times)

Offline mihi

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Folder stored in RAM as TMPFS for changing files
« on: June 22, 2014, 07:15:10 pm »
Hi all,

I have Cubieboard2 with Lubuntu image on NAND. I have a script that is frequently updating a file. Since NAND memory is not quite suitable for such frequent changes (because of wear-out of the memory cells over time), I've created filesystem in RAM memory.

I created easy step by step guide: http://homecircuits.eu/blog/ubuntu-data-in-memory-disk/
needed comands:
Code: [Select]
mkdir -p /home/linaro/projects/memdisk
sudo chown linaro:linaro /home/linaro/projects/memdisk
sudo mount -t tmpfs -o size=10M,mode=0755 tmpfs /home/linaro/projects/memdisk

I used tmpfs and not ramfs. Tmpfs is using swap but cubieboard lubuntu image doesn't have swap, so you can't put more data than you specify.

I created 10MB tmpfs and did some test to put some more bytes to that folder. Without swap it was not possible. I'm ok with such behaviour so I'm sure that no data are stored on NAND.

Is there a better way to put such changing data in memory and not on NAND?
thanks,

mihi
« Last Edit: July 10, 2015, 06:53:53 pm by mihi »