The issue, also even when zram is set to priority 100 after the first boot, it is still setup in the fstab as priority of 0, and gets reset to 0 and need to edit that every time after a wakeup.
I use 2 swaps, one is the zram, the other (when the machine has an internal hard disk), usually the first partition of the internal hardisk is a Linux swap.
Another issue, this might be due to the unusual setup of my internal hard disk.
The fstab after bootup looks messed up:
Code: Select all
/dev/sda1 none swap sw,pri=1 0 0
/dev/sda2 /mnt/sda2 ext3 comment=x-gvfs-show,user,noatime,nodiratime,suid,dev,ex
/dev/sda1 none swap sw,pri=1 0 0
/dev/sda1 none swap sw,pri=1 0 0
/dev/sda3 /mnt/sda3 ntfs-3g comment=x-gvfs-show,user,noatime,nodiratime,suid,dev
Since it is all messed up, first I have to delete all the wrong double entries of /dev/sda1 none swap sw,pri=1 0 0 after every boot.
And I need to edit fstab after every wakeup after a suspend, and change /dev/zram0 none swap sw,pri=1 0 0 to /dev/zram0 none swap sw,pri=100 0 0
Is there a way to get Porteus to set the fstab without multiple entries of sda1 swap, and to have the priority of zram set to the value it gets initialised with?
_______________________
The rest is the old post, new replies can ignore all the rest.
Now, every time the 3.1 x86-64 Porteus (XFCe) resumes from suspend, all the swap is gone, as can be seen via "swap -s" or "free":
Code: Select all
root@porteus:/tmp# free
total used free shared buffers cached
Mem: 3474856 3279540 195316 0 292412 713340
-/+ buffers/cache: 2273788 1201068
Swap: 0 0 0
root@porteus:/tmp# swapon -s
Filename Type Size Used Priority
root@porteus:/tmp# grep " swap " /etc/fstab
/dev/sda1 none swap sw,pri=1 0 0
/dev/zram0 none swap sw,pri=1 0 0
But, at boot time, the zram swap got configured like so:
Code: Select all
# /etc/fstab:
# Hotplugged devices:
/dev/zram0 none swap sw,pri=100 0 0
Code: Select all
# Hotplugged devices:
/dev/zram0 none swap sw,pri=1 0 0
Is there a trick that fixes the /etc/fstab resets priority of zram (from pri=0 to pri=100), or best keeps it at the boot level, with "pri=100,0,0"
Also is there an easy and reliable way to auto-activate the swap, aka run "swapon -a" after resume? But only after the /etc/fstab zram priority got fixed.
_____________________________________
Sometimes when suspending, after I wake up the machine I realize that zram swap not got switched off, as in: is still active as zram swap. While at other times (that is: most of the time) it got swapoff'ed. Usually the hard disk swap gets swapoff'ed every time.
My guess on that matter is that the system needs the free ram (therefore freeing RAM by swapoff the zram swap) for the RAM it needs for suspend.
And that's all fine and okay, I have no issue with Port deactivating the swap prior switching the machine "Off" (=going into suspend)
But I do have an issue with changing the priority of the zram entry in /etc/fstab.
There should be a solution that keeps the original zram swap entry, or one that restores the correct priority of zram, cause it needs to have higher priority than harddisk based swap.