1. Download the gparted partition tool, compress or expand memory, and create a new swap partition.
& sudo apt-get install gparted
2. Activate swap partition
& mkswap /dev/sda5
Setting up swapspace version 1, size = 2097148 KiB
no label, UUID=cc64ac36-f5b0-4877-afe6-a49e76c72336
& swapon /dev/sda5
3. Modify the fstab file
& sudo gedit /etc/fstab
4. Check the swap partition activation status
& free -h
Activation successful!