How to resize tmpfs without losing data

How to resize tmpfs without losing data

Definition from Wikipedia: tmpfs is a temporary file storage paradigm implemented in many Unix-like operating systems. It is designed to appear as a mounted file system, but the data is stored in volatile memory rather than on a persistent storage device. A similar construction is a RAM disk, which appears as a virtual disk drive and hosts a disk file system.

To resize tmpfs without lose any data, remount it instead of umount tmpfs and mount it again. It is also possible to increase or decrease the size.

The syntax:

mount -o remount,size=new_size /path/to/tmpfs

Real life examples:

mount -o remount,size=500M /tmp

mount -o remount,size=2G /var/log

If you have more data on tmpfs than you are trying to limit, you will get an error message:

mount point not mounted or bad option.

 

Get free $100 credit on DigitalOcean. Click here

Feriman

Feriman

I am passionate about helping individuals and businesses achieve greater efficiency and productivity through automation, optimization and utilizing technologies like Linux and Raspberry Pi. I believe that by streamlining processes and earning passive income, we can achieve financial freedom and live a better life. My goal is to share my knowledge and experience with you, and help you improve your workflows and increase your earning potential.

Related posts

Silent KeePass Start with Database opening on Windows

Silent KeePass Start with Database opening on Windows

Resize swap memory size on CentOS 7 without reboot

Resize swap memory size on CentOS 7 without reboot

Comments