Increasing the Size of /media/root-rw
Increasing Temporary File System Size
When trying to install additional tools one will quickly find that the in-memory temporary file system fills up and things start breaking.
Base Environment
The basic file configuration of a Gold includes.
Filesystem Size Used Avail Use% Mounted on
...
tmpfs-root 200M 11M 190M 6% /media/root-rw
overlayroot 200M 11M 190M 6% /
...
Unfortunately, 200M is not a lot of space for a bunch of tools and other goodies.
Check how much memory there is. Plenty of free and swap memory.
pi@firewalla:$ free -h
total used free shared buff/cache available
Mem: 7.7G 1.4G 5.0G 261M 1.3G 5.8G
Swap: 3.9G 0B 3.9G
We doubled our memory to 8GB so your numbers will be different.
Expanding the File System Configuration
The mount command with the remount option enables increasing the size limit to the specified amount, 1GB in this example, of the reconfiguration of temp file systems.
pi@firewalla:$ sudo mount -o remount,size=1G /media/root-rw
Running df shows the increase to the directory.
pi@firewalla:$ df -h
Filesystem Size Used Avail Use% Mounted on
...
tmpfs-root 1.0G 180M 1.9G 18% /media/root-rw
overlayroot 1.0G 180M 1.9G 18% /
...
Supersize the File System Configuration
In our environment, even increasing the tmpfs to 2G was possible and worked well.
pi@firewalla:~$ sudo mount -o remount,size=2G /media/root-rw
pi@firewalla:~$ free -h
total used free shared buff/cache available
Mem: 7.7G 1.4G 5.0G 261M 1.3G 5.8G
Swap: 3.9G 0B 3.9G
pi@firewalla:~$ df -h
Filesystem Size Used Avail Use% Mounted on
...
tmpfs-root 2.0G 180M 1.9G 9% /media/root-rw
overlayroot 2.0G 180M 1.9G 9% /
...
Stress Testing
Loading up the Gold with lots of tools, applications, and commands now works when previously the tmpfs ran out of space.
sudo apt install speedtest-cli macchanger tshark hardinfo sysbench lm-sensors inxi rfkill inxi git build-essential -y
Even loading 561M of tools (remember the base tmpfs is only 200M) the swap space is still showing as unused.
pi@firewalla:~$ free -h
total used free shared buff/cache available
Mem: 7.7G 1.4G 4.4G 650M 1.9G 5.4G
Swap: 3.9G 0B 3.9G
Don't Forget
Remember, that as tmpfs is (wait for it ...) temporary file space, anything on the mount is lost on reboot.
-
Chris, you rock! Thank you for the detailed writeup.
Maybe I'm just completely clueless, but have you found a way to make an alias actually work?
I've tried editing .bashrc and creating a .bash_aliases but zero luck is having it actually work.
The use case is with NMON. I'm trying to launch NMON with specific flags.
I've edited .bashrc to include the following:
export nmon=cCmnd
I then log out and log back in via SSH, but it doesn't stick.
bks
Please sign in to leave a comment.
Comments
2 comments