Activating Swap Space
You created partition /dev/vdb2 of type Linux swap and ran mkswap /dev/vdb2. free -h still shows 0B of swap. What is missing?
/dev/vdb2
mkswap /dev/vdb2
free -h
Choose one answer
mkfs.ext4 /dev/vdb2, because swap needs a filesystem under it
mkfs.ext4 /dev/vdb2
swapon /dev/vdb2 now, plus an fstab line like UUID=... none swap defaults 0 0
swapon /dev/vdb2
UUID=... none swap defaults 0 0
mount -t swap /dev/vdb2 /swap, then add /dev/vdb2 /swap swap defaults 0 0 to /etc/fstab
mount -t swap /dev/vdb2 /swap
/dev/vdb2 /swap swap defaults 0 0
/etc/fstab
Nothing: free only reports swap once pages are written to it
free