Porteus 5.0rc2 XFCE - Swap file with issues

Technical issues/questions of an intermediate or advanced nature.
Post Reply
User avatar
Arleson
White ninja
White ninja
Posts: 12
Joined: 20 Aug 2017, 18:51
Distribution: Porteus 5.0rc2 XFCE
Location: Brazil

Porteus 5.0rc2 XFCE - Swap file with issues

Post#1 by Arleson » 06 Sep 2020, 15:04

I created the script below in the rc.local file to automatically create a swap file for virtual memory that is located on an NTFS partition. It works, however precariously. My computer has 4GB RAM and, whenever the memory consumes 3700MB, the swap is sometimes not triggered. Most of the time the swap is triggered, but consuming a few megabytes, and the computer freezes or is almost inoperative due to lack of memory. I tested the swappiness at 100, and it doesn't seem to have changed ... What can I be doing wrong?

Code: Select all

# Swap Disk config
FILE="/mnt/sda4/Porteus.swap"

if [ ! -f "$FILE" ]
then
	/opt/porteus-scripts/mkfileswap $FILE 2048
	chmod 600 $FILE
	chown root:root $FILE
else
	/sbin/swapon $FILE 2>/dev/null
fi

echo 60 > /proc/sys/vm/swappiness

User avatar
Ed_P
Moderator
Moderator
Posts: 5700
Joined: 06 Feb 2013, 22:12
Distribution: 4.0 & 5.0rc2 Cinnamon 64 ISOs
Location: Western NY, USA

Porteus 5.0rc2 XFCE - Swap file with issues

Post#2 by Ed_P » 06 Sep 2020, 15:54

If the file doesn't exist you create it and if it does exist you activate it. But you don't activate it when you create it. Shouldn't your "else" be the "fi" and the current "fi" deleted?
Ed

User avatar
Arleson
White ninja
White ninja
Posts: 12
Joined: 20 Aug 2017, 18:51
Distribution: Porteus 5.0rc2 XFCE
Location: Brazil

Porteus 5.0rc2 XFCE - Swap file with issues

Post#3 by Arleson » 06 Sep 2020, 16:04

Ed_P wrote:
06 Sep 2020, 15:54
If the file doesn't exist you create it and if it does exist you activate it. But you don't activate it when you create it. Shouldn't your "else" be the "fi" and the current "fi" deleted?
When creating the swap, the file is automatically activated.

User avatar
babam
Samurai
Samurai
Posts: 133
Joined: 16 Nov 2016, 10:30
Distribution: Porteus Xfce 3.2.2
Location: Rainy city

Porteus 5.0rc2 XFCE - Swap file with issues

Post#4 by babam » 06 Sep 2020, 22:59

@Arleson,
Have you ever used swap file on NTFS partition in other distro (e.g. Ubuntu, Arch or whatever) and it has good performance.
Sorry, my English is bad.

User avatar
Arleson
White ninja
White ninja
Posts: 12
Joined: 20 Aug 2017, 18:51
Distribution: Porteus 5.0rc2 XFCE
Location: Brazil

Porteus 5.0rc2 XFCE - Swap file with issues

Post#5 by Arleson » 07 Sep 2020, 02:07

babam wrote:
06 Sep 2020, 22:59
Have you ever used swap file on NTFS partition in other distro (e.g. Ubuntu, Arch or whatever) and it has good performance.
No. The problem is not performance, but the correct work ...

User avatar
babam
Samurai
Samurai
Posts: 133
Joined: 16 Nov 2016, 10:30
Distribution: Porteus Xfce 3.2.2
Location: Rainy city

Porteus 5.0rc2 XFCE - Swap file with issues

Post#6 by babam » 07 Sep 2020, 02:29

Arleson wrote:
07 Sep 2020, 02:07

No. The problem is not performance, but the correct work ...
Is it working correctly on other distro?
Sorry, my English is bad.

User avatar
Arleson
White ninja
White ninja
Posts: 12
Joined: 20 Aug 2017, 18:51
Distribution: Porteus 5.0rc2 XFCE
Location: Brazil

Porteus 5.0rc2 XFCE - Swap file with issues

Post#7 by Arleson » 07 Sep 2020, 02:31

babam wrote:
07 Sep 2020, 02:29
Arleson wrote:
07 Sep 2020, 02:07

No. The problem is not performance, but the correct work ...
Is it working correctly on other distro?
I don't know ...

User avatar
Arleson
White ninja
White ninja
Posts: 12
Joined: 20 Aug 2017, 18:51
Distribution: Porteus 5.0rc2 XFCE
Location: Brazil

Porteus 5.0rc2 XFCE - Swap file with issues

Post#8 by Arleson » 08 Sep 2020, 00:50

The problem seems to have been solved with the boot in copy2ram. What would be the explanation for that? I am booting from a simple USB stick. :unknown:

Post Reply