Page 1 of 1

Is it possible to change the size of ram file system that's created when using pmedia=usbflash?

Posted: Tue Dec 14, 2021 6:59 am
by mr_gs

I have installed a frugal fossapup64 9.5 in my 4GB sandisk pendrive. I have an encrypted save file which is about 3.1GB and has free space about 1GB. My system has 4GB of RAM.
When I am booting the OS with parameter pmedia=usbflash, it creates a 2GB ram file system and gives me option to save/not save the session during shutdown.
My question is:
Is it possible to edit the init script in such a way that the ram file system has a size equal to the free space in savefile? That is in my case rather than creating 2GB ram fs, I want to create a 1GB fs.


Re: Is it possible to change the size of ram file system that's created when using pmedia=usbflash?

Posted: Tue Dec 14, 2021 11:59 pm
by williams2

You can resize the maximum size limit of a tmpfs file system in ram, any time you like.
The size is just a limit. You can set the limit to any size you want.

For example, if you have 4G of ram, you can set the size to 8G.
you can't fill the tmpfs file system with 8G of data, of course.
df will tell you how much free space you have in the save file.

Code: Select all

# df -h /initrd/mnt/tmpfs
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           1.8G  849M  926M  48% /initrd/mnt/tmpfs
#
# mount -t tmpfs -o remount,size=8g tmpfs /initrd/mnt/tmpfs
#
# df -h /initrd/mnt/tmpfs
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           8.0G  850M  7.2G  11% /initrd/mnt/tmpfs
#