I had a standard CentOS 7 partition layout with /boot, /, /var, and swap (2G) partitions carved out.
So the free cmd showed me that I had 2G total.
As a test, I added roughly 500MB more swap through a swap file:
# dd if=/dev/zero of=/extra-swap bs=1M count=500
# mkswap /extra-swap
# swapon -a
At this point, the free command returned same amount, roughly 2G. So I added the swap file to my fstab to make it persistent then rebooted:
# vim /etc/fstab
/extra-swap swap swap defaults 0 0
Upon reboot, the free cmd now showed 2.5G
My question is, why did free not show the swap until reboot?
Ideas and / or better ways to do this?