07-21-2016
12,315,
4,560
Join Date: Jul 2012
Last Activity: 22 November 2019, 4:29 PM EST
Location: San Jose, CA, USA
Posts: 12,315
Thanks Given: 952
Thanked 4,560 Times in 3,818 Posts
The key thing here is that if you created a UFS filesystem, mounted it, maybe put some files in it, maybe removed some or all of those files, and then decide to use that partition as swap space; you MUST unmount that UFS filesystem before declaring that partition to be swap space. And, after telling the OS it can use that partition as swap space, you MUST assume that that partition can never be mounted as a filesystem again until you tell the OS it can no longer use that partition as swap space AND you use something like newfs to create a new filesystem on that partition before you mount it as a filesystem again.