Using a swapfile

ArchWiki article

A swapfile has the same function of a swap partition. The advantage of swapfiles is that they they can be reallocated if need be. Whereas changing size of a partition is extremely difficult (except when using lvm). The performances of a swap file are the same as for a swap partition: Linux kernel ignores the filesystem and accesses the block contents directly on the disk.

Swapfile will be activated on boot. To activate it without rebooting, execute swapon {swapfile}

Removing/resizing a swapfile

To resize a swapfile: delete it and recreate it.

Setting up hibernation with a swapfile

For the system to be able to hibernate successfully when a swapfile is used, some steps have to e followed.

It is now possible to hibernate