Create a swap partition of 512MB at /dev/sdb, with a persistent prioity of 20.
# free -m
# fdisk /dev/sdb/ // g, n, +512M, t, swap, w # partprobe # lsblk # mkswap /dev/sdb1 // DONT FORGET !!! # blkid
Add the priority in fstab instead of default parameter:
# vim /etc/fstab UUID=......... swap swap pri=20 0 0
Note: Priority can be added when swappon command is invoqued, but not persistent:
# swapon -p 20 /dev/sdb1 # swapon -s
# mount -a
# swapon -s # swapon -a
# free -m # lsblk
Create a swap partition 2
| Add aditional swap partition of 2GB using /dev/sddX and mount it permanently.
# lsblk [-fp]
# fdisk /dev/sdd
Command (m for help): g
Created a new GPT disklabel (GUID: 2A33A3BA-E580-1B44-A4CD-9EDC587E3FC0).
Command (m for help): n Partition number (1-128, default 1): 1 First sector (2048-12582878, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-12582878, default 12582878): +2G
Created a new partition 1 of type 'Linux filesystem' and of size 2 GiB.
Command (m for help): t Selected partition 1 Partition type or alias (type L to list all): swap Changed type of partition 'Linux filesystem' to 'Linux swap'.
Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks.