Page 1 of 1

How To Make a Swap Partition Run On Start UP? (Solved)

Posted: Wed Jan 29, 2025 1:26 am
by JusGellin

I've made a swap partition for BookwormPup64_10.0.9 and for KLV-vmHost.

I can enable them using swapon /dev/sdx (swap partition)
How can I make this permanent for a reboot?

Thanks


Re: How To Make a Swap Partition Run On Start UP?

Posted: Wed Jan 29, 2025 3:38 am
by Flash

Maybe it doesn't any more, but I think Puppy Linux used to look for a swap partition when it booted, and use it if it found it. Can you reboot and see if your Puppy OS is using the swap partition?


Re: How To Make a Swap Partition Run On Start UP?

Posted: Wed Jan 29, 2025 4:36 am
by JusGellin

@Flash
I just saw that a reboot for BW did make it use the swap partition.

Now I just need to make it work for the KLV.

Thanks


Re: How To Make a Swap Partition Run On Start UP?

Posted: Wed Jan 29, 2025 4:59 am
by bigpup

KLV

Are you sure it is not also seeing and using the swap when it boots?

That has been normal boot process operation in Linux for a very long time.


Re: How To Make a Swap Partition Run On Start UP?

Posted: Wed Jan 29, 2025 10:41 am
by JusGellin
bigpup wrote: Wed Jan 29, 2025 4:59 am

KLV

Are you sure it is not also seeing and using the swap when it boots?

That has been normal boot process operation in Linux for a very long time.

I have a 4G swap partition at sda3.
When I boot into KLV-vmHost and look for the swap I get this:

Code: Select all

# free -h
               total        used        free      shared  buff/cache   available
Mem:           3.6Gi       661Mi       2.6Gi        71Mi       639Mi       3.0Gi
Swap:             0B          0B          0B
# 

I have to turn it on to make it start working:

Code: Select all

# swapon /dev/sda3
# free -h
               total        used        free      shared  buff/cache   available
Mem:           3.6Gi       726Mi       2.6Gi        82Mi       677Mi       2.9Gi
Swap:          4.0Gi          0B       4.0Gi
#

Evidently it is supposed to just work?

Thanks


Re: How To Make a Swap Partition Run On Start UP?

Posted: Wed Jan 29, 2025 12:59 pm
by rockedge

@JusGellin

Copy the script /root/Startup/swapon from KLV-Airedale to the same location or write a script that does your swapon command in /root/Startup


Re: How To Make a Swap Partition Run On Start UP?

Posted: Wed Jan 29, 2025 2:30 pm
by JusGellin
rockedge wrote: Wed Jan 29, 2025 12:59 pm

@JusGellin

Copy the script /root/Startup/swapon from KLV-Airedale to the same location or write a script that does your swapon command in /root/Startup

The KLV-vmhost has the same as KLV-Airedale:
/root/Startup/start_swapper

in start_swapper:

Code: Select all

#!/bin/sh
#
swapper.sh

When I run this in KLV-vmhost, it says command not found
Running which swapper.sh shows it's missing /root/my-applications/bin, which KLV-Airedale has and where swapper.sh is found in both

also I can run the script swapper.sh which successfully starts the swap partition.

So how should the PATH be setup to include /root/my-applicatins/bin ?

Thanks


Re: How To Make a Swap Partition Run On Start UP?

Posted: Wed Jan 29, 2025 2:57 pm
by Trapster

I've always added the swapon command to /etc/rc.d/rc.local


Re: How To Make a Swap Partition Run On Start UP?

Posted: Wed Jan 29, 2025 4:06 pm
by JusGellin
Trapster wrote: Wed Jan 29, 2025 2:57 pm

I've always added the swapon command to /etc/rc.d/rc.local

Thanks, but since it has all the workings to normally do this I wanted to make it the same as other KLV's.

I finally found where the PATH was built so I could include /root/my-applications/bin
From KLV-Airedale, I found the PATHs where set up in /etc/profile file.
In the section #Set our default path (/usr/sbin::bin included for non-Void chroots)
I added appendpath '/root/my-applications/bin'

After a reboot, it now enables the swap partition.