7 ms·
The 'hidden' cost of using ZFS for your home NAS
- laumars 11y agoThat's not a hidden cost. That's what you'd normally expect with any traditional RAID. However like many modern solutions, ZFS does have a few workarounds: MULTIPLE ARRAYS PER TANK If you have space in your storage servers housing, then you can buy multiple disks at a time as a separate array (eg 3 disk raidz1) and add them to your existing "tank" (ie storage pool). AUTOEXPANDING INTO LARGER DISKS If you have autoexpand=on set on your tank then you can upgrade the capacity of each disk in a raidz, one disk at a time. The caveat here is that your array doesn't increase in capacity until every disk has been upgraded, but it does still allow you to start the upgrade process incrementally. ALTERNATIVE SOLUTIONS However, if one needs the support of upgrading their array, increasing the capacity with each new disk added, then ZFS is definitely the wrong choice. Any traditional RAID array would be ill suited for this. Instead I would recommend unRAID or similar (I think Windows might have something built in, but I'm a UNIX guy so couldn't comment there).
- deleted 11y ago[deleted]
- notpeter 11y ago> Other software RAID solutions like Linux MDADM lets you grow an existing RAID array with one disk at a time. His issue isn't with ZFS, it's that most parity raid (raidz, raidz2, raid5, raid6, etc) doesn't support safely rebalancing an array to a different number of disks. With mirrors, the things he describes aren't an issue, especially in a home server. You can start with one disk, mirror it when you're ready; then add additional vdevs of mirrored pairs extending your pool as necessary. Or upgrade two disks to grow a vdev. http://jrs-s.net/2015/02/06/zfs-you-should-use-mirror-vdevs-not-raidz/ http://jrs-s.net/2015/02/06/zfs-you-should-use-mirror-vdevs-...
- __david__ 11y agoLinux mdadm supports re-striping raid5 devices in place. I've done it, it's fun. If you're raid doesn't support that, it's deficient.
- rincebrain 11y agoThe reason that ZFS has such trouble with this notion is that a lot of its internal architecture depends on "block pointers" (offsets of data into a given vdev) being immutable - this is, among other things, why CoW snapshots are so cheap. And attempting to rewrite all of these without having any gaps in consistent on-disk state is...challenging, to say the least. Sun apparently had internally done most(?) of the work on BP rewrite (as it's referred to), but performance sucked rather badly, and the work has not been shipped by Sun/Oracle, let alone anything that came out before the F/OSS code sharing ceased. [1] (Performance sucked, in particular, for similar reasons to why dedup performance has such a high penalty on ZFS - they end up storing a lookup table that gets hit for every block that gets written after you turn on dedup, and so if that table stops fitting in RAM, it's a bad time - let alone the issue of making sure the disk backing the DDT storage is sufficiently performant...) [1] - http://www.listbox.com/member/archive/182180/2012/01/sort/thread/page/2/entry/0:81/20120109175552:13206E3A-3B15-11E1-A2B7-FB6559D63601/ http://www.listbox.com/member/archive/182180/2012/01/sort/th...
- jlgaddis 11y ago> If you're raid doesn't support that, it's deficient. Nowadays, RAID5 is deficient.
- __david__ 11y agoThat's another topic entirely. I'm just saying if you're going to support it, support it correctly.
- antongribok 11y agoThe article you link to is disingenuous (IMHO), it talks about performance during a rebuild, but then says this: "When you replace and resilver a disk in a mirror vdev, your pool is again minimally impacted – you’re doing simple reads from the remaining member of the vdev, and simple writes to the new member of the vdev." If you're only doing "simple reads" then your storage array is not serving any writes, in which case why are you concerned about performance at all? Each "Home NAS" is going to have very different requirements (to each his own). If you are concerned about reliability and want to be protected against a dual-drive failure, you're better off with RAIDZ2 than with a bunch of striped mirrors, because with RAIDZ2 you can have any two drives fail, where as with an array of mirrors you still have this nagging chance that the second disk in your degraded VDEV will fail and you will loose the entire pool. Chances are that your home NAS does not have a 4-hour disk replacement SLA. Also, just blindly recommending to mirror everything may not be the best option for a lot of home users that don't want to loose half of their raw capacity to parity.
- joosters 11y agoFive or six drives for a home NAS? This, IMO, is madness. RAID-1 a couple of drives, and take backups. If the worst happens, you can restore offline from your backups. If you seriously need 100% uptime at home, in the face of multiple drive failures, you are doing something badly wrong. Or, at least, doing something far beyond 'home use'...
- __david__ 11y agoNot in the slightest. I'd rather have some redundancy up front than try to restore a bunch of junk from backups. Backups are important, but not ever having to use them is even better. Not only that, but having RAID or mirror sets gives you flexibility in ways that you might not think about up front. For instance, I just replaced some old 750GB disks with new 5TB disks. I added the new 5TBs to the the mirror set and let it bring all the data across automatically. When it was done, I dropped the 750s out and resized the raid set to use the whole 5TB (I told it it was already clean so it didn't have to sync up a bunch of unused space). Then, finally, I resized the filesystem that was mounted on that mirror set. This was all done live, with data actively being read and written to while all this volume manipulation stuff was happening. That is why you use RAID at home (and lvm, too).
- joosters 11y agoAlternatively, * Plug new hard drive in * cp data on to new hard drive * ...profit? IMO, much simpler, straightforward, less prone to errors and your data is perfectly safe until you do something with the old hard drive. Again, it's not 100% uptime but this is your home, not a mission-critical business.
- __david__ 11y agoNot much simpler. Replacing my disk as described above was literally 4 commands from bash. And zero reboots. And less error prone? Are you joking? In a non-mirror system you have to re-partition and set everything up the way it was, you have to really hope you copy things back correctly (do you have a bunch of hard links? Does cp copy them correctly? What's that option to rsync again? Do you have enough memory to copy hard links correctly? Are xattrs going to copy correctly?). Sigh. On top of that all you can't actually use that disk while any of this is happening. Grrr, and it's going to take 11 hours to copy 5 TB of data back (at 125MB/s)! If you're perfectly happy with your computer being out of commission for 11 hours, be my guest. Also, when the old disk is removed from the mirror set, it's a complete image copy of the data. I'm not sure why you think that isn't the case... Seriously, making every disk in your computer a mirror set is really a phenomenal idea. I've been doing it for years now and every time I have to upgrade or replace a disk it's made it heavenly. You shouldn't pooh pooh it until you've actually tried it.
- VanillaCafe 11y agoThe 'hidden' cost of traditional RAID for your home NAS: I've learned the hard way that the 'R' in traditional RAID truly does stand only for "redundant" and not "reliable". Reliability in traditional RAID is predicated an complete, catastrophic failure of a drive such that it is either working wholly and completely or failing wholly and completely. In a traditional RAID, for any failure mode in which a drive or its controller starts to report bad data before total failure, the bad data is propagated like a virus to the other drives. The corruption returned by a failing drive is lovingly and redundantly replicated to the other drives in the RAID. This is the advantage of ZFS (or BTRFS). Blocks of data are checksummed and verified and corruption isolated and repaired. Yay for reliable data.
- baldfat 11y agoI have had one for four years. My Setup: OpenSUSE (BTRFS with their Snappy is awesome) Two drives that are redundant. CrashPlan for off site backup I also run my IRC (Weechat) on the box and glowing-bear.org as the front end and this is the BEST thing ever. Run my printer from the server and have a personal R-Studio and Juypter Notebook server running on it. I love it.
- lbenes 11y agoI'm about to either buy a home NAS or build my own with an atom Mini ITX. I plan to expand my array in the future. So is there any configuration that gives me the best of both worlds, ie the expandability of traditional RAID with checksums to prevent replicated errors?
- mozumder 11y agoWhat are the cheapest drives we can use for ZFS NAS for occasional media access? Can we use the absolute cheapest Western Digital Green drives, with limited lifespans? Does ZFS spin down drives when not in use? Actually, how long do the cheapest drives last when spinning 24x7? I ask because Best Buy has 5TB Western Digital drives for $110 today: http://www.bestbuy.com/site/wd-my-book-5tb-external-usb-3-0-hard-drive-black/4222407.p http://www.bestbuy.com/site/wd-my-book-5tb-external-usb-3-0-... But these consumer drives never list reliability figures, unlike data center drives.
- zer01 11y agoGreens would work, but are limited to 5400RPM so your data transfer rate will take a hit with that. Reds are WD's "NAS" drives, with some advanced features, but the Segate ST2000DM001/ST3000DM001 have worked very well for me with multiple years of almost constant data access. Sidenote: the upgrade from 4x2TB to 4x3TB was extremely simple, I just failed my drives over one at a time, so as long as you do everything at once you can expand everything really easily with ZFS.
- throwaway7767 11y agoThe seagates worked well for me for a long time when they were directly attached to SATA ports, until I got a chassis with a SAS backplane. Their firmware had some bugs which would stall all transfers on the whole backplane (not just the one disk) for about 30 seconds when there was a lot of activity. I switched to WD REDs after that, haven't had any issues since.
- zer01 11y agoReally? That's interesting (and shitty!). Thanks for the heads up!
- praseodym 11y agoI would definitely go for Red or other RAID/NAS type drives, because these are the only ones to have Time-Limited Error Recovery (TLER). Without this, your disk will hang for indefinite amounts of time when an error occurs. That means that a single sector read error can cause the entire disk to be thrown out of your RAID array, instead of letting the RAID system recover from the error gracefully.
- KaiserPro 11y agoSorry, but, no. If you've gone to the effort of getting a massive raid like that for home use, you need a backup. If you don't have a backup, stop reading, you're an arse. Run a full backup, check restoration. Blast away your NAS (its ZFS, relies on free space. The fuller it gets the slower it gets (unless you have SSDs or lots of write cache)) It's probably due and upgrade, (OS/XFS) re-arrange your array, you're changing the way you use it, so you need to do it. Restore data back over the top (with compression...) as for "it costs money" well thats why you chose zfs, for redundancy....
- ownagefool 11y agoIt depends what you're doing really. I run a 5 disk ZFS cluster to host media files. I'd rather not deal with failure very often, but when it does happen and I lose a whole bunch of media, I can download it again. The second I elect to host anything even remotly important on it, it'll be backed up, but until then there's no need for me to pay to host that elsewhere. Professionals who think they don't need backup's because they have redundancy do need a slap though.
- leni536 11y agoFor that use case ZFS seems overkill.
- ownagefool 11y agoPossibly, but what's the problem? It's pretty much a "just works" file system where you can lose 1-2 disks where blocks are continuously checksummed and scrubbed to ensure consistency. What exactly would you rather be using?
- coldtea 11y ago>If you've gone to the effort of getting a massive raid like that for home use, you need a backup. If you don't have a backup, stop reading, you're an arse. Or maybe I need to have large NAS in volume BUT for transient data sets which I could not care less to lose (and thus backup), which makes you an ass for ass-summing.
- stevejones 11y agoITT: people who've never done an online resize
- protomyth 11y agoThe BSD now podcast http://www.bsdnow.tv/episodes/2015_01_06-zfs_in_the_trenches http://www.bsdnow.tv/episodes/2015_01_06-zfs_in_the_trenches talks about this article and gives some solid recommendations on how to do your setup. It helps that one of the hosts co-wrote a book on ZFS.
- deleted 11y ago[deleted]
- Spooky23 11y agoWith the wide availability of cheap backup services like backblaze, this nas building nonsense is a complete waste of time. I have 3-4 direct attach usb and FireWire disks. One is a working disk, one backup, the rest for various things. If one of the working disks fails, I have a local backup. If they all fail, call backblaze. In all cases, I avoid wasting time and money setting up ersatz infrastructure that in reality is less reliable and more expensive than the simple solution.
- antongribok 11y agoYour solution does not protect you from silent data corruption.
- lmm 11y agoFor the tower of babel that is linux mdadm/lvm/... I agree, but ZFS really is trivial to get running, and easier to use than multiple disks - rather than worrying about what I put on each drive, and manually doing backups, I ran a couple of ZFS admin commands three years ago that told it to put all the disks in a big raidz, then stopped worrying about it. When a disk fails I replace it and run one command, no messing around restoring from backup / changing shortcuts / reinstalling.
- laumars 11y agoThat's great if your content can fit on one physical drive - but that's not the case for everyone. However, even that aside, I would likely still use ZFS even with your solution since I make sure of other ZFS features aside just running a software RAID (eg ZFS snapshots, checksumming, send/receive, etc).
- Amezarak 11y ago> With the wide availability of cheap backup services like backblaze, this nas building nonsense is a complete waste of time. My home upload speed is 3mbps. I make weekly image backups on top of my increment file backups. The images are ~800GB and 200GB. Additionally, I have a ~1TB media collection. Uploading the images to Backblaze weekly is clearly unfeasible. Restoring from old images in the event of a failure would be extremely time consuming. Therefore, I have a 14 TB NAS that should last me a long, long while and also serves as a Plex media server. To lose data I really care about requires that four drives / two computers fail or my house burns down. I am willing to accept that risk.
- arca_vorago 11y agoI know everyone is talking about btrfs and zfs, but I would just like to give a shoutout to DFLYBSD and HAMMER2, which is also doing great work in this regard (among other things)
- tw04 11y agoHAMMER2 has been in the works since 2012 and still isn't considered something you should put any data on that you care about. No offense to Matthew, and I applaud his hard work, but HAMMER2 isn't being mentioned because it isn't even part of the conversation. At this point we can't even be sure it will ever make it to a production ready state.
- arca_vorago 11y agoYou are correct about Hammer 2, but dont forget about Hammer 1.
- cpncrunch 11y agoThat's why I like Synology for a home NAS: you can just add/replace drives with a larger one any time you like, and the Synology box sorts it out.
- throw7 11y agoIn the article, adding a vdev of a raid-1 pair of disks would "break" raidz2 redundancy of the other vdevs. Why? Is it best practice that all vdevs in a zpool use the same RAID level?
- usefulcat 11y agoTo answer your second question, I think the answer is generally yes, because loss of any vdev in a pool means the entire pool is lost. For example, if you initially created the pool with a single raidz2 vdev, probably the only way it makes sense to add a second raidz1 vdev is if you later changed your mind about how important your data is.
- i336_ 11y agoIn case anybody's still reading this, I have a couple of use-case questions. I'm planning on setting up my first volume pool using 4 5TB Seagate ECs. I can't get any more than four to begin with. I was intending on using mirrored vdevs, as I'd heard that was basically the easiest way to get started. This is entirely for personal use, and I don't need "enterprise" read/write rates (the hardware I'll be starting with certainly won't manage that), and it won't be the end of the world for (very very rare) resilvers to take all night. Are there any advantages to not using mirroring, ie using one of the RAIDZ variants? I've already accepted the idea of having to buy new disks two at a time so I can spin up a new vdev with them.
- laumars 11y agoThe biggest advantage is storage space. You lose more potential storage space with mirroring since it's a 1:1, whereas as raidz1 across 4 drives would give you much more storage space but with the caveat that you can only lose 1 drive at a time before your entire pool is lost.
- i336_ 11y agoHmm. 15TB definitely sounds nicer than 10.... :D :D I fully intend to buy disks with widely spaced apart manufacturing dates, so theoretically this should be manageable. Now I get why 8 disks is recommended... you can make a mirrored pair of 4-disk raidz1s, you get >50% storage efficiency, and you can lose any two disks before it dies.
- mavhc 11y agoMy experience with ZFS on my home NAS: started with 6 2TB greens, 1 boot, 5 raidz1, got 5 3TB greens in another raidz1. One of each failed, replaced. Recently got 6 8TB SMR drives in a raidz2. Never used ECC ram, too expensive. No problem with LSI raid cards, or SAS backplane. Most important advice: People aren't kidding when they say your zpool will slow down when it's almost full. Online resizing of md arrays isn't reliable, my friend lost terabytes. ZFS is 10 years old, well tested.