Unless you’re swapping constantly having swap on an SSD isn’t really an issue. Running without swap means you can’t hibernate and if you hit an oom situation the system will likely just crash.
The error you are reporting may come from the “resume” hook in /etc/mkinitcpio.conf. If you want to disable hibernation you need to remove the resume hook.
But I want to make a general statement regarding swap on SSD. I believe a generic statement like the one you are referring to is wrong:
Just a note, it’s not recommended to make a swap partition on an SSD, this can damage the medium.
If you have a laptop and want to hibernate you need swap. Either file or partition. And because most laptops these days are coming with an SSD, discouraging swap on SSD would simply break hibernation for EndeavourOS
There is no evidence that swap on SSD is dangerous. This warning is just an academic exercise. For old SSDs (5+ years) the warning might have some truth because such old SSDs had much less TBW and not so good controllers to cope with bad sectors. But for modern SSDs I would not be concerned about swap on SSD.
This warning is pretty unique. I am not aware of any other Distro giving such a warning. Not even Arch Linux.
From a performance point of view the SSD is the best place for swap.
EDIT:
If you do not need hibernation and do not want swap on the SSD you could try zram resp. zram-generator. I am using it on my desktop PC to have some emergency swap available and it works well.
If not at all, you could do without a swap partition/file, however I would suggest to look into setting up zram for those cases that the kernel needs to swap out some files from RAM.
When it comes to swap, I think it is better to have some than none at all. The points made in the following article make sense to me to the extent I understand the ideas put forward:
its always a good idea to have swap, even if you dont use it frequently. The system will crash if you run into an OOM situation as while windows tends to handle OOM in an alright manner Linux usually just crashes the system when it has nowhere to put things in an OOM situation. Running without even a few GB of swap can be fine as long as nothing misbehaves and you dont run out of memory but having it and not using it is better than not having it.
another thing to keep in mind is that Zram/Zswap is not a replacement for a swap file/partition. In high memory pressure situations its frequently not able to handle giving the system long enough to recover which is why still having a file or partition is still a good idea.
I would also like to add that no matter how large the size of the physical RAM is, the listed software solutions (swappiness settings, zram, etc.) cannot replace a swap partition or swap file for memory-intensive operations.
On a laptop with 16 GB where so far I haven’t filled up half of it, the system runs perfectly fine without a swap partition/file. Not hitting, for me the edge case of OOM.
However, I have set up zram which does occasionally get used. I have noticed it after waking up the system from suspension to RAM.
Thanks @pebcak@Echoa After reading the article & your comments I changed my mind.
I think it’s better to have swap partition. IMO eos article should mention that with bracket.
also checked.
lsblk -d -o name,rota UUID in /etc/fstab
NAME ROTA
sda 1
sr0 1
If you get value of rota in the above output as 1, the disk is HDD. If the value is 0 (zero), then the disk is SSD So mine is HDD
steps:
Added swap partition using gparted from live usb
Re-added the new UUID to /etc/fstab
Re- added “resume=UUID=” part to/etc/default/grub
Re-add resume to the line HOOKS=“base udev autodetect modconf block keyboard keymap consolefont resume filesystems fsck” in /etc/mkinitcpio.conf
sudo mkinitcpio -P
sudo grub-mkconfig -o /boot/grub/grub.cfg
Marking this as solution for those who want to remove swap & such errors.