zfs on a single device: what happens when a file is corrupted?

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?


Solution 1:

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.

Solution 2:

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.