Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: windundgeist on May 28, 2021, 02:19:03 PM
-
Hi
I could create a swapfile with the swapfile-tool. It is /mnt/sda4/tc.swp. I saw, that it is already activ. Means mkswap and swapon is done by the tool?
Now I would like to make it permanent on boot. Normaly this is in /etc/fstab with:
swapfile none swap defaults 0 0
Looks to me, as these is not ok for TC. What line I need to add?
Here my fstab:
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devpts /dev/pts devpts defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
/dev/zram0 swap swap defaults,noauto 0 0
/dev/sda4 /mnt/sda4 ext4 noauto,users,exec 0 0 # Added by TC
/dev/sda2 /mnt/sda2 ext4 noauto,users,exec 0 0 # Added by TC
/dev/sda3 /mnt/sda3 ext4 noauto,users,exec 0 0 # Added by TC
/dev/sda1 /mnt/sda1 ext4 noauto,users,exec 0 0 # Added by TC
/dev/sr0 /mnt/sr0 auto noauto,users,exec 0 0 # Added by TC
Then I like to set the swapiness. This is normally in /etc/sysctl.conf . But I can not find this file at this location.
So can you help me to do the right thing whit this in TC, please?
-
Hi windundgeist
... Now I would like to make it permanent on boot. ...
Try adding this boot code:
swapfile=sda4
... Then I like to set the swapiness. ...
You can use sysctl to view and change kernel parameters:
tc@E310:~$ sudo sysctl vm.swappiness
vm.swappiness = 60
tc@E310:~$ sudo sysctl -w vm.swappiness=70
vm.swappiness = 70
tc@E310:~$ sudo sysctl vm.swappiness
vm.swappiness = 70
-
@Rich
Boot code is working fine :) Tested some different swapiness with Vivaldi. But have better results on antiX with Opera. So I need Opera. Another "project" :) In antiX with swapiness 30-40 I can open 8 fb tabs and still go on working. I think with TC this will be even better.
Still don't found the right file to set swapiness permanent. sysctl.conf is not in etc. Is there another file? Or needs it also a boot code? Default is 60 I saw. But it is to high for my situation with hardware and my way to act in browsing.
Ok, tomorrow is another day :)
have a good night, Rich
-
Hi windundgeist
You could just add this to /opt/bootlocal.sh:
sysctl -w vm.swappiness=30
Since /opt/bootlocal.sh gets launched by root, it does not require sudo.
-
@Rich
Thank you, works fine. I was thinking that I could just create a sysctl.conf in /etc, if there is no. But then I found your answer first.
-
Hi windundgeist
You could do that. Then you also have to add that file to your backup. Then you need to add sysctl -p to bootlocal.sh.
-
Ok, so I will let is how it is in bootlocal.sh ;D