HMI
Raspberry Pi 4 RAM disk

Walter Prechtl's picture
by Walter Prechtl last updated 26 November 2020

Frequent writing or overwriting of data negatively affects the lifespan of an SD card.

For applications that often use temporary data (e.g., sensor values for comparative calculations) that are no longer required after a restart, it is therefore advisable to write these to a RAM disk.

Another advantage of a RAM disk is that access (write and read) is much faster than with the SD card.

When equipping the Raspberry Pi 4 with RAM of 1 GB and upwards, it is not a problem to channel off 50 or 100 MB of this for a RAM disk.

To create a RAM disk, proceed as follows:

  • Create a mount point:

    sudo mkdir /mnt/ramdisk
    -Enter it in /etc/fstab, so that a RAM disk is automatically generated upon startup:
    sudo nano /etc/fstab
    tmpfs /mnt/ramdisk tmpfs nodev,nosuid,size=50M 0 0

    This allows you to save 50 MB of data to /mnt/ramdisk. After a restart, you can use

    sudo df -h
    to display whether the RAM disk was created successfully.

You might also be interested in:

  • Rotating a Raspberry Pi 4 Touch Monitor
  • Qt on the Raspberry Pi 4
  • Configure Qt-Creator on Ubuntu 20 LTS for Cross-Compiling
  • Products
    • Embedded HMI
    • Industrial Monitors
    • PCAP touch screen
    • Impactinator® glass
  • Design
  • Development
  • Manufacturing
  • Industries
embedded hmi HMI

embedded hmi

Professional solutions
We develop and produce high-quality professional embedded HMI systems for demanding customers and applications.
More information

Start your Project now

Our mission

We are specialists for customised embedded HMI solutions. We see ourselves as a system supplier and offer our customers individual, innovative and cost-optimised control units.

Blog

Click here for the blog

Haven't found the right thing yet?

Use the search function to conveniently search our website for your topic.
More than 5000 pages of specialist knowledge are waiting for you.

Imprint

  • Choose other language:
  • de
  • dk
  • en
  • fr
  • fi
  • nl
  • no
  • it
  • ru
  • pl
  • br
  • es
  • se
  • tr