copy from
Tmpfs stands for Temporary File System.
To create files inside a tmpfs-mounted folder means that they will disappear when you shutdown your PC or unmount the folder.
How to create a tmpfs folder?
First, create a folder to use as a mount point.
mkdir [foldername]
![](https://miro.medium.com/v2/resize:fit:700/1*v6ygxowBD_olpeqh3Y_CXA.png)
Then, transform it into a tmpfs folder.
sudo mount -t tmpfs -o size=[desiredSize] tmpfs [folderPath]
![](https://miro.medium.com/v2/resize:fit:700/1*PJ30TbxCQRcINvowbauLtQ.png)
Now, we can check if everything is fine with df command.
df -lh
![](https://miro.medium.com/v2/resize:fit:700/1*DMY1-XKzg9sxdhtu2A05mA.png)
We have created a folder mounted into RAM. Its size is 512MB, but it can be easily modified.
You can wish to mount a folder to RAM during boot.
To do so, we edit the /etc/fstab file. We need root access.
sudo nano /etc/fstab
![](https://miro.medium.com/v2/resize:fit:700/1*ECUiWgQT7AcExv_kJHZ4Hw.png)
In the /etc/fstab file, just add the keyword tmpfs into the left column, write the mount point, tmpfs again, some options like defaults, noatime, size=512M. Zero and Zero for dump and pass will be fine.
![](https://miro.medium.com/v2/resize:fit:700/1*pv_U35jBEgE2g-RNYAVtig.png)
If you are using nano, save the file using CTRL+O, then close the editor pressing CTRL+X.
Now you can reboot and enjoy your new tmpfs folders!