Cleanly & permanently disabling swap on an unimportant SSD

Status
Not open for further replies.

trickster

Cadet
Joined
May 24, 2017
Messages
4
Hello,

After my primary HDD pool was created, I recently added my SSD to my new install and forgot to set the swap parameter in system to 0 before creating it, so I'm stuck with this 2GB partition and want to take all precautions before removing swap from it. So I built a simple FreeNAS VM and duplicated my setup in an attempt to see what would happen on 11.1 if I remove a ZFS volume, set the advanced setting to 0, and make a new volume to replace it. The result was mixed: I saw there was no swap partition on the new volume, but the swap mount was still there for a partition that no longer exists.

I don't want to go forward with a system configured this way. Should the swap configuration be removed when the volume is detached? How can I configure the NAS so that the swap device is not created on boot?

I tested rebooting with a new post-init task running swapoff /dev/mirror/swap2.eli because fstab seems to get overwritten automatically on boot and this ultimately unmounted the swap device and the total swap available looked OK. Is this a recommended solution or is there something more permanent? I would prefer to not do this via task, but with something more permanent, if possible.

After doing some google + forum searching, I don't see any permanent solutions offered because swap is does not appear to be handled exactly the same as on a FreeBSD system.

Thanks!
 
Last edited by a moderator:

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Why bother with this sort of messing around when it can come back to bite you later? Consider the 2GB swap space as underprovisioning to extend the life and reliability of the SSD. If swap space is ever needed, it will be there to use.
 
Status
Not open for further replies.
Top