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

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
JusGellin
Posts: 754
Joined: Fri Jan 19, 2024 11:12 pm
Has thanked: 90 times
Been thanked: 92 times

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

Post 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

Last edited by Flash on Thu Jan 30, 2025 3:56 am, edited 1 time in total.
Reason: Added "Solved" to subject line
User avatar
Flash
Moderator
Posts: 1003
Joined: Tue Dec 03, 2019 3:13 pm
Location: Arizona, U.S.
Has thanked: 56 times
Been thanked: 135 times

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

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

Chaos coordinator :?
JusGellin
Posts: 754
Joined: Fri Jan 19, 2024 11:12 pm
Has thanked: 90 times
Been thanked: 92 times

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

Post 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

User avatar
bigpup
Moderator
Posts: 7298
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 951 times
Been thanked: 1615 times

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

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

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

JusGellin
Posts: 754
Joined: Fri Jan 19, 2024 11:12 pm
Has thanked: 90 times
Been thanked: 92 times

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

Post 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

User avatar
rockedge
Site Admin
Posts: 6817
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2968 times
Been thanked: 2792 times
Contact:

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

Post 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

JusGellin
Posts: 754
Joined: Fri Jan 19, 2024 11:12 pm
Has thanked: 90 times
Been thanked: 92 times

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

Post 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

User avatar
Trapster
Posts: 201
Joined: Sat Aug 01, 2020 7:44 pm
Location: Texas
Has thanked: 1 time
Been thanked: 61 times

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

Post by Trapster »

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

JusGellin
Posts: 754
Joined: Fri Jan 19, 2024 11:12 pm
Has thanked: 90 times
Been thanked: 92 times

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

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

Post Reply

Return to “Users”