Did you run the mkswap command on each of those partitions when you created them? If not properly formatted they could not be used as swap.
After creating the partitions and formatting them as swap did you use the swapon command for each partition to initialize usage? Testing the proper function is always a good thing before making it automatic.
Looking through the man pages for mount, swapon, & fstab I did not find an option sw anywhere. It may be that removing that option from fstab for those 2 partitions will solve the issue.
What is the output of lsblk -f?
That should show the partitions as swap if formatted as such.
Twice I’ve manually mounted the swap partitions using the ‘swapon’ command after the system was up and running nominally. And they both seem to mount fine when I do; that is to say that I saw no errors. But I did not verify that the manually mounted swap partitions were ever used (I’m not sure how to do that).
I just manually mounted the swap partitions again in order to post the results here.
Actually, I’m not sure what the ‘sw’ mount options are. To be honest, I read a lot of web pages when trying to get the /etc/fstab entry correct. But it’s quite possible that these are old mount options or they’re for another version of Linux.
I just had another thought.
Swap is not a file system, so it seems possible that using LABEL=… in fstab may be a factor.
How about trying to change one of those to the actual device name in fstab and reboot to see of it makes a difference.
For example change the line reading LABEL=disk2s4 and replace it with /dev/sdb4.
If that makes it work then swap both of them to use the device names instead of the LABEL.
You can use partition labels in fstab
swap partions are not actually mounted as you would filesystem. Swap is a char device where filesystems are block devices
You can check if swap is actually configured after a reboot simply by typing swapon -v … if it shows your labled swap devices, you’re good to go … otherwise … double-check your fstab (you can’t use <TABS> as white-space in fstab, need to be space chars … by the way … been bit by this a few times LOL)
correct.
Partition labels → good
File system labels → not good
Both are available and care must be taken to ensure using the PARTLABEL and not some other label. The partition uuid is also quite useful for that.
lsblk -o PARTUUID PARTLABEL \<device> should give the desired information.
However, when I used that on my machine, to read the data from my /boot partition (ext4) I get this
$ lsblk -o PARTUUID PARTLABEL /dev/nvme0n1p2
lsblk: PARTLABEL: not a block device
PARTUUID
a5786a20-ca2c-4c12-938b-080445076d51
I don’t know if that is because the partition was not labeled or for some other reason. I would assume that it would tell me there was no label if it were just a missing label.
If I understood you correctly (in your reply to Jeff (@computersavvy ) you are saying that I need a file system label, correct? The LABEL column is the label for the file system, whereas the PARTLABEL column is the label for the partition?
OK, just started reading the 'mkswap; man page. The man page option “-L” (“–label label”) says
Specify a label for the device, to allow swapon(8) by label.
Is this label the file system label? I am also reviewing the ‘parted’ man page and don’t see a command to assign a name to the file system… which makes sense since ‘parted’ is for partitioning, not creating file systems.
No, that’s the partition label … swap has no file system, it’s a raw character device
mkswap -L disk1s4 /dev/sda4
Tells mkswap to configure partition sda4 as swap (basically fills the partition with zeros), set the partition type to 0x82 then Label the partition disk1s4
I will next read the man pages in detail to assign priority to the swap areas. I want to use the disk swap partitions as highest priority. I’ll read up on that before asking any questions (if I get stuck or if something doesn’t work).
It would seem that you may be able to disable zram completely if you were to use the following (from the man page for zram-generator.conf)
• max-zram-size=
Sets the limit on the zram device's size obtained by zram-fraction.
This takes a nonnegative number, representing that limit in megabytes, or the literal string none, which can be used to override a
limit set earlier.
Defaulted to 4096. Setting this or zram-fraction overrides zram-size.
As I read that it seems that max-zram-size=0 should disable zram completely.