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:
Code:
# free
# dd if=/dev/zero of=/extra-swap bs=1M count=500
# mkswap /extra-swap
# swapon -a
# free
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:
Code:
# vim /etc/fstab
...
/extra-swap swap swap defaults 0 0
...
# reboot
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?
SK