swapfile configuration This note was created on 2023-03-14 This note was last edited on 2023-03-14 === Create and enable the swapfile === 1. Create "/swapfile": # dd if=/dev/zero of=/swapfile count=8192 bs=1M 2. Set permissions: # chmod 0600 /swapfile 3. Mark the new file as swap space: # mkswap -L swap /swapfile 4. Enable the swap file: # swapon /swapfile === Make the changes permanent === 1. Create fstab backup: # sudo cp /etc/fstab /etc/fstab.bak 2. Add the following line to "/etc/fstab": ~~~ /swapfile swap swap defaults 0 0 ~~~ 3. Done!