Swap files and panics

Warren Block wblock at wonkity.com
Tue May 29 15:54:29 UTC 2012


Recently I rearranged partitions on an SSD.  The swap partition was 
eliminated in favor of a swap file on /usr.  This works, allows TRIM 
support on the swap space, and is easier to resize than a partition.

However, sometimes the system panics on shutdown.  It happens after 
"syncing disks", so the filesystems are fine, but it's disconcerting.

I suspect but haven't yet managed to prove that it's only when swap is 
not empty.  A race condition involving when the filesystems are 
unmounted?  Or should there be some code in /etc/rc.d/addswap to run 
swapoff before shutdown?

This is on a very recent 9-STABLE amd64, i5 2500K.

rc.conf:
swapfile="/usr/swap/swap"


More information about the freebsd-questions mailing list