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 intended to appear as a mounted file system, but data is stored in volatile memory instead of 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. Increasing and decreasing the size is also possible.

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 set a limit to, an error message appear:

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

Resize swap memory size on CentOS 7 without reboot

Resize swap memory size on CentOS 7 without reboot

Silent KeePass Start with Database opening on Windows

Silent KeePass Start with Database opening on Windows

Comments