# Swap options for reliable ZFS system



## carlton_draught (Nov 4, 2010)

Hi,

I've searched the forum and not really found what I was looking for, which is a discussion with a useful conclusion about how to manage potential errors in whatever media the swap is on. I run ZFS because I want to be able to have as much surety as possible that the data (and the programs that manipulate the data) are verifiably free of hardware errors. Preferably, with redundancy.

Hence, I have ZFS mirrors for both OS and storage. I have registered ECC RAM (and would not consider running anything less than ECC). I use either rsync or zfs send/receive for transferring data, because both verify (as far as I have researched) that what is written was what was read. I know I'm not the only one here who runs ZFS for the reasons I do, and does similar things.

Pretty much the only thing left* that is at the mercy of hardware errors is the swap. So, here are the current available options as far as I know:

Run a swap slice on each of your root mirror drives. If silent data corruption strikes either partition, then you just deal with it several months down the track after pulling your hair out in frustration as to why things aren't working the way they should.
Use a gmirror for swap. AFAIK, if silent data corruption strikes you will not know about it either, because AFAIK, as data is read it is not compared. Please correct me if I am wrong here.
Use ZFS swap, even though it is not recommended for FreeBSD or for that matter, Solaris AFAIK.
Buy enough ECC RAM and dispense with SWAP entirely. (Any idea how much RAM this would be?)
Search for something to put the swap on that has loads of ECC capability natively (kind of like RAM). Most I see seems to have no more than the ability of RAM to correct single bit errors and detect (but not correct) double bit errors.

I'm curious to see how people who have similar concerns have approached this.

* I guess another related thing I'm curious to see if anyone has any insight into - I can see that there might be several areas where a computer system does not have the fault tolerance/reliability of ZFS. e.g. 

ECC RAM and double bit errors (detected but not corrected).
CPU core errors.

It would be nice to be able to buy more hardware and have some sort of option to either use a redundant approach with checksums to determine which is the correct version, or use triple modular redundancy.

Does anyone know if there are ways to achieve this sort of thing with FreeBSD? I doubt there is, but I thought it might be worth asking.


----------

