Adding swap /hibernation after install

sudo dd if=/dev/zero of=/swapfile bs=1M count=512 status=progress
512 must be changed to the size you want (size of your RAM alike)

sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

Finally, edit the fstab configuration to add an entry for the swap file:

sudo nano /etc/fstab


/swapfile none swap defaults 0 0

simple as this… to get it working for hibernation/suspend:

Add the resume option to grub kernel line
to the the UUID of the partition containing your /swapfile:

sudo findmnt -no UUID -T /swapfile

sudo nano /etc/default/grub

# GRUB boot loader configuration

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="EndeavourOS"
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 resume=UUID=**put the uuid here** nowatchdog"

regenerating grub.cfg :vulcan_salute:
sudo grub-mkconfig -o /boot/grub/grub.cfg

note:

—>
go to the updated wiki page instead it includes also systemd-boot and more:
https://discovery.endeavouros.com/storage-and-partitions/adding-swap-after-installation/2021/03/