Cyberpanel.swap error on XFS filesystems

Situation:

Centos 7
Filesystem XFS
(this is the default for Upcloud VPS servers)

The cyberpanel.sh script uses ‘fallocate’ to create a new swapfile.
This does not work with XFS filesystems as described here:

After running the installation script, the swap files seems to be created, but the command ‘swapon cyberpanel.swap’ fails with error ‘swapon failed: Invalid argument’.

So it is adviced to use ‘dd’ instead of ‘fallocate’ which works for all filesystems:

dd if=/dev/zero of=/cyberpanel.swap bs=1024 count=2097152
(count=MB*1024)

Another minor thing:
echo “${SWAP_FILE} swap swap sw 0 0” | sudo tee -a /etc/fstab

It is recommended to use:
echo “${SWAP_FILE} none swap sw 0 0” | sudo tee -a /etc/fstab

Although it doesn’t matter, just a cosmetic thing :slight_smile: