[HOWTO] Add swap file


#1

It seems all new scaleway servers are created without swap.
For people, like me who want to use some, there is the easy way (ex. is for 8Go) :

# dd if=/dev/zero of=/swap bs=1024 count=8388608
# chmod 0600 /swap
# mkswap /swap
# swapon /swap
# free -h

Add this line to your /etc/fstab file :

/swap swap swap defaults 0 0

And you’re done…


#2

I use fallocate -l 8G /swap instead if dd


#3

Sounds good, you’re right i use old school tools…