System: Porteus 4.0rc4 i586.
Could be that this issue is valid for rc5 as well, so far have not managed to update my currently only used i586 (32 bit only) machine to rc5.
Since the swap partition on my Samsung Q40 (i586 machine, sadly no x86-64 on that one) is too small, and I don't want to change the geometry of most of the partitions on an almost full internal 60 GB hard drive (also quite small, but it teaches restraint. xD), I just created an swap file on a Linux ext3 partition and added it at boot time by adding
into /etc/rc.d/rc.local
But the priority of the two available swaps is not what I like:
Code: Select all
root@porteus:/# type sx
sx is a function
sx ()
{
echo $(date +%d.%m.%Y\ %H:%M:%S) ____________________________________________________________;
{
read firstLine;
echo "$firstLine";
while read f t s u p; do
let "s2 = $s / 1024";
let "u2 = $u / 1024";
printf '%-40s%-16s%-8s%-8s%-8s\n' $f $t $s2 $u2 $p;
done
} < /proc/swaps
}
root@porteus:/mnt/live/memory/images# sx
02.04.2018 07:35:36 ____________________________________________________________
Filename Type Size Used Priority
/mnt/sda3/linuxswap file 2047 257 -2
/dev/sda2 partition 949 0 -3
As you can see, I did not give any priority info when I swapon'ed /mnt/sda3/linuxswap. But the swap partition should, by default, have a higher priority than a swap file. Or not?
For some reason Porteus gave it an even lower priority.
Is that a bug? Or done by a reason I don't get?
To test this, I did a swapoff /mnt/sda3/linuxswap and lo and behold… Porteus changed the priority of the swap partition during the swapoff:
Code: Select all
root@porteus:/# sx
02.04.2018 07:36:02 ____________________________________________________________
Filename Type Size Used Priority
/mnt/sda3/linuxswap file 2047 33 -2
/dev/sda2 partition 949 41 -2
and kept that priority after the swapoff:
Code: Select all
root@porteus:/# sx
02.04.2018 07:36:18 ____________________________________________________________
Filename Type Size Used Priority
/dev/sda2 partition 949 52 -2
Seems, at least for now the only fix there is is to give the /mnt/sda3/linuxswap a lower priority, e.g. like so:
Code: Select all
swapon -vp -10 /mnt/sda3/linuxswap
But… that failed, kind of.
While doing the manual swapon, swapon gave no error message, nothing telling me that something with the given priority of "-10" was off:
Code: Select all
root@porteus:/# swapon -vp -10 /mnt/sda3/linuxswap
swapon: /mnt/sda3/linuxswap: found signature [pagesize=4096, signature=swap]
swapon: /mnt/sda3/linuxswap: pagesize=4096, swapsize=2147483648, devsize=2147483648
swapon /mnt/sda3/linuxswap
root@porteus:/# sx
02.04.2018 07:38:19 ____________________________________________________________
Filename Type Size Used Priority
/mnt/sda3/linuxswap file 2047 0 -3
/dev/sda2 partition 949 73 -2
As you can see… the swap partition kept its priority, and the swap file got a lower one. That`s how I want it, but without having to manually swapoff and swapon. But
the swap partition got not assigned the priority I told swapon to give it.
Now I would have to reboot [*] seeing how the entry of
Code: Select all
swapon -vp -10 /mnt/sda3/linuxswap
in /etc/rc.d/rc.local would work out, if that would result in the swap file having a lower priority than the swap partition, or not. And also, if at that time, during working on rc.local, swapon / Porteus would assign the priority I told it to, or again chooses something else. Like with the manual swapon as described above.
Why won't swapon (or Porteus?) assign the priority as I told it to? Why has the newly added swapfile priority of -3 instead of -10?
_________
[*] Prior rebooting I plan on being able to install rc5 on that machine… when the stuff I have to prepare today for Tuesday and Wednesday gives me the needed free time. Cannot say for now if that is so, or not.