4 ms·
I thought the error checking (scrubbing) only works if you have multiple drives set up in a RAID.
by FooBarWidget 12y ago
I thought the error checking (scrubbing) only works if you have multiple drives set up in a RAID.
- sp332 12y agoZFS writes a checksum when it writes data. So you can tell whether your data is corrupted, even if you don't have the redundancy to restore the corrupted data.
- prakashsurya 12y agoError detection can always be used, but error correction may or may not be available (it depends on the type of block). Metadata blocks are redundant even on a single drive pool; so if you just have a partial failure (e.g. overwrite a metadata block) it might be able to correct the block using another redundant copy on the same drive. Data blocks will require a redundant pool configuration, though, as these are not store redundantly by default (e.g. multiple drives in a raidz or mirror).
- mrb 12y agoActually you can correct data blocks, on a single-drive ZFS pool, if you set the attribute copies=2 (ditto blocks): https://blogs.oracle.com/relling/entry/zfs_copies_and_data_protection https://blogs.oracle.com/relling/entry/zfs_copies_and_data_p... Obviously this redundancy feature makes you use twice the disk space you would normally use.
- prakashsurya 12y agoyup, that's why I added "by default". a user won't get that functionality without explicitly asking for it.
- X-Istence 12y agoIt only works in the sense that if it finds an error it could recover when it is a multi-drive RAID, but a scrub can verify that the data on disk is still whole and matches what it expects. Not only that, but a scrub can have ZFS tell you exactly what files are now "damaged".
- nisa 12y agoYou can also use it on a single drive. You need to set copies=n for a ZFS dataset. If one copy gets corrupted a zpool scrub fixes this problem on a single drive. However HDDs are usually dying fast after signalling bad blocks to the OS so it's not a good strategy to avoid data loss. Besides that the metadata is still replicated in a single-drive setup. So if you loose data you'll at least know exactly where the error was. This is still a benefit over ext4.