I had swap from a swapfile working for quite some time, but for some reason it stopped working.
sudo fallocate -l 4G /home/.swap/swapfile
sudo chmod 600 /home/.swap/swapfile
sudo mkswap /home/.swap/swapfile
# /etc/fstab
/home/.swap/swapfile swap swap defaults 0 0
sudo swapon -a
swapon: /home/.swap/swapfile: swapon failed: Invalid argument
I'm running the newest version of Fedora, so is it maybe possible something has changed with an update or what could be the reason?
swapon
program, but it can provide more information in its log.sudo
.swap
. You can write pretty much anything there.swapon: swapfile has holes
and the answer below worked.