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 underneath it
mkfs.ext4 /dev/vdb2
swapon /dev/vdb2 now, plus an fstab line such as UUID=... none swap defaults 0 0 to keep it after reboot
swapon /dev/vdb2
UUID=... none swap defaults 0 0
mount /dev/vdb2 /swap, then add the mount point to /etc/fstab
mount /dev/vdb2 /swap
/etc/fstab
Nothing; swap is only reported by free after the system starts using it
free