SOLVED Why swap to partitions instead of using a ZVOL?

Status
Not open for further replies.

Borja Marcos

Contributor
Joined
Nov 24, 2014
Messages
125
Just registered on the forum, I have barely installed FreeNAS once (the 9.3 beta available for download as an .iso) but I have found something surprising.

Even when installing on a memory stick, when I create a pool with several disks it creates swap areas. No problem with that, swap is necessary. What I find weird is swapping directly to disk partitions. A disk failure can make the system stop working, something that ZFS prevents.

Why not swapping on a ZVOL instead? I know it was not safe in the past, but as far as I know it should work now. And it would certainly avoid a panic and prevent startup problems.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
There's a bunch of reasons. The CTO of iXsystems made a comment about it in IRC and the basic short answer was that running on ZFS for swap is much more intrusive for the OS than running from partitions. :P

Yes, technically a swap failure could cause problems. The problem though, is not that simple. You shouldn't normally have any swap-space in use because you, hopefully, built an appropriate system. This means you can pull drives out without consequence. :P

I know someone in IRC tried to swap to ZFS, and it went badly. The box kept panicing.
 
J

jkh

Guest
Swapping to ZFS is not currently supported; it is buggy. Swapping to individual disks is also problematic, which is why we want to change that to swap to geom mirrors, so at least one drive in every mirror pair can die without causing issues with swap. I don't have the bug # handy, but we're working on that one.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
And he has spoken. :P
 

Borja Marcos

Contributor
Joined
Nov 24, 2014
Messages
125
Also sprach, indeed ;)

I see. I've been swapping to ZFS on 10 and 10-STABLE without incident for some time. But never dared to try on 9.x :)

I understand, so it will be mirrored. Phew.

Regarding proper or not, cyberjock, there's a lot of software there that sometimes can be a bit wild. And swap is a good safety net for it in my opinion. Unix software, after all, is often written assuming that there's a lot of memory available, swap space included ;)
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Regarding proper or not, cyberjock, there's a lot of software there that sometimes can be a bit wild. And swap is a good safety net for it in my opinion. Unix software, after all, is often written assuming that there's a lot of memory available, swap space included ;)

Yes, but the expectation (and the way FreeNAS is designed) is that you shouldn't be using swap. If you were an iXsystems customer and called and said a box was using swap we'd be asking for memory dump info and all sorts of stuff. That's *not* the norm and *not* expected for the system.

Sorry, but I'm not going to debate this topic any further. If you want to read up on past discussions (which have been very detailed and lengthy) please search the forums.

Regardless, the CTO has explained why swap isn't on the zpool, which was the original topic of this thread. ;)
 
Status
Not open for further replies.
Top