4 ms·
I'm a bit confused. I always thought that proper use of ZFS required multiple drives just like RAID. Then I read an article where RAID was used with ZFS. Now I'
by icantthinkofone 12y ago
I'm a bit confused. I always thought that proper use of ZFS required multiple drives just like RAID. Then I read an article where RAID was used with ZFS. Now I'm really confused so I'm taking the lazy way and asking here: is ZFS appropriate for a single drive system?
- Qantourisc 12y agoSure, COW(copy on write), snapshots, error checksum on files, compression, support for SSD's. You just don't have redundancy.
- FooBarWidget 12y agoI 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.
- prakashsurya 12y agoYes, I run ZFS on Linux on my single drive laptop currently. ZFS doesn't _need_ multiple drives to work well, but it is capable of using them if they're available. One can also run a HW raid solution underneath ZFS, where the RAID engine just presents ZFS with a small number of LUNs. It's all up to the admin; and what sort of performance, redundancy, and maintenance guarantees are required.