1. Create a swap space operation
- Create a partition with the file system type linux-swap
- Exchanging signatures for devices (udevadm settle)
2. Format the device
mkswap partition directory (such as /dev/vdb1)
udevadm settle
3. Activate the swap space
swapon partition directory (such as /dev/vdb1)
4. Permanently activate swap space
View UUID method
lsblk --fs
Open the configuration file for persistence
vim /etc/fstab
enter
UUID swap swap defaults 0 0
or
Partition device (such as /dev/vdb1) swap swap defaults 0 0