It is written everywhere that ZFS is helpful even if you only have one physical device, because it will tell you about data corruption due to bit decay and such.

However, can it actually address such corruption?

In other words, are there any notable benefits in running ZFS as a filesystem on a single physical device?

  • Is your question "are there ANY notable benefits to running ZFS as a filesystem on a single physical device" or "are there any notable DATA RESILIENCY benefits to running ZFS as a filesystem on a single physical device"? The answers are very different. The first is yes, the second is effectively no (other than using things like copies=, as others have already told you). – Nex7 Oct 11 '13 at 17:58

If you set the COPIES property for a ZFS filesystem to a value higher than 1, then a file that is corrupt can be repaired because there is at least one more copy available.

  • 1
    ...provided that the damage is limited to just that one sector/cluster on the disk. It's not a true safe recovery as you'd get with RAID or RAID-Z – voretaq7 Oct 10 '13 at 20:42
  • so, would it actually aid in the likelihood of not loosing the files? what are the odds? – cnst Oct 10 '13 at 20:49
  • 2
    @cnst - it doesn't really matter what the odds are. You need to assume that it's going to fail and have a well-tested backup. – EEAA Oct 10 '13 at 20:57
  • @EEAA, no, the odds do matter. If such a scenario doesn't add much to reliability, then one'd rather find a better use to such space that would otherwise be occupied by these not-so-useful copies. – cnst Oct 10 '13 at 21:14
  • @cnst Odds are when a HD goes it has a short period where some clusters are readable, followed "shortly" by catastrophic failure. If you catch the drive during that partial failure, odds are very good you can recover your files. You'd probably be interested in reading Google's HD Study. – Chris S Oct 11 '13 at 1:27

I guess this depends on how the files gets corrupted...

Sure, I run ZFS in single device arrangements (atop block devices presented hardware RAID controllers, for instance). I don't know that I'd run with a single physical disk, though.

As others have mentioned, you can mitigate some of the corruption risk by using the zfs copies= feature. RAID with multiple ZFS-managed devices would still be better. But with ~4 years of ZFS experience, I've never actually encountered corrupted data.

  • hm, i don't think you're supposed to run zfs on a single device with one copy, on top of a hardware raid... – cnst Oct 10 '13 at 21:03
  • 1
    You definitely can, and there are no rules!! – ewwhite Oct 10 '13 at 22:04

Yes, you can have data stored in multiple copies:


Link from Web Archive project http://web.archive.org/web/20131003025617/https://blogs.oracle.com/relling/entry/zfs_copies_and_data_protection

So you would vastly reduce available disk space, but potentially be able to recover from a specific area of corruption. (I haven't tried it).

  • @OleTange I've updated it to a web archive link. NB. it's 8 years since this answer, and the blog post was 6 years old then. – TessellatingHeckler May 14 at 2:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.