howtogeek at January 29th, 2014 12:34 — #1
Originally published at: http://www.howtogeek.com/175159/an-introduction-to-the-z-file-system-zfs-for-linux/
ZFS is commonly used by data hoarders, NAS lovers, and other geeks who prefer to put their trust in a redundant storage system of their own rather than the cloud. It’s a great file system to use for managing multiple disks of data and rivals some of the greatest RAID setups.
campbell2644 at January 30th, 2014 11:43 — #2
Interesting. You promise more and we'll look forward to that
sudobash at January 30th, 2014 13:01 — #3
Great article. Most useful one I have seen in ages on HTG. I never had any idea of how powerful ZFS could be.
awensley at January 30th, 2014 18:06 — #4
I've been interested in ZFS for a while. I love this simple walkthrough.
One question: in the last step, you say you added another raidz to the storage pool. It seems like that would be needlessley redundant (losing 2 drives' worth of space for parity, 1 per raidz). Couldn't you just add the three to the existing raidz and have 15TB of usable space? Forgive me if that's a dumb question.
cbunn at January 31st, 2014 00:18 — #5
No, that is not possible. RAID-Z vdevs cannot be expanded by adding more disks. The only way to expand them is to replace the disks with larger ones, one at a time, letting the system rebuild the vdevafter each replacement.
The story was misleading. It read:
Similarly with ZFS, when you need more hard drive space, you put in another hard drive and you’re done. No need to spend time partitioning, formatting, initializing, or doing anything else to your disks – when you need a bigger storage “pool,” just add disks.
If you are creating a zpool from single-disk vdevs (as in the first example given), then this will work. But there will be no redundancy as the zpool will stripe over each disk with no parity. Another way this might work is that if you already have a mirrored vdev, you can add another disk to that vdev, but this expands redundancy (i.e. creates a triple-mirror), not capacity. While the statement in the story is technically correct, since most people associate ZFS with its RAID-Z functions, it is quite misleading to the casual reader. Adding disks in this way to a pool is a recipe for data loss.
It is important to understand the difference between zpool and vdev. The vdev is the virtual device that is made up from block devices (e.g. hard drives). A vdev can be a single disk, a mirror or a RAID-Z. A zpool is a collection of one or more vdevs into a single storage device accessible to the file system. A zpool always stripes data across vdevs. This is an important detail, because it can lead to trouble if not considered carefully. For instance, if you have one RAID-Z vdev in your zpool and you want to expand your storage with another set of drives in a new RAID-Z vdev, you can create it and include it within the original zpool. And while each of those vdevs has the ability to recover from a single drive failure (or more in the case of RAID-Z2 and RAID-Z3), two drives failing within the same vdev will cause the entire zpool to be lost, even though the second vdev had no drive failures at all.
So it is best to carefully plan ahead for any ZFS deployment as a filesystem this sophisticated naturally has a learning curve. Having said that, I think that ZFS is the only way to go for a DIY NAS. I use FreeBSD for mine, but for beginners, I might recommend FreeNAS.
awensley at January 31st, 2014 10:05 — #6
That makes sense. For some reason, I had the impression that RAID-Z's were so awesome, you could add disks to them at will. I guess I was confusing vdevs with zpools. Your explanation cleared that up for me. Thanks.
I wish there was some way to non-destructively convert my NAS's RAID 10 to ZFS!
markw676 at February 4th, 2014 20:40 — #7
Thank you HTG! I was just starting to look into ZFS and all the other fancy file system stuff like LVM. Maybe a tutorial on LVM contrasting it with ZFS would make a good article? Also some information on ZFS compression would be awesome.
awensley at February 7th, 2014 15:12 — #8
I second this! A contrast to LVM would be very informative (since a lot more people understand LVM, it seems), and ZFS compression is another feature I've been interested in.
system at February 8th, 2014 12:34 — #9
This topic was automatically closed after 10 days. New replies are no longer allowed.