ZFS with two disks: does this make sense? what is the safest configuration

freenaszfs

I am in the process of planning a file server for private usage (small amounts of various kinds of data, but mainly photos, videos, music). I will probably use NAS4free/FreeNAS and want to give ZFS a try.

My focus is not speed, it is reliability and data safety. Nevertheless, I want to keep things 'cheap', so I want to run ZFS mirrored among two disks ('raid 1' fashion). I will buy a consumer board, so no hardware raid controller. So far, I am thinking to use the ZFS 'mirror' command for this or whatever corresponding option FreeNAS provides.

When reading about this topic, I mainly see people using three disks and then using RAIDZ-1 which renders them immune in case one disk fails. What I do not quite understand so far is what is the problem with having ZFS mirrored among two disks only? How will I notice when one disk fails? What is the failover strategy? Do I just get a message that the file system is not usable, because disk A is failing and that I should replace it now? I hope that one can achieve a real benefit when running two mirrored disks than just using one.

Given two equivalent disks, which ZFS mode would you run in?

Best Answer

For two disks, you want mirror mode. This will cause the drives to be exact images of each other. If ZFS tries to read a block of data from the drive and it fails verification, then ZFS will automatically try to repair it. If the repair fails, it'll read it from the other drive and mark the bad drive as failed. You should get a notification that a drive failed, but the filesystem will still be usable. You get some read speed improvements, but no write speed improvements. As long as you have at least one drive from a mirror set, you have all of your data.

With raidz, you need at least three drives. They function similar to RAID5 where (effectively) one drive stores recovery information, and the other drives store data. It can handle any drive failing, as long as only one drive fails at a time.

raidz2 and raidz3 are the same as raidz, except that they can handle two or three drives failing, respectively. They require more drives to operate and reduce effective capacity, though.

Related Question