I'm a newish user to Ubuntu and setting up a server for home use. With previous versions of Ubuntu server I created a swap partition on my first drive. However 20.04 uses a swap.img file on the root partition. I want to move this to my swap partition and did the following:
swapon -s
SHOWS "/swap.img"
sudo nano /etc/fstab
SHOWS "/swap.img none swap sw 0 0"
I already have a SWAP partition that I set up during install so I have a /swap folder in root which is mounted to the correct partition.
I copied swap.img to the swap/ folder then changed the fstab file to read:
/swap/swap.img none swap sw 0 0
I rebooted the system and swapon -s
SHOWS: "/swap/swap.img"
I removed the original swap.img file from root and rebooted Everything seems to work fine but my question is "Is this the correct way to do this?" as I can find no mention anywhere else.
Thanks in advance