OS: FreeBSD 10.1-RELEASE
I was following the instructions for creating a swap file in the handbook and upon restarting my system top was no longer reporting the swap space as being available. Being the silly, silly novice that I am, I tried recreating /usr/swap0.
Still nothing. So now I thought: "Okay let's delete and restart the process".
At this point I looked up the man page for swapon(8) and noticed that -q was suppressing possible warning messages. Removing -q produced something somewhat terrifying: The device was already in use. Of course this means that I had likely deleted it while it was actively being used as swap.
I then found this Thread freebsd-10-wont-add-swap-file.47167 explaining that I needed to add "late" to my entry in /etc/fstab. Swap is now working properly!
How can I reclaim the lost disk space? I've restarted the system several times, tried checking inodes, and ran fsck() with no success.
I was following the instructions for creating a swap file in the handbook and upon restarting my system top was no longer reporting the swap space as being available. Being the silly, silly novice that I am, I tried recreating /usr/swap0.
Code:
# dd if=/dev/zero of=/usr/swap0 bs=1m count=4096
# swapon -aq
Code:
# rm -f /usr/swap0
# dd if=/dev/zero of=/usr/swap0 bs=1m count=4096
# swapon -a
Code:
# df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/vtbd0p2 39G 20G 16G 56% /
# du -sh /
15.8G /
How can I reclaim the lost disk space? I've restarted the system several times, tried checking inodes, and ran fsck() with no success.