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

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
User avatar
mr_gs
Posts: 38
Joined: Tue Dec 14, 2021 6:39 am
Has thanked: 7 times
Been thanked: 8 times

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

Post 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.

Fossapup 9.5 64bit Kernel 5.4.53
Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
8GB RAM
Intel (R) UHD Graphics

williams2
Posts: 1062
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 305 times

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

Post 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
#
Post Reply

Return to “Users”