<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Louwrentius - ZFS</title><link href="https://louwrentius.com/" rel="alternate"/><link href="https://louwrentius.com/feeds/zfs.atom.xml" rel="self"/><id>https://louwrentius.com/</id><updated>2021-06-22T12:00:00+02:00</updated><entry><title>ZFS RAIDZ expansion is awesome but has a small caveat</title><link href="https://louwrentius.com/zfs-raidz-expansion-is-awesome-but-has-a-small-caveat.html" rel="alternate"/><published>2021-06-22T12:00:00+02:00</published><updated>2021-06-22T12:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2021-06-22:/zfs-raidz-expansion-is-awesome-but-has-a-small-caveat.html</id><summary type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Update April 2023:&lt;/strong&gt;
It has been fairly quiet since the announcement of this feature.
The Github &lt;a href="https://github.com/openzfs/zfs/pull/12225"&gt;PR&lt;/a&gt; about this feature is rather stale and people are wondering what the status is and what the plans are. Meanwhile, FreeBSD has announced In February 2023 that they suspect to integrate RAIDZ …&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Update April 2023:&lt;/strong&gt;
It has been fairly quiet since the announcement of this feature.
The Github &lt;a href="https://github.com/openzfs/zfs/pull/12225"&gt;PR&lt;/a&gt; about this feature is rather stale and people are wondering what the status is and what the plans are. Meanwhile, FreeBSD has announced In February 2023 that they suspect to integrate RAIDZ expansion by Q3. &lt;/p&gt;
&lt;hr&gt;

&lt;hr /&gt;
&lt;p&gt;&lt;strong&gt;Update August 2025&lt;/strong&gt;
ZFS RAIDZ VDEV expansion has been released since &lt;a href="https://github.com/openzfs/zfs/releases/tag/zfs-2.3.0"&gt;OpenZFS release 2.3.0&lt;/a&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;One of my most popular blog articles is &lt;a href="https://louwrentius.com/the-hidden-cost-of-using-zfs-for-your-home-nas.html"&gt;this article&lt;/a&gt; about the "Hidden Cost of using ZFS for your home NAS". To summarise the key argument of this article:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Expanding ZFS-based storge can be relatively expensive / inefficient.&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;For example, if you run a ZFS pool based on a single 3-disk RAIDZ vdev (RAID5 equivalent&lt;sup id="fnref:raidz"&gt;&lt;a class="footnote-ref" href="#fn:raidz"&gt;1&lt;/a&gt;&lt;/sup&gt;), the only way to expand a pool is to add another 3-disk RAIDZ vdev&lt;sup id="fnref:rd"&gt;&lt;a class="footnote-ref" href="#fn:rd"&gt;2&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;You can't just add a single disk to the existing 3-disk RAIDZ vdev to create a 4-disk RAIDZ vdev because vdevs can't be expanded.&lt;/p&gt;
&lt;p&gt;The impact of this limitation is that you have to buy all storage upfront even if you don't need the space for years to come.&lt;/p&gt;
&lt;p&gt;Otherwise, by expanding with additional vdevs you lose capacity to parity you may not really want/need, which also limits the maximum usable capacity of your NAS.&lt;/p&gt;
&lt;h2&gt;RAIDZ vdev expansion&lt;/h2&gt;
&lt;p&gt;Fortunately, this limitation of ZFS is being addressed! &lt;/p&gt;
&lt;p&gt;ZFS founder Matthew Ahrens created a &lt;a href="https://github.com/openzfs/zfs/pull/12225"&gt;pull request&lt;/a&gt; around June 11, 2021 detailing a new ZFS feature that would allow for RAIDZ vdev expansion.&lt;/p&gt;
&lt;p&gt;Finally, ZFS users will be able to expand their storage by adding just one single drive at a time. This feature will make it possible to expand storage as-you-go, which is especially of interest to budget conscious home users&lt;sup id="fnref:larger"&gt;&lt;a class="footnote-ref" href="#fn:larger"&gt;3&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://arstechnica.com/author/jimsalter/"&gt;Jim Salter&lt;/a&gt; has written a &lt;a href="https://arstechnica.com/gadgets/2021/06/raidz-expansion-code-lands-in-openzfs-master/"&gt;good article&lt;/a&gt; about this on Ars Technica.&lt;/p&gt;
&lt;h2&gt;There is still a caveat&lt;/h2&gt;
&lt;p&gt;Existing data will be &lt;em&gt;redistributed&lt;/em&gt; or &lt;em&gt;rebalanced&lt;/em&gt; over all drives, including the freshly added drive. However, the data that was already stored on the vdev will not be &lt;em&gt;restriped&lt;/em&gt; after the vdev is expanded. This means that this data is stored with the older, &lt;em&gt;less efficient&lt;/em&gt; parity-to-data ratio. &lt;/p&gt;
&lt;p&gt;I think Matthew Ahrends explains it best in his own words:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;After the expansion completes, old blocks remain with their old data-to-parity ratio (e.g. 5-wide RAIDZ2, has 3 data to 2 parity), but distributed among the larger set of disks. New blocks will be written with the new data-to-parity ratio (e.g. a 5-wide RAIDZ2 which has been expanded once to 6-wide, has 4 data to 2 parity). However, the RAIDZ vdev&amp;#39;s &amp;quot;assumed parity ratio&amp;quot; does not change, so slightly less space than is expected may be reported for newly-written blocks, according to zfs list, df, ls -s, and similar tools.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So, if you add a new drive to a RAIDZ vdev, you'll notice that after expansion, you will have &lt;em&gt;less&lt;/em&gt; capacity available than you would theoretically expect.&lt;/p&gt;
&lt;p&gt;However, it is even more important to understand that this effect &lt;em&gt;accumulates&lt;/em&gt;. This is especially relevant for home users. &lt;/p&gt;
&lt;p&gt;I think that the whole concept of starting with a small number of disks and expand-as-you-go is very desirable and typical for home users. But this also means that every time a disk is added to the vdev, existing data is still stored with the old data-to-parity rate. &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Imagine that we have a 10-drive chassis and we start out with a 4-drive RAIDZ2.&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;If we keep adding drives&lt;sup id="fnref:gofrom"&gt;&lt;a class="footnote-ref" href="#fn:gofrom"&gt;4&lt;/a&gt;&lt;/sup&gt; conform this example, until the chassis is full at 10 drives, about 1.35 drives worth of capacity is 'lost' to parity overhead/efficiency loss&lt;sup id="fnref:full"&gt;&lt;a class="footnote-ref" href="#fn:full"&gt;5&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;That is quite a lot of overhead or loss of capacity, I think.&lt;/p&gt;
&lt;p&gt;How is this overhead calculated? If we would just buy 10 drives and create a 10-drive RAIDZ2 vdev, data-to-parity overhead is 20% meaning that 20% of the total raw capacity of the vdev is used for storing parity. This is the most efficient scenario in this case.&lt;/p&gt;
&lt;p&gt;When we start out with the four-drive RAIDZ2 vdev, the data-to-parity overhead is 50%. That's a 30% overhead difference compared to the 'ideal' 10-drive setup.&lt;/p&gt;
&lt;p&gt;As we keep adding drives, the relative overhead of the parity keeps dropping so we end up with 'multiple data sets' with different data-to-parity ratios, that are less efficient than the end-stage of 10 drives.&lt;/p&gt;
&lt;p&gt;I created a google sheet to roughly estimate this overhead for each stage, but my math was totally off. Fortunately, &lt;a href="https://www.truenas.com/community/members/yorick.90628/"&gt;Yorick&lt;/a&gt; rewrote the sheet, which &lt;a href="https://docs.google.com/spreadsheets/d/1qiDPfLN-K88FMHMxcgtkxswY5Wtu7h9tBAOgJfnO7VE/edit?usp=sharing"&gt;can be found here&lt;/a&gt;. Thanks Yorick! Further more, Truenas user DayBlur shared &lt;a href="https://www.truenas.com/community/threads/raidz-expansion-its-happening.58575/post-649578"&gt;additional insights&lt;/a&gt; on the calculations if you are interested in that.&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://docs.google.com/spreadsheets/d/1qiDPfLN-K88FMHMxcgtkxswY5Wtu7h9tBAOgJfnO7VE/edit?usp=sharing"&gt;google sheet&lt;/a&gt; allows you to play with various variables to estimate how much capacity is lost for a given scenario. Please note that any losses that may arise because a number of drives is used that requires data to be padded - as discussed in the Ars Technica article - are not part of the calculation.&lt;/p&gt;
&lt;p&gt;It is a bit unfortunate that especially in the scenario of the home user who want to start small and expand-as-you go that this overhead manifests itself so much. But there is good news!&lt;/p&gt;
&lt;h2&gt;Lost capacity can be recovered!&lt;/h2&gt;
&lt;p&gt;The overhead or 'lost capacity' can be &lt;em&gt;recovered&lt;/em&gt; by &lt;em&gt;rewriting&lt;/em&gt; existing data after the vdev has been expanded, because the data will then be written with the more efficient parity-to-data ratio of the larger vdev.&lt;/p&gt;
&lt;p&gt;Rewriting all data may take quite some time and you may opt to postpone this step until the vdev has been expanded a couple of times so the parity-to-data ratio is now 'good enough' that significant storage gains can be had by rewriting the data.&lt;/p&gt;
&lt;p&gt;Because capacity lost to overhead can be fully recovered, I think that this caveat is relatively minor, especially compared to the old situation where we had to expand a pool with entire vdevs and there was no way to recover any overhead.&lt;/p&gt;
&lt;p&gt;There is currently no build-in mechanism to trigger this data rewrite as part of the native ZFS tools. This will be a manual process until somebody may create a script that automates this process. According to Matthew Ahrens, restriping the data as part of the vdev expansion process would be an effort &lt;a href="https://github.com/openzfs/zfs/pull/12225#issuecomment-860075460"&gt;of similar scale&lt;/a&gt; as the RAIDZ expansion itself.&lt;/p&gt;
&lt;h2&gt;Evaluation&lt;/h2&gt;
&lt;p&gt;I think it cannot be stated enough how &lt;em&gt;awesome&lt;/em&gt; the RAIDZ vdev expansion feature is, especially for home users who want to start small and grow their storage over time. &lt;/p&gt;
&lt;p&gt;Although the expansion process can accumulate quite a bit of overhead, that overhead can be recovered by rewriting existing data, which is probably not a problem for most people.&lt;/p&gt;
&lt;p&gt;Despite all the awesome features and capabilities of ZFS, I think quite a few home users went with other storage solutions because of the relatively high expansion cost/overhead. Now that this barrier will be overcome, I think that ZFS will be more accessible to the home user DIY NAS crowd.&lt;/p&gt;
&lt;h2&gt;Release timeline&lt;/h2&gt;
&lt;p&gt;According to the Ars Technica article by Jim Salter, this feature will probably become available in August 2022, so we need to have some patience. Even so, you might want to already decide to build your new DIY NAS based on ZFS: by the time you may need to expand your storage, the feature may be available!&lt;/p&gt;
&lt;h2&gt;Update on some - in my opinion - bad advice&lt;/h2&gt;
&lt;p&gt;The podcast &lt;a href="https://2.5admins.com"&gt;2.5 admins&lt;/a&gt; (which I enjoy listening to) discussed the topic of RAIDZ expansion in &lt;a href="https://2.5admins.com/2-5-admins-45/"&gt;episode 45&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There are two remarks made that I want to address, because I disagree with them.&lt;/p&gt;
&lt;h3&gt;Don't rewrite the data?&lt;/h3&gt;
&lt;p&gt;As in his Ars Technica article, Jim Salter keeps advocating not to bother rewriting the data after a vdev expansion, but I personally disagree with this advice. I hope I have demonstrated that if you keep adding drives, the parity overhead is significant enough for most home users to make it worthwhile to rewrite the data after a few drives have been added.&lt;/p&gt;
&lt;h3&gt;Just use mirrors!&lt;/h3&gt;
&lt;p&gt;I also disagree with the advice of &lt;a href="https://2.5admins.com"&gt;using mirrors&lt;/a&gt;, especially for home users&lt;sup id="fnref:whyilink"&gt;&lt;a class="footnote-ref" href="#fn:whyilink"&gt;6&lt;/a&gt;&lt;/sup&gt;. I personally think it is bad advice, because home users have other needs and desires as enterprise environments. &lt;/p&gt;
&lt;p&gt;If 'just use mirrors' is still the advice, why did Matthew Ahrends build the whole RAIDZ vdev expansion feature in the first place? I think the RAIDZ vdev expansion is really beneficial for home users.&lt;/p&gt;
&lt;p&gt;Maybe Jim and I have very different ideas about what a home user would want or need in a DIY NAS storage solution. I think that home users want this:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;As much storage as possible for as little money as possible with acceptable redundancy.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In addition, I think that home users in general work with larger files (multiple megabytes at least). And if they sometimes work with smaller files, they accept some performance loss due to the lower random I/O performance of single RAIDZ vdevs&lt;sup id="fnref:ssds"&gt;&lt;a class="footnote-ref" href="#fn:ssds"&gt;7&lt;/a&gt;&lt;/sup&gt;. &lt;/p&gt;
&lt;p&gt;Frankly, to me it feels like the 'just use mirrors' advice is used to 'downplay' a significant limitation of ZFS&lt;sup id="fnref:ale"&gt;&lt;a class="footnote-ref" href="#fn:ale"&gt;8&lt;/a&gt;&lt;/sup&gt;. Jim is a prolific writer on Ars Technica and has a large audience so his advice matters. So that's why I think it's sad that he sticks with 'just use mirrors' while that's clearly not in the best interest of most home users. &lt;/p&gt;
&lt;p&gt;However, that's just my opinion, you decide for yourself what's best.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id="fn:raidz"&gt;
&lt;p&gt;Just to illustrate the level of redundancy in terms of how many disks can be lost and still be operational.&amp;#160;&lt;a class="footnote-backref" href="#fnref:raidz" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:rd"&gt;
&lt;p&gt;The other method is to replace all existing drives one by one with larger ones. Only after you have replaced all drives will you be able to gain extra capacity so this method has a similar downside as just expanding with extra vdevs: you must buy multiple drives at once. In addition, I think this method is rather time consuming and cumbersome although people do use it to expand capacity. And to be fair: you can indeed add 4+ disk vdevs, vdevs with a higher RAIDZ level or mirrors but none of that makes sense in this context.&amp;#160;&lt;a class="footnote-backref" href="#fnref:rd" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:larger"&gt;
&lt;p&gt;I personally think that it's even great for small and medium business owners. Only larger businesses want to keep adding relatively large vdevs consisting of multiple drives because if they keep expanding with just one drive at a time, they may have to expand capacity very frequently which may not be practical.&amp;#160;&lt;a class="footnote-backref" href="#fnref:larger" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:gofrom"&gt;
&lt;p&gt;So you go from four to five drives. Then from five to six drives, and so on.&amp;#160;&lt;a class="footnote-backref" href="#fnref:gofrom" title="Jump back to footnote 4 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:full"&gt;
&lt;p&gt;If you would only upgrade once the pool is almost full - not recommended! - that overhead grows to 1.69 drives.&amp;#160;&lt;a class="footnote-backref" href="#fnref:full" title="Jump back to footnote 5 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:whyilink"&gt;
&lt;p&gt;I link to the original article by Jim Salter because I want to allow you to read the article and make up your own mind and not just listen to me.&amp;#160;&lt;a class="footnote-backref" href="#fnref:whyilink" title="Jump back to footnote 6 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:ssds"&gt;
&lt;p&gt;If random I/O performance is important, it is probably wise to go for SSD based storage anyway.&amp;#160;&lt;a class="footnote-backref" href="#fnref:ssds" title="Jump back to footnote 7 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:ale"&gt;
&lt;p&gt;resolved by by ZFS vdev expansion obviously, when it lands in production.&amp;#160;&lt;a class="footnote-backref" href="#fnref:ale" title="Jump back to footnote 8 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="ZFS"/><category term="Storage"/></entry><entry><title>Why I Do Use ZFS as a File System for My NAS</title><link href="https://louwrentius.com/why-i-do-use-zfs-as-a-file-system-for-my-nas.html" rel="alternate"/><published>2015-01-29T12:00:00+01:00</published><updated>2015-01-29T12:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2015-01-29:/why-i-do-use-zfs-as-a-file-system-for-my-nas.html</id><summary type="html">&lt;p&gt;On February 2011, I posted an article about my motivations &lt;a href="https://louwrentius.com/why-i-do-not-use-zfs-as-a-file-system-for-my-nas.html"&gt;why I did &lt;em&gt;not&lt;/em&gt; use ZFS&lt;/a&gt; as a file system for my &lt;a href="https://louwrentius.com/20-disk-18-tb-raid-6-storage-based-on-debian-linux.html"&gt;18 TB NAS&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;You have to understand that &lt;em&gt;at the time&lt;/em&gt;, I believe the arguments in the article were relevant, but much has changed since then, and I …&lt;/p&gt;</summary><content type="html">&lt;p&gt;On February 2011, I posted an article about my motivations &lt;a href="https://louwrentius.com/why-i-do-not-use-zfs-as-a-file-system-for-my-nas.html"&gt;why I did &lt;em&gt;not&lt;/em&gt; use ZFS&lt;/a&gt; as a file system for my &lt;a href="https://louwrentius.com/20-disk-18-tb-raid-6-storage-based-on-debian-linux.html"&gt;18 TB NAS&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;You have to understand that &lt;em&gt;at the time&lt;/em&gt;, I believe the arguments in the article were relevant, but much has changed since then, and I do believe this article is not relevant anymore.&lt;/p&gt;
&lt;p&gt;My stance on ZFS is in the context of a &lt;em&gt;home NAS build&lt;/em&gt;. &lt;/p&gt;
&lt;p&gt;I really recommend giving ZFS a serious consideration if you are building your own NAS. It's probably the best file system you can use if you care about data integrity.&lt;/p&gt;
&lt;p&gt;ZFS may only be available for non-Windows operating systems, but there are quite a few easy-to-use NAS distros available that turn your hardware into a full-featured home NAS box, that can be managed through your web browser. A few examples:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.freenas.org/"&gt;FreeNAS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.nas4free.org"&gt;NAS4free&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://zfsguru.com"&gt;ZFSguru&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I also want to add this: I don't think it's &lt;em&gt;wrong&lt;/em&gt; or particular risky if you - as a home NAS builder - would decide &lt;strong&gt;not&lt;/strong&gt; to use ZFS and select a 'legacy' solution if that better suits your needs. I think that proponents of ZFS often overstate the risks ZFS mitigates a bit, maybe to promote ZFS. I do think those risks are relevant but it all depends on your circumstances. So you decide.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;May 2016:&lt;/strong&gt; I have also written a &lt;a href="https://louwrentius.com/should-i-use-zfs-for-my-home-nas.html"&gt;separate article&lt;/a&gt;  on how I feel about using ZFS for DIY home NAS builds.&lt;/p&gt;
&lt;p&gt;Arstechnica article about &lt;a href="http://arstechnica.com/information-technology/2014/06/the-ars-nas-distribution-shootout-freenas-vs-nas4free/1/"&gt;FreeNAS vs NAS4free&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you are quite familiar with FreeBSD or Linux, I do recommend this &lt;a href="http://arstechnica.com/information-technology/2014/02/ars-walkthrough-using-the-zfs-next-gen-filesystem-on-linux/"&gt;ZFS how-to article&lt;/a&gt; from Arstechnica. It offers a very nice introduction to ZFS and explains terms like 'pool' and 'vdev'. &lt;/p&gt;
&lt;p&gt;If you are planning on using ZFS for your own home NAS, I would recommend reading the following articles:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://louwrentius.com/the-hidden-cost-of-using-zfs-for-your-home-nas.html"&gt;Things you should consider when building a ZFS NAS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://louwrentius.com/things-you-should-consider-when-building-a-zfs-nas.html"&gt;The 'hidden' cost of ZFS for your home NAS build&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;My historical reasons for not using ZFS at the time&lt;/h3&gt;
&lt;p&gt;When I started with my 18 TB NAS in 2009, there was no such thing as ZFS for Linux. ZFS was only available in a stable version for Open Solaris. We all know what happened to Open Solaris &lt;a href="http://en.wikipedia.org/wiki/OpenSolaris"&gt;(it's gone)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So you might ask: "Why not use ZFS on FreeBSD then?". Good question, but it was bad timing:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;The FreeBSD implementation of ZFS became only stable [sic] in January 2010, 6 months after I build my NAS (summer 2009). So FreeBSD was not an option at that time.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;One of the other objections against ZFS is the fact that you cannot expand your storage by adding single drives and growing the array as your data set grows. &lt;/p&gt;
&lt;p&gt;A ZFS pool consists of one or more VDEVs. A VDEV is a traditional RAID-array. You expand storage capacity by expanding the ZFS pool, not the VDEVS. You cannot expand the VDEV itself. You can only add VDEVS to a pool. &lt;/p&gt;
&lt;p&gt;So ZFS either forces you to invest in storage you don't need upfront, or it forces you invest later on because you may waste quite a few extra drives on parity. For example, if you start with a 6-drive RAID6 (RAIDZ) configuration, you will probably expand with another 6 drives. So the pool has 4 parity drives on 12 total drives (33% loss). Investing upfront in 10 drives instead of 6 would have been more efficient because you only lose 2 drives out of 10 to parity (20% loss).&lt;/p&gt;
&lt;p&gt;So at the time, I found it reasonable to stick with what I knew: Linux &amp;amp; MDADM.&lt;/p&gt;
&lt;p&gt;But my &lt;a href="https://louwrentius.com/71-tib-diy-nas-based-on-zfs-on-linux.html"&gt;new 71 TiB NAS&lt;/a&gt; is based on ZFS.&lt;/p&gt;
&lt;p&gt;I wrote &lt;a href="https://louwrentius.com/the-future-of-zfs-now-that-opensolaris-is-dead.html"&gt;an article&lt;/a&gt; about my worry that ZFS may die with FreeBSD as it sole backing, but fortunately, I've been proven very, very wrong.&lt;/p&gt;
&lt;p&gt;ZFS is now supported on FreeBSD and &lt;a href="http://zfsonlinux.org"&gt;Linux&lt;/a&gt;. Despite some licencing issues that prevent ZFS from being integrated in the Linux kernel itself, it can still be used as a regular kernel module and it works perfectly. &lt;/p&gt;
&lt;p&gt;There is even an &lt;a href="http://open-zfs.org/wiki/Main_Page"&gt;open-source ZFS consortium&lt;/a&gt; that brings together all the developers for the different operating systems supporting ZFS.&lt;/p&gt;
&lt;p&gt;ZFS is here to stay for a very long time. &lt;/p&gt;</content><category term="ZFS"/><category term="ZFS"/></entry><entry><title>The ZFS Event Daemon on Linux</title><link href="https://louwrentius.com/the-zfs-event-daemon-on-linux.html" rel="alternate"/><published>2014-08-29T23:00:00+02:00</published><updated>2014-08-29T23:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2014-08-29:/the-zfs-event-daemon-on-linux.html</id><summary type="html">&lt;p&gt;If something goes wrong with my zpool, I'd like to be notified by email. On Linux using MDADM, the MDADM daemon took care of that.&lt;/p&gt;
&lt;p&gt;With the release of &lt;a href="https://groups.google.com/a/zfsonlinux.org/forum/#!topic/zfs-announce/Lj7xHtRVOM4"&gt;ZoL 0.6.3&lt;/a&gt;, a brand new 'ZFS Event Daemon' or &lt;a href="https://www.youtube.com/watch?v=y7Yp2L6c2KM"&gt;ZED&lt;/a&gt; has been introduced. &lt;/p&gt;
&lt;p&gt;I could not find much information …&lt;/p&gt;</summary><content type="html">&lt;p&gt;If something goes wrong with my zpool, I'd like to be notified by email. On Linux using MDADM, the MDADM daemon took care of that.&lt;/p&gt;
&lt;p&gt;With the release of &lt;a href="https://groups.google.com/a/zfsonlinux.org/forum/#!topic/zfs-announce/Lj7xHtRVOM4"&gt;ZoL 0.6.3&lt;/a&gt;, a brand new 'ZFS Event Daemon' or &lt;a href="https://www.youtube.com/watch?v=y7Yp2L6c2KM"&gt;ZED&lt;/a&gt; has been introduced. &lt;/p&gt;
&lt;p&gt;I could not find much information about it, so consider this article my notes on this new service.&lt;/p&gt;
&lt;p&gt;If you want to receive alerts there is only one requirement: you must setup an MTA on your machine and that is outside the scope of this article.&lt;/p&gt;
&lt;p&gt;When you install ZoL, the ZED daemon is installed automatically and will start on boot. &lt;/p&gt;
&lt;p&gt;The configuration file for ZED can be found here: &lt;em&gt;/etc/zfs/zed.d/zed.rc&lt;/em&gt;. Just uncomment the "ZED_EMAIL=" section and fill out your email address. Don't forget to restart the service.&lt;/p&gt;
&lt;p&gt;ZED seems to hook into the zpool event log that is kept in the kernel and monitors these events in real-time.&lt;/p&gt;
&lt;p&gt;You can see those events yourself:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@debian:/etc/zfs/zed.d# zpool events
TIME                           CLASS
Aug 29 2014 16:53:01.872269662 resource.fs.zfs.statechange
Aug 29 2014 16:53:01.873291940 resource.fs.zfs.statechange
Aug 29 2014 16:53:01.962528911 ereport.fs.zfs.config.sync
Aug 29 2014 16:58:40.662619739 ereport.fs.zfs.scrub.start
Aug 29 2014 16:58:40.670865689 ereport.fs.zfs.checksum
Aug 29 2014 16:58:40.671888655 ereport.fs.zfs.checksum
Aug 29 2014 16:58:40.671905612 ereport.fs.zfs.checksum
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can see that a scrub was started and that incorrect checksums were discovered. A few seconds later I received an email:&lt;/p&gt;
&lt;p&gt;The first email:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;A ZFS checksum error has been detected:

  eid: 5
 host: debian
 time: 2014-08-29 16:58:40+0200
 pool: storage
 vdev: disk:/dev/sdc1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And soon thereafter:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;A ZFS pool has finished scrubbing:

  eid: 908
 host: debian
 time: 2014-08-29 16:58:51+0200
 pool: storage
state: ONLINE
status: One or more devices has experienced an unrecoverable error.  An
    attempt was made to correct the error.  Applications are unaffected.
action: Determine if the device needs to be replaced, and clear the errors
    using &amp;#39;zpool clear&amp;#39; or replace the device with &amp;#39;zpool replace&amp;#39;.
  see: http://zfsonlinux.org/msg/ZFS-8000-9P
 scan: scrub repaired 100M in 0h0m with 0 errors on Fri Aug 29 16:58:51 2014
config:

    NAME        STATE     READ WRITE CKSUM
    storage     ONLINE       0     0     0
      mirror-0  ONLINE       0     0     0
        sdb     ONLINE       0     0     0
        sdc     ONLINE       0     0   903

errors: No known data errors
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Awesome!&lt;/p&gt;
&lt;p&gt;The ZED daemon executes commands based on the &lt;em&gt;event class&lt;/em&gt;. So it can do more than just send emails, you can customise different actions based on the event class. The event class can be seen in the &lt;em&gt;zpool events&lt;/em&gt; output.&lt;/p&gt;
&lt;p&gt;One of the more interesting features is automatic replacement of a defect drive with a hot spare, so full fault tolerance is restored as soon as possible. &lt;/p&gt;
&lt;p&gt;I've not been able to get this to work. The ZED scripts would not automatically replace a failed/faulted drive. &lt;/p&gt;
&lt;p&gt;There seem to be some &lt;a href="https://github.com/zfsonlinux/zfs/pull/2085"&gt;known issues&lt;/a&gt;. The fixes seem to be in a pending pull request.&lt;/p&gt;
&lt;p&gt;Just to make sure I got alerted, I've simulated the ZED configuration for my production environment in a VM. &lt;/p&gt;
&lt;p&gt;I simulated a drive failure with dd as stated earlier, but the result was that for every checksum error I received one email. With thousands of checksum errors, I had to clear 1000+ emails from my inbox. &lt;/p&gt;
&lt;p&gt;It seems that this option, which is uncommented by default, was not enabled.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;ZED_EMAIL_INTERVAL_SECS=&amp;quot;3600&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This option implements a cool-down period where an event is just reported once and suppressed afterwards until the interval expires. &lt;/p&gt;
&lt;p&gt;It would be best if this option would be enabled by default.&lt;/p&gt;
&lt;p&gt;The ZED authors acknowledge that ZED is a bit rough around the edges, but it sends out alerts consistently and that's what I was looking for, so I'm happy.&lt;/p&gt;</content><category term="ZFS"/><category term="ZFS event daemon"/></entry><entry><title>Installation of ZFS on Linux hangs on Debian Wheezy</title><link href="https://louwrentius.com/installation-of-zfs-on-linux-hangs-on-debian-wheezy.html" rel="alternate"/><published>2014-08-29T12:00:00+02:00</published><updated>2014-08-29T12:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2014-08-29:/installation-of-zfs-on-linux-hangs-on-debian-wheezy.html</id><summary type="html">&lt;p&gt;&lt;strong&gt;This article is no longer relevant.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After a fresh net-install of Debian Wheezy, I was unable to compile the ZFS for Linux kernel module. I've installed &lt;em&gt;apt-get install build-essential&lt;/em&gt; but that wasn't enough.&lt;/p&gt;
&lt;p&gt;The &lt;em&gt;apt-get install debian-zfs&lt;/em&gt; command would just hang. &lt;/p&gt;
&lt;p&gt;I noticed a 'configure' process and I killed it …&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;strong&gt;This article is no longer relevant.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After a fresh net-install of Debian Wheezy, I was unable to compile the ZFS for Linux kernel module. I've installed &lt;em&gt;apt-get install build-essential&lt;/em&gt; but that wasn't enough.&lt;/p&gt;
&lt;p&gt;The &lt;em&gt;apt-get install debian-zfs&lt;/em&gt; command would just hang. &lt;/p&gt;
&lt;p&gt;I noticed a 'configure' process and I killed it, and after a few seconds, the installer continued after spewing out this error:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Building initial module for 3.2.0-4-amd64
Error! Bad return status for module build on kernel: 3.2.0-4-amd64 (x86_64)
Consult /var/lib/dkms/zfs/0.6.3/build/make.log for more information.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So I ran ./configure manually inside the mentioned directory and then I got this error:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;checking for zlib.h... no
configure: error: in `/var/lib/dkms/zfs/0.6.3/build&amp;#39;:
configure: error: 
    *** zlib.h missing, zlib-devel package required
See `config.log&amp;#39; for more details
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So I ran &lt;em&gt;apt-get install zlib1g-dev&lt;/em&gt; and no luck:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;checking for uuid/uuid.h... no
configure: error: in `/var/lib/dkms/zfs/0.6.3/build&amp;#39;:
configure: error: 
    *** uuid/uuid.h missing, libuuid-devel package required
See `config.log&amp;#39; for more details
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I searched a bit online and then I found &lt;a href="http://osdir.com/ml/zfs-discuss/2014-04/msg00330.html"&gt;this link&lt;/a&gt; that listed some additional packages that may be missing and I installed them all with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;apt-get install zlib1g-dev uuid-dev libblkid-dev libselinux-dev parted
lsscsi wget
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This time the ./configure went fine and I could manually &lt;em&gt;make install&lt;/em&gt; the kernel module and import my existing pool.&lt;/p&gt;</content><category term="ZFS"/><category term="ZFS Wheezy"/></entry><entry><title>Please use ZFS with ECC Memory</title><link href="https://louwrentius.com/please-use-zfs-with-ecc-memory.html" rel="alternate"/><published>2014-08-27T12:00:00+02:00</published><updated>2014-08-27T12:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2014-08-27:/please-use-zfs-with-ecc-memory.html</id><summary type="html">&lt;p&gt;In this blogpost I argue why it's strongly recommended to use ZFS with ECC memory when building a NAS. I would argue that if you do not use ECC memory, it's reasonable to also forgo on ZFS altogether and use any (legacy) file system that suits your needs.&lt;/p&gt;
&lt;h3&gt;Why ZFS …&lt;/h3&gt;</summary><content type="html">&lt;p&gt;In this blogpost I argue why it's strongly recommended to use ZFS with ECC memory when building a NAS. I would argue that if you do not use ECC memory, it's reasonable to also forgo on ZFS altogether and use any (legacy) file system that suits your needs.&lt;/p&gt;
&lt;h3&gt;Why ZFS?&lt;/h3&gt;
&lt;p&gt;Many people consider using ZFS when they are planning to build their own NAS.
This is for good reason: ZFS is an excellent choice for a NAS file system. There are many reasons why ZFS is such a fine choice, but the most important one is probably 'data integrity'. Data integrity was one of the &lt;a href="http://www.oracle.com/technetwork/server-storage/solaris11/documentation/oraclesolariszfsstoragemanagement-360232.pdf"&gt;primary design goals&lt;/a&gt; of ZFS.&lt;/p&gt;
&lt;p&gt;ZFS assures that any corrupt data served by the underlying storage system is either detected or - if possible - corrected by using checksums and parity. This is why ZFS is so interesting for NAS builders: it's OK to use inexpensive (consumer) hard drives and solid state drives and not worry about data integrity. &lt;/p&gt;
&lt;p&gt;I will not go into the details, but for completeness I will also state that ZFS can make the difference between losing an entire RAID array or just a few files, because of the way it handles read errors as compared to 'legacy' hardware/software RAID solutions.&lt;/p&gt;
&lt;h3&gt;Understanding ECC memory&lt;/h3&gt;
&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/ECC_memory"&gt;ECC memory&lt;/a&gt; or Error Correcting Code memory, contains extra parity data so the integrity of the data in memory can be verified and even corrected. ECC memory can correct single bit errors and detect multiple bit errors per word&lt;sup id="fnref:word"&gt;&lt;a class="footnote-ref" href="#fn:word"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;What's most interesting is how a system with ECC memory reacts to bit errors that cannot be corrected. Because it's how a system with ECC memory responds to uncorrectable bit errors that that makes all the difference in the world. &lt;/p&gt;
&lt;p&gt;If multiple bits are corrupted within a single word, the CPU will detect the errors, but will not be able to correct them. When the CPU notices that there are uncorrectable bit errors in memory, it will 
generate an &lt;a href="http://en.wikipedia.org/wiki/Machine-check_exception"&gt;MCE&lt;/a&gt; that will be handled by the operating system. In most cases, this will result in a &lt;em&gt;halt&lt;/em&gt;&lt;sup id="fnref:halt"&gt;&lt;a class="footnote-ref" href="#fn:halt"&gt;2&lt;/a&gt;&lt;/sup&gt; of the system.&lt;/p&gt;
&lt;p&gt;This behaviour will lead to a system crash, but it prevents data corruption. It prevents the bad bits from being processed by the operating system and/or applications where it may wreak havoc.&lt;/p&gt;
&lt;p&gt;ECC memory is standard on all server hardware sold by all major vendors like HP, Dell, IBM, Supermicro and so on. This is for good reason, because &lt;a href="http://www.cs.toronto.edu/~bianca/papers/sigmetrics09.pdf"&gt;memory errors are the norm, not the exception&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;The question is really why not &lt;em&gt;all&lt;/em&gt; computers, including desktop and laptops, use ECC memory instead of non-ECC memory. The most important reason seems to be 'cost'. &lt;/p&gt;
&lt;p&gt;It is more expensive to use ECC memory than non-ECC memory. This is not only because ECC memory itself is more expensive. ECC memory requires a motherboard with support for ECC memory, and these motherboards tend to be more expensive as well. &lt;/p&gt;
&lt;p&gt;non-ECC Memory is reliable enough that you won't have an issue most of the time. And when it does go wrong, you just blame Microsoft or Apple&lt;sup id="fnref:desktopecc"&gt;&lt;a class="footnote-ref" href="#fn:desktopecc"&gt;3&lt;/a&gt;&lt;/sup&gt;. For desktops, the impact of a memory failure is less of an issue than on servers. But remember, your NAS is your own (home) server. There is some &lt;a href="http://research.microsoft.com/pubs/144888/eurosys84-nightingale.pdf"&gt;evidence&lt;/a&gt; that memory errors are abundant&lt;sup id="fnref:mstudy"&gt;&lt;a class="footnote-ref" href="#fn:mstudy"&gt;4&lt;/a&gt;&lt;/sup&gt; on desktop systems. &lt;/p&gt;
&lt;p&gt;The price difference is small enough not to be relevant for businesses, but for the price-conscious consumer, it is a factor. A system based on ECC memory may cost in the range of $150 - $200 more than a system based on non-ECC memory.&lt;/p&gt;
&lt;p&gt;It's up to you if you want to spend this extra money. Why you are advised to do so will be discussed in the next paragraphs.&lt;/p&gt;
&lt;h3&gt;Why ECC memory is important to ZFS&lt;/h3&gt;
&lt;p&gt;ZFS trusts the contents of memory blindly. Please note that ZFS has no mechanisms to cope with bad memory. It is similar to every other file system in this regard. &lt;a href="http://research.cs.wisc.edu/wind/Publications/zfs-corruption-fast10.pdf"&gt;Here is a nice paper&lt;/a&gt; about ZFS and how it handles corrupt memory (it doesnt!).&lt;/p&gt;
&lt;p&gt;In the best case, bad memory corrupts file data and causes a few garbled files. In the worst case, bad memory mangles in-memory ZFS file system (meta) data structures, which may lead to corruption and thus loss of the entire zpool.&lt;/p&gt;
&lt;p&gt;It is important to put this into perspective. There is only a &lt;em&gt;practical&lt;/em&gt; reason why ECC memory is &lt;em&gt;more important&lt;/em&gt; for ZFS as compared to other file systems. Conceptually, ZFS does not require ECC memory any more as any other file system. &lt;/p&gt;
&lt;p&gt;Or let &lt;a href="http://www.open-zfs.org/wiki/User:Mahrens"&gt;Matthew Ahrens&lt;/a&gt;, the co-founder of the ZFS project &lt;a href="http://arstechnica.com/civis/viewtopic.php?f=2&amp;amp;t=1235679&amp;amp;p=26303271#p26303271"&gt;phrase it&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;There&amp;#39;s nothing special about ZFS that requires/encourages the use of ECC RAM more so than 
any other filesystem. If you use UFS, EXT, NTFS, btrfs, etc without ECC RAM, you are just as much at risk as if you used ZFS without ECC RAM. I would simply say: if you love your data, use ECC RAM. Additionally, use a filesystem that checksums your data, such as ZFS.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now this is the important part. File systems such as NTFS, EXT4, etc &lt;em&gt;have (data recovery) tools&lt;/em&gt; that may allow you to rescue your files when things go bad due to bad memory. ZFS does not have such tools, if the pool is corrupt, all data must be considered lost, there is no option for recovery. &lt;/p&gt;
&lt;p&gt;So the impact of bad memory can be more devastating on a system with ZFS than on a system with NTFS, EXT4, XFS, etcetera. ZFS may force you to restore your data from backups sooner. Oh by the way, you, make backups right?&lt;/p&gt;
&lt;p&gt;I do have a personal concern&lt;sup id="fnref:concern"&gt;&lt;a class="footnote-ref" href="#fn:concern"&gt;5&lt;/a&gt;&lt;/sup&gt;. I have nothing to substantiate this, but my thinking is that since ZFS is a way more advanced and complex file system, it may be more susceptible to the adverse effects of bad memory, compared to legacy file systems. &lt;/p&gt;
&lt;h3&gt;ZFS, ECC memory and data integrity&lt;/h3&gt;
&lt;p&gt;The main reason for using ZFS over legacy file systems is the ability to assure data integrity. But ZFS is only one piece of the data integrity puzzle. The other part of the puzzle is ECC memory. &lt;/p&gt;
&lt;p&gt;ZFS covers the risk of your storage subsystem serving corrupt data. ECC memory covers the risk of corrupt memory. If you leave any of these parts out, you are compromising data integrity.&lt;/p&gt;
&lt;p&gt;If you care about data integrity, you need to use ZFS in combination with ECC memory. If you don't care that much about data integrity, it doesn't really matter if you use either ZFS or ECC memory.&lt;/p&gt;
&lt;p&gt;Please remember that ZFS was developed to assure data integrity in a corporate IT environment, where data integrity is top priority and ECC-memory in servers is the norm, a fundament, on wich ZFS has been build. ZFS is not some magic pixie dust that protects your data under all circumstances. If its requirements are not met, data integrity is not assured.&lt;/p&gt;
&lt;p&gt;ZFS may be free, but data integrity and availability isn't. We spend money on extra hard drives so we can run RAID(Z) and lose one or more hard drives without losing our data. And we have to spend money on ECC-memory, to assure bad memory doesn't have a similar impact. &lt;/p&gt;
&lt;p&gt;This is a bit of an appeal to authority and not to data or reason but I think it's still relevant. &lt;a href="http://www.freenas.org/whats-new/2015/02/a-complete-guide-to-freenas-hardware-design-part-i-purpose-and-best-practices.html"&gt;FreeNAS&lt;/a&gt; is a vendor of a NAS solution that uses ZFS as its foundation. &lt;/p&gt;
&lt;p&gt;They have this to say about ECC memory:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;However if a non-ECC memory module goes haywire, it can cause irreparable damage to your ZFS pool that can cause complete loss of the storage.
...
If it’s imperative that your ZFS based system must always be available, ECC RAM is a requirement. If it’s only some level of annoying (slightly, moderately…) that you need to restore 
your ZFS system from backups, non-ECC RAM will fit the bill.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Hopefully your backups won't contain corrupt data. If you make backups of all data in the first place.&lt;/p&gt;
&lt;p&gt;Many home NAS builders won't be able to afford to backup all data on their NAS, only the most critical data. For example, if you store a large collection of video files, you may accept the risk that you may have to redownload everything. If you can't accept that risk ECC memory is a must. If you are OK with such a scenario, non-ECC memory is OK and you can save a few bucks. It all depends on your needs.&lt;/p&gt;
&lt;p&gt;The risks faced in a business environment don't magically disapear when you apply the same technology at home. The main difference between a business setting and your home is the scale of operation, nothing else. The risks are still relevant and real. &lt;/p&gt;
&lt;p&gt;Things break, it's that simple. And although you may not face the same chances of getting affected by it based on the smaller scale at which you operate at home, your NAS is probably not placed in a temperature and humidity controlled server room. As the temperature rises, so does the risk of memory errors&lt;sup id="fnref:bitsquatting"&gt;&lt;a class="footnote-ref" href="#fn:bitsquatting"&gt;6&lt;/a&gt;&lt;/sup&gt;. And remember, memory may develop spontaneous and temporary defects (random bitflips). If your system is powered on 24/7, there is a higher chance that such a thing will happen.&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Personally, I think that even for a home NAS, it's best to use ECC memory regardless if you use ZFS. It makes for a more stable hardware platform. If money is a real constraint, it's better to take a look at AMD's offerings then to skip on ECC memory. It's important that if you select AMD hardware, that you make sure that both CPU and motherboard support ECC and that it is reported to be working.&lt;/p&gt;
&lt;p&gt;Still, if you decide to use non-ECC memory with ZFS: as long as you are aware of the risks outlined in this blog post and you're OK with that, fine. It's your data and you must decide for yourself what kind of protection and associated cost is reasonable for you.&lt;/p&gt;
&lt;p&gt;When people seek advice on their NAS builds, ECC memory should always be recommended. I think that nobody should create the impression that it's 'safe' for home use not to use ECC RAM purely seen from a technical and data integrity standpoint. People must understand that they are taking a risk. But there is a significant chance that they will never experience problems, but there is no guarantee. Do they accept the consequences if it does go wrong?&lt;/p&gt;
&lt;p&gt;If data integrity is not that important - because the data itself is not critical - I find it &lt;em&gt;perfectly reasonable&lt;/em&gt; that people may decide not to use ECC memory and save a few hundred dollars. In that case, it would &lt;em&gt;also&lt;/em&gt; be perfectly reasonable not to use ZFS either, which also may allow them other file system and RAID options that may better suit their particular needs. &lt;/p&gt;
&lt;h3&gt;Questions and answers&lt;/h3&gt;
&lt;p&gt;Q: When I bought my non-ECC memory, I ran memtest86+ and no errors were found, even after a burn-in tests. So I think I'm safe.&lt;/p&gt;
&lt;p&gt;A: No. A memory test with memtest86+ is just a snapshot in time. At that time, when you ran the test, you had the assurance that memory was fine. It could have gone bad right now while you are reading these words. And could be corrupting your data as we speak. So running memtest86+ frequently doesn't really buy you much.&lt;/p&gt;
&lt;p&gt;Q: Dit you see that &lt;a href="http://blog.brianmoses.net/2014/03/why-i-chose-non-ecc-ram-for-my-freenas.html"&gt;article by Brian Moses?&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A: yes, and I disagree with his views, but I really appreciate the fact that he emphasises that you should really be aware of the risks involved and decide for &lt;em&gt;yourself&lt;/em&gt; what suits your situation. A few points that are not OK in my opinion:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Every bad stick of RAM I’ve experienced came to me that way from the factory and could be found via some burn-in testing.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I've seen some consumer equipment in my life time that suddenly developed memory errors after years of perfect operation. This is argument from personal anekdote should not be used as a basis for decision making. Remember: memory errors are the norm, not the exception. Even at home. Things break, it's that simple. And having equipment running 24/7 doesn't help.&lt;/p&gt;
&lt;p&gt;Furthermore, Brian seems to think that you can mitigate the risk of non-ECC memory by spending money on other stuff, such as off-site backups. Brian himself links to an article that &lt;a href="http://nex7.blogspot.nl/2014/03/ecc-vs-non-ecc-ram-great-debate.html"&gt;rebutes his position on this&lt;/a&gt;. Just for completeness: How valuable is a backup of corrupted data? How do you know which data was corrupted? ZFS won't save you here.&lt;/p&gt;
&lt;p&gt;Q: Should I use ZFS on my laptop or desktop?&lt;/p&gt;
&lt;p&gt;A: Running ZFS on your desktop or laptop is an entirely different use case as compared to a NAS. I see no problems with this, I don't think this discussion applies to desktop/laptop usage. Especially because you are probably creating regular backups of your data to your NAS or a cloud service, right? If there are any memory errors, you will notice soon enough.&lt;/p&gt;
&lt;h3&gt;Updates&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Updated on August 11, 2015 to reflect that ZFS was not designed with ECC in mind. In this regard, it doesn't differ from other file systems.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Updated on April 3rd, 2015 - rewrote large parts of the whole article, to make it a better read.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Updated on January 18th, 2015 - rephrased some sentences. Changed the paragraph 'Inform people and give them a choice' to argue when it would be reasonable not to use ECC memory. Furthermore, I state more explicitly that ZFS itself has no mechanisms to cope with bad RAM.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Updated on February 21th, 2015 - I substantially rewrote this article to give a better perspective on the ZFS + ECC 'debate'.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="footnote"&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id="fn:word"&gt;
&lt;p&gt;On x64 processors, the size of a &lt;a href="http://en.wikipedia.org/wiki/Word_(computer_architecture)"&gt;word is 64 bits&lt;/a&gt;.&amp;#160;&lt;a class="footnote-backref" href="#fnref:word" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:halt"&gt;
&lt;p&gt;Windows will generate a "blue screen of death" and Linux will generate a "kernel panic".&amp;#160;&lt;a class="footnote-backref" href="#fnref:halt" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:desktopecc"&gt;
&lt;p&gt;It is very likely that the computer you're using (laptop/desktop) encountered a memory issue this year, but there is no way you can tell. Consumer hardware doesn't have any mechanisms to detect and report memory errors.&amp;#160;&lt;a class="footnote-backref" href="#fnref:desktopecc" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:mstudy"&gt;
&lt;p&gt;Microsoft has performed a &lt;a href="http://research.microsoft.com/pubs/144888/eurosys84-nightingale.pdf"&gt;study&lt;/a&gt; on one million crash reports they received over a period of 8 months on roughly a million systems in 2008. The result is a 1 in 1700 failure rate for single-bit memory errors in kernel code pages (a tiny subset of total memory).&lt;/p&gt;
&lt;p&gt;:::text
&lt;em&gt;A consequence of confining our analysis to kernel code pages is that we will miss DRAM failures in the vast majority of memory. On a typical machine kernel code pages occupy roughly 30 MB of memory, which is 1.5% of the memory on the average system in our study. [...] since we are capturing DRAM errors in only 1.5% of the address space, it is possible that DRAM error rates across all of DRAM may be far higher than what we have observed.&lt;/em&gt;&amp;#160;&lt;a class="footnote-backref" href="#fnref:mstudy" title="Jump back to footnote 4 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:concern"&gt;
&lt;p&gt;I did not come up with this argument myself.&amp;#160;&lt;a class="footnote-backref" href="#fnref:concern" title="Jump back to footnote 5 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:bitsquatting"&gt;
&lt;p&gt;The absolutely facinating concept of bitsquatting proved that hotter datacenters &lt;a href="https://www.youtube.com/watch?v=aT7mnSstKGs"&gt;showed more bitflips&lt;/a&gt;&amp;#160;&lt;a class="footnote-backref" href="#fnref:bitsquatting" title="Jump back to footnote 6 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="ZFS"/><category term="ZFS"/><category term="ECC"/></entry><entry><title>Creating a basic ZFS file system on Linux</title><link href="https://louwrentius.com/creating-a-basic-zfs-file-system-on-linux.html" rel="alternate"/><published>2014-02-01T12:00:00+01:00</published><updated>2014-02-01T12:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2014-02-01:/creating-a-basic-zfs-file-system-on-linux.html</id><summary type="html">&lt;p&gt;Here are some notes on creating a basic ZFS file system on Linux, using &lt;a href="http://zfsonlinux.org"&gt;ZFS on Linux&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I'm documenting the scenario where I just want to create a file system that can tollerate at least a single drive failure and can be shared over NFS.&lt;/p&gt;
&lt;h3&gt;Identify the drives you want …&lt;/h3&gt;</summary><content type="html">&lt;p&gt;Here are some notes on creating a basic ZFS file system on Linux, using &lt;a href="http://zfsonlinux.org"&gt;ZFS on Linux&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I'm documenting the scenario where I just want to create a file system that can tollerate at least a single drive failure and can be shared over NFS.&lt;/p&gt;
&lt;h3&gt;Identify the drives you want to use for the ZFS pool&lt;/h3&gt;
&lt;p&gt;The ZFS on Linux project &lt;a href="http://zfsonlinux.org/faq.html#WhatDevNamesShouldIUseWhenCreatingMyPool"&gt;advices&lt;/a&gt; not to use plain /dev/sdx (/dev/sda, etc.) devices but to use /dev/disk/by-id/ or /dev/disk/by-path device names. &lt;/p&gt;
&lt;p&gt;Device names for storage devices are not fixed, so /dev/sdx devices may not always point to the same disk device. I've been bitten by this when first experimenting with ZFS, because I did not follow this advice and then could not access my zpool after a reboot because I removed a drive from the system. &lt;/p&gt;
&lt;p&gt;So you should pick the appropriate device from the /dev/disk/by-[id|path] folder. However, it's often difficult to determine which device in those folders corresponds to an actual disk drive.&lt;/p&gt;
&lt;p&gt;So I wrote a simple tool called &lt;a href="https://github.com/louwrentius/showtools"&gt;showdisks&lt;/a&gt; which helps you identify which identifiers you need to use to create your ZFS pool.&lt;/p&gt;
&lt;p&gt;&lt;img alt="diskbypath" src="https://louwrentius.com/static/images/diskbypath.png" /&gt;&lt;/p&gt;
&lt;p&gt;You can install showdisks yourself by cloning the project:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;git clone https://github.com/louwrentius/showtools.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And then just use showdisks like&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;./showdisks -sp  (-s (size) and -p (by-path) )
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;For this example, I'd like to use all the 500 GB disk drives for a six-drive RAIDZ1 vdev.
Based on the information from showdisks, this is the command to create the vdev:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;zfs create tank raidz1 pci-0000:03:00.0-scsi-0:0:21:0 pci-0000:03:00.0-scsi-0:0:19:0 pci-0000:02:00.0-scsi-0:0:9:0 pci-0000:02:00.0-scsi-0:0:11:0 pci-0000:03:00.0-scsi-0:0:22:0 pci-0000:03:00.0-scsi-0:0:18:0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The 'tank' name can be anything you want, it's just a name for the pool.&lt;/p&gt;
&lt;p&gt;Please note that with newer bigger disk drives, you should test if the ashift=12 option gives you better performance. &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;zfs create -o ashift=12 tank raidz1 &amp;lt;devices&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I used this option on 2TB disk drives and the performance and the read performance improved twofold. &lt;/p&gt;
&lt;h3&gt;How to setup a RAID10 style pool&lt;/h3&gt;
&lt;p&gt;This is how to create the ZFS equivalent of a RAID10 setup: &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;zfs create tank mirror &amp;lt;device 1&amp;gt; &amp;lt;device 2&amp;gt; mirror &amp;lt;device 3&amp;gt; &amp;lt;device 4&amp;gt; mirror &amp;lt;device 5&amp;gt; &amp;lt;device 6&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;How many drives should I use in a vdev&lt;/h3&gt;
&lt;p&gt;I've learned to use a 'power of two' (2,4,8,16) of drives for a vdev, plus the appropriate number of drives for the parity. RAIDZ1 = 1 disk, RAIDZ2 = 2 disks, etc.&lt;/p&gt;
&lt;p&gt;So the optimal number of drives for RAIDZ1 would be 3,5,9,17. RAIDZ2 would be 4,6,10,18 and so on. Clearly in the example above with six drives in a RAIDZ1 configuration, I'm violating this rule of thumb. &lt;/p&gt;
&lt;h3&gt;How to disable the ZIL or disable sync writes&lt;/h3&gt;
&lt;p&gt;You can expect bad throughput performance if you want to use the ZIL / honour synchronous writes. For safety reasons, ZFS does honour sync writes by default, it's an important feature of ZFS to guarantee data integrity. For storage of virtual machines or databases, you should not turn of the ZIL, but use an SSD for the SLOG to get performance to acceptable levels. &lt;/p&gt;
&lt;p&gt;For a simple (home) NAS box, the ZIL is not so important and can quite safely be disabled, as long as you have your servers on a UPS and have it cleanly shutdown when the UPS battery runs out.&lt;/p&gt;
&lt;p&gt;This is how you turn of the ZIL / support for synchronous writes:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;zfs set sync=disabled &amp;lt;pool name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Disabling sync writes is especially important if you use NFS which issues sync writes by default. &lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;zfs set sync=disabled tank
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;How to add an L2ARC cache device&lt;/h3&gt;
&lt;p&gt;Use &lt;a href="https://github.com/louwrentius/showtools"&gt;showdisks&lt;/a&gt; to lookup the actual /dev/disk/by-path identifier and add it like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;zpool add tank cache &amp;lt;device&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;zpool add tank cache pci-0000:00:1f.2-scsi-2:0:0:0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This is the result (on another zpool called 'server'):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@server:~# zpool status
  pool: server
 state: ONLINE
  scan: none requested
config:

    NAME                               STATE     READ WRITE CKSUM
    server                             ONLINE       0     0     0
      raidz1-0                         ONLINE       0     0     0
        pci-0000:03:04.0-scsi-0:0:0:0  ONLINE       0     0     0
        pci-0000:03:04.0-scsi-0:0:1:0  ONLINE       0     0     0
        pci-0000:03:04.0-scsi-0:0:2:0  ONLINE       0     0     0
        pci-0000:03:04.0-scsi-0:0:3:0  ONLINE       0     0     0
        pci-0000:03:04.0-scsi-0:0:4:0  ONLINE       0     0     0
        pci-0000:03:04.0-scsi-0:0:5:0  ONLINE       0     0     0
    cache
      pci-0000:00:1f.2-scsi-2:0:0:0    ONLINE       0     0     0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;How to monitor performance / I/O statistics&lt;/h3&gt;
&lt;p&gt;One time sample:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;zpool iostat
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;A sample every 2 seconds:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;zpool iostat 2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;More detailed information every 5 seconds:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;zpool iostat -v 5
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Example output:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;                                      capacity     operations    bandwidth
pool                               alloc   free   read  write   read  write
---------------------------------  -----  -----  -----  -----  -----  -----
server                             3.54T  7.33T      4    577   470K  68.1M
  raidz1                           3.54T  7.33T      4    577   470K  68.1M
    pci-0000:03:04.0-scsi-0:0:0:0      -      -      1    143  92.7K  14.2M
    pci-0000:03:04.0-scsi-0:0:1:0      -      -      1    142  91.1K  14.2M
    pci-0000:03:04.0-scsi-0:0:2:0      -      -      1    143  92.8K  14.2M
    pci-0000:03:04.0-scsi-0:0:3:0      -      -      1    142  91.0K  14.2M
    pci-0000:03:04.0-scsi-0:0:4:0      -      -      1    143  92.5K  14.2M
    pci-0000:03:04.0-scsi-0:0:5:0      -      -      1    142  90.8K  14.2M
cache                                  -      -      -      -      -      -
  pci-0000:00:1f.2-scsi-2:0:0:0    55.9G     8M      0     70    349  8.69M
---------------------------------  -----  -----  -----  -----  -----  -----
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;How to start / stop a scrub&lt;/h3&gt;
&lt;p&gt;Start:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;zfs scrub &amp;lt;pool&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Stop:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;zfs scrub -s &amp;lt;pool&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Mount ZFS file systems on boot&lt;/h3&gt;
&lt;p&gt;Edit /etc/defaults/zfs and set this parameter:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;ZFS_MOUNT=&amp;#39;yes&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;How to enable sharing a file system over NFS:&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;zfs set sharenfs=on &amp;lt;poolname&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;How to create a zvol for usage with iSCSI&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;zfs create -V 500G &amp;lt;poolname&amp;gt;/volume-name
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;How to force ZFS to import the pool using disk/by-path&lt;/h3&gt;
&lt;p&gt;Edit /etc/default/zfs and add&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;ZPOOL_IMPORT_PATH=/dev/disk/by-path/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Links to important ZFS information sources:&lt;/h3&gt;
&lt;p&gt;Tons of information on using ZFS on Linux by Aaron Toponce:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://pthree.org/2012/04/17/install-zfs-on-debian-gnulinux/"&gt;https://pthree.org/2012/04/17/install-zfs-on-debian-gnulinux/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Understanding the ZIL (ZFS Intent Log)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://nex7.blogspot.nl/2013/04/zfs-intent-log.html"&gt;http://nex7.blogspot.nl/2013/04/zfs-intent-log.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Information about 4K sector alignment problems&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.opendevs.org/ritk/zfs-4k-aligned-space-overhead.html"&gt;http://www.opendevs.org/ritk/zfs-4k-aligned-space-overhead.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Important read about using the proper number of drives in a vdev&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.opendevs.org/ritk/zfs-4k-aligned-space-overhead.html"&gt;http://forums.freenas.org/threads/getting-the-most-out-of-zfs-pools.16/&lt;/a&gt;&lt;/p&gt;</content><category term="ZFS"/><category term="ZFS"/></entry><entry><title>Things you should consider when building a ZFS NAS</title><link href="https://louwrentius.com/things-you-should-consider-when-building-a-zfs-nas.html" rel="alternate"/><published>2013-12-29T12:00:00+01:00</published><updated>2013-12-29T12:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2013-12-29:/things-you-should-consider-when-building-a-zfs-nas.html</id><summary type="html">&lt;p&gt;ZFS is a modern file system designed by Sun Microsystems, targeted at enterprise environments. Many features of ZFS also appeal to home NAS builders and with good reason. But not all features are relevant or necessary for home use. &lt;/p&gt;
&lt;p&gt;I believe that most &lt;em&gt;home users&lt;/em&gt; building their own NAS, are …&lt;/p&gt;</summary><content type="html">&lt;p&gt;ZFS is a modern file system designed by Sun Microsystems, targeted at enterprise environments. Many features of ZFS also appeal to home NAS builders and with good reason. But not all features are relevant or necessary for home use. &lt;/p&gt;
&lt;p&gt;I believe that most &lt;em&gt;home users&lt;/em&gt; building their own NAS, are just looking for a way to create a large centralised storage pool. As long as the solution can saturate gigabit ethernet, performance is not much of an issue. Workloads are typically single-client and sequential in nature. &lt;/p&gt;
&lt;p&gt;If this description rings true for your environment, there are some options regarding ZFS that are often very popular but not very relevant to you. 
Furthermore, there are also some facts that you should take into account when preparing for your own NAS build.&lt;/p&gt;
&lt;h3&gt;Expanding your pool may not be as simple as you think&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;Added August 2015&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If you are familiar with regular hardware or software RAID, you might expect to use on-line capacity expansion, where you just grow a RAID array with extra drives as you see fit. Many hardware RAID cards support this feature and Linux software RAID (MDADM) supports this too. This is very economical: just add an extra drive and you gain some space. Very flexible and simple. &lt;/p&gt;
&lt;p&gt;But ZFS does not support this approach. ZFS requires you to create a new 'RAID array' and add it to the pool. So you will lose extra drives to redundancy. &lt;/p&gt;
&lt;p&gt;To be more presise: you &lt;em&gt;cannot expand VDEVs&lt;/em&gt;. You can only &lt;em&gt;add&lt;/em&gt; VDEVS to a pool. And each VDEV requires it's own redundancy. &lt;/p&gt;
&lt;p&gt;So if you start  with a single 6-disk RAIDZ2 you may end up with two 6-disk RAIDZ2 VDEVS. This means you use 4 out of 12 drives for redundancy. If you would have started out with a 10-disk RAIDZ2, you would only lose 2 drives to redundancy. Example:&lt;/p&gt;
&lt;p&gt;A: 2 x 6-disk RAIDZ2 consisting of 4 TB drives = 12 disks - 4 redundancy = 8 x 4 = 32 TB netto capacity. &lt;/p&gt;
&lt;p&gt;B: 1 x 10-disk RAIDZ2 consisting of 4 TB drives = 10 disks - 2 redundancy = 8 x 2 = 32 TB netto capacity. &lt;/p&gt;
&lt;p&gt;Option A lost you two drives at 150$ = 300$ and also requires 2 extra SATA ports and chassis slots. &lt;/p&gt;
&lt;p&gt;Option B will cost you 4 extra drives upfront, space you may not need immediately. &lt;/p&gt;
&lt;p&gt;Also take into account that there is such a thing as a 'recommended number of disks in a VDEV' depending on the redundancy used. This is discussed further down.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; there is a 'trick' how you can expand a VDEV. If you replace every drive with a larger one, you can then resize the VDEV and the pool. So replacing 2 TB drives with 4 TB drives would double your capacity without adding an extra VDEV.&lt;/p&gt;
&lt;p&gt;This approach requires a full VDEV rebuild after each drive replacement. So you may understand that this takes quite some time, during which your are running on no (RAIDZ) or less (RAIDZ2) redundancy. But it does work. &lt;/p&gt;
&lt;p&gt;If you have an additional spare SAS/SATA port and power, you can keep the redundancy and do an 'on-line' replace of the drive. This way, you don't lose or reduce redundancy during a rebuild. This is relatively ideal if you also have room for an additional drive in the chassis.  &lt;/p&gt;
&lt;p&gt;This can be quite some work if you do have an available SATA port, but no additional drive slots. You will have to open the chassis, find a temporary spot for the new drive and then after the rebuild, move the new drive into the slot of the old one.&lt;/p&gt;
&lt;p&gt;There is a general recommendation not to mix different VDEV sizes in a pool, but for home usage, this is not an issue. So you could - for example - expand a pool based on a 6-drive VDEV with an additional 4-drive VDEV RAIDZ2. &lt;/p&gt;
&lt;p&gt;Remember: lose one VDEV and you lose your entire pool. So I would not recommend mixing RAIDZ and RAIDZ2 VDEVs in a pool.  &lt;/p&gt;
&lt;h3&gt;You don't need a SLOG for the ZIL&lt;/h3&gt;
&lt;p&gt;Quick recap: the &lt;a href="https://blogs.oracle.com/realneel/entry/the_zfs_intent_log"&gt;ZIL&lt;/a&gt; or ZFS intent Log is - as I understand it - only relevant for 
synchronous writes. If data integrity is important to an application, like a database server or a virtual machine, writes are performed synchronous. The application wants to make sure that the data is actually stored on the physical storage media and it waits for a confirmation from ZFS that it has done so. Only then will it continue.&lt;/p&gt;
&lt;p&gt;Asynchronous writes on the contrary, never hit the ZIL. They are just cached in RAM and directly written to the VDEV in one sequential swoop when the next transaction group commit will be performed (currently by default every 5 seconds). In the mean time, the application gets a confirmation of ZFS that the data is stored (a white lie) and just continues where it left off. ZFS just caches the write in memory and actually write the data to the storage VDEV when it feels like it (fifo).&lt;/p&gt;
&lt;p&gt;As you may understand, asynchronous writes are way faster because they can be cached and ZFS can reorder the I/O to make it more sequential and prevent random I/O from hitting the VDEV. This is what I understood from &lt;a href="http://nex7.blogspot.nl/2013/04/zfs-intent-log.html"&gt;this source&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;So if you encounter synchronous writes, they must be committed to the ZIL (thus VDEV) and this causes random I/O patterns on the VDEV, degrading performance significantly. &lt;/p&gt;
&lt;p&gt;The cool thing about ZFS is that it does provide the option to store the ZIL on a dedicated device called the SLOG. This doesn't do anything for performance by itself, but the secret ingredient is using a solid state drive as the SLOG, ideally in a mirror to insure data integrity and to maintain performance in the case of a SLOG device failure. &lt;/p&gt;
&lt;p&gt;For business critical environments, a separate SLOG device based on SSDs is a no-brainer. But for home use? If you don't have a SLOG, you still have a ZIL, it's only not as fast. That's not a real problem for single-client sequential throughput. &lt;/p&gt;
&lt;p&gt;For home usage, you may even consider how much you care about data integrity. That sounds strange, but the ZIL is used to recover from the event of a sudden power-loss. If your NAS is attached to a UPS, this is not much of a risk, you can perform a controlled shutdown before the batteries run out of power. The remaining risk is human error or some other catastrophic event within your NAS. &lt;/p&gt;
&lt;p&gt;So all data in rest already stored on your NAS is never at risk. It's only data that is in the process of being committed to storage that may get scrambled. But again: this is a home situation. Maybe restart your file transfer and you are done. You still have a copy of the data on the source device. This is entirely different from a setup with databases or virtual machines. &lt;/p&gt;
&lt;p&gt;Data integrity of data at rest is vitally important. The ZIL only protects data in transit. It has nothing to do with the data already committed to the VDEV.&lt;/p&gt;
&lt;p&gt;I see so many NAS builders being talked into buying some specific SSDs to be used for the ZIL whereas they probably won't benefit from them at all, it's just too bad. &lt;/p&gt;
&lt;h3&gt;You don't need L2ARC cache&lt;/h3&gt;
&lt;p&gt;ZFS relies heavily on caching of data to deliver decent performance, especially read performance. RAM provides the fasted cache and that is where the first level of caching lives, the ARC (Adaptive Replacement Cache). ZFS is smart and learns which data is often requested and keeps it in the ARC. &lt;/p&gt;
&lt;p&gt;But the size of the ARC is limited by the amount of RAM available. This is why you can add a second cache tier, based on SSDs. SSDs are not as fast as RAM, but still way faster than spinning disks. And they are cheaper compared to RAM memory if you look at their capacity.&lt;/p&gt;
&lt;p&gt;For additional more detailed information, go to &lt;a href="http://www.zfsbuild.com/2010/04/15/explanation-of-arc-and-l2arc/"&gt;this site&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;L2ARC is important when you have multiple users or VMs accessing the same data sets. In this case, L2ARC based on SSDs will improve performance significantly. But if we just take a look at the average home NAS build, I'm not sure how the L2ARC adds any benefit. ZFS has no problem with single-client sequential file transfers so there is no benefit in implementing a L2ARC. &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Update 2015-02-08&lt;/em&gt;: There is even a downside to having a L2ARC cache. All the meta-data regarding data stored in the L2ARC cache is kept in memory, and thus eating away at your ARC!, thus your ARC becomes less effective &lt;a href="http://www.accs.com/p_and_p/ZFS/ZFS.PDF"&gt;(source)&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;You don't need deduplication and compression&lt;/h3&gt;
&lt;p&gt;For the home NAS, most data you store on it is already highly compressed and additional compression only wastes performance (Music, Videos, etc). It is a cool feature, but not so much for home use. If you are planning to store other types of data, compression actually may be of interest (documents, backups of VMs, etc). It is &lt;a href="http://wiki.illumos.org/display/illumos/LZ4+Compression"&gt;suggested by many&lt;/a&gt; (and in the comments) that with LZ4 compression, you don't lose performance (except for some CPU cycles) and with compressible data, you even gain performance, so you could just enable it and forget about it. &lt;/p&gt;
&lt;p&gt;Whereas compression may do not much harm, Deduplication is often more relevant in business environments where users are sloppy and store multiple copies of the same data at different locations. I'm quite sure you don't want to sacrifice RAM and performance for ZFS to keep track of duplicates you probably don't have.&lt;/p&gt;
&lt;h3&gt;You don't need an ocean of RAM&lt;/h3&gt;
&lt;p&gt;The absolute minimum RAM for a viable ZFS setup is 4 GB but there is not a lot of headroom for ZFS here. ZFS is quite memory hungry because it uses RAM as a buffer so it can perform operations like checksums and reorder all I/O to be sequential. &lt;/p&gt;
&lt;p&gt;If you don't have sufficient buffer memory, performance will suffer. 8 GB is probably sufficient for most arrays. If your array is faster, more memory may be required to actually benefit from this performance. For maximum performance, you should have enough memory to hold 5 seconds worth of maximum write throughput ( 5 x 400MB/s = 2GB ) and leave sufficient headroom for other ZFS RAM requirements. In the example, 4 GB RAM could be sufficient. &lt;/p&gt;
&lt;p&gt;For most home users, saturating gigabit is already sufficient so you might be safe with 8 GB of RAM in most cases. More RAM may not provide much more benefit, but it will increase power consumption.&lt;/p&gt;
&lt;p&gt;There is an often cited rule that you need 1 GB of RAM for every TB of storage, but this is not true for home NAS solutions. This is only relevant for high-performance multi-user or multi-VM environments. &lt;/p&gt;
&lt;p&gt;Additional information about RAM requirements can be found &lt;a href="http://doc.freenas.org/index.php/Hardware_Recommendations"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;You do need ECC RAM if you care about data integrity&lt;/h3&gt;
&lt;p&gt;The money saved on a ZIL or L2ARC cache can be better spend on ECC RAM memory. &lt;/p&gt;
&lt;p&gt;ZFS does not rely on the quality of individual disks. It uses parity to verify that disks don't lie about the data stored on them (data corruption). &lt;/p&gt;
&lt;p&gt;But ZFS can't verify the contents of RAM memory, so here ZFS relies on the reliability of the hardware. And there is a reason why we use RAID or redundant power suplies in our server equipment: hardware fails. RAM fails too. This is the reason why every server product by well-known vendors like HP, Dell, IBM and Supermicro only support ECC memory. 
&lt;a href="http://www.zdnet.com/blog/storage/dram-error-rates-nightmare-on-dimm-street/638"&gt;RAM memory errors do occur more frequent than you may think&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;ECC (Error Checking and Correcting) RAM corrects and detects RAM errors. This is the only way you can be fairly sure that ZFS is not fed with corrupted data. Keep in mind: with bad RAM, it is likely that corrupted data will be written to disk without ZFS ever being aware of it (garbage in - garbage out).&lt;/p&gt;
&lt;p&gt;Please note that the quality of your RAM memory will not directly affect any data that is at rest and already stored on your disks. Existing data will only be corrupted with bad RAM if it is modified or moved around. ZFS will probably detect checksum errors, but it will be too late by then...&lt;/p&gt;
&lt;p&gt;To me, it's simple. If you care enough about your data that you want to use ZFS, you should also be willing to pay for ECC memory. You are giving yourself a false sense of security if you do not use ECC memory. ZFS was never designed for consumer hardware, it was destined to be used on server hardware using ECC memory. Because it was designed with data integrity as the top most priority.&lt;/p&gt;
&lt;p&gt;There are entry-level servers that do support ECC memory and can be had fairly cheap with 4 hard drive bays, like the &lt;a href="http://www8.hp.com/us/en/products/proliant-servers/product-detail.html?oid=5379860"&gt;HP ProLiant MicroServer Gen8&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I wrote an &lt;a href="https://louwrentius.com/affordable-server-with-server-grade-hardware-part-ii.html"&gt;article&lt;/a&gt; about a reasonably priced CPU+RAM+MB combo that does support ECC memory starting at $360.&lt;/p&gt;
&lt;p&gt;If you feel lucky, go for good-quality non-ECC memory. But do understand that you are taking a risk here. &lt;/p&gt;
&lt;h3&gt;Understanding random I/O performance&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;Added August 2015&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;With ZFS, the rule of thumb is this: regardless of the number of drives in a RAIDZ(2/3) VDEV, you always get roughly the random I/O performance of a &lt;em&gt;single&lt;/em&gt; drive in the VDEV&lt;sup id="fnref:singledrive"&gt;&lt;a class="footnote-ref" href="#fn:singledrive"&gt;1&lt;/a&gt;&lt;/sup&gt;. &lt;/p&gt;
&lt;p&gt;Now I want to make the case here that if you are building your own home NAS, you shouldn't care about random I/O performance too much. &lt;/p&gt;
&lt;p&gt;If you want better random I/O performance of your pool, the way to get it is to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;add more VDEVS to your pool&lt;/li&gt;
&lt;li&gt;add more RAM/L2ARC for caching&lt;/li&gt;
&lt;li&gt;use disks with higher RPM or SSDs combined with option 1. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Regarding point 1:&lt;/p&gt;
&lt;p&gt;So if you want the best random I/O performance, you should just use a ton of mirrored drives in the VDEV, so you essentially create a large RAID 10. 
This is not very space-efficient, so probably not so relevant in the context of a home NAS.&lt;/p&gt;
&lt;p&gt;Example similar to RAID 10:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@bunny:~# zfs list
NAME       USED  AVAIL  REFER  MOUNTPOINT
testpool  59.5K  8.92T    19K  /testpool

root@bunny:~# zpool status
  pool: testpool
 state: ONLINE
  scan: none requested
config:

    NAME        STATE     READ WRITE CKSUM
    testpool    ONLINE       0     0     0
      mirror-0  ONLINE       0     0     0
        sdc     ONLINE       0     0     0
        sdd     ONLINE       0     0     0
      mirror-1  ONLINE       0     0     0
        sde     ONLINE       0     0     0
        sdf     ONLINE       0     0     0
      mirror-2  ONLINE       0     0     0
        sdg     ONLINE       0     0     0
        sdh     ONLINE       0     0     0
      mirror-3  ONLINE       0     0     0
        sdi     ONLINE       0     0     0
        sdj     ONLINE       0     0     0
      mirror-4  ONLINE       0     0     0
        sdk     ONLINE       0     0     0
        sdl     ONLINE       0     0     0
      mirror-5  ONLINE       0     0     0
        sdm     ONLINE       0     0     0
        sdn     ONLINE       0     0     0
      mirror-6  ONLINE       0     0     0
        sdo     ONLINE       0     0     0
        sdp     ONLINE       0     0     0
      mirror-7  ONLINE       0     0     0
        sdq     ONLINE       0     0     0
        sdr     ONLINE       0     0     0
      mirror-8  ONLINE       0     0     0
        sds     ONLINE       0     0     0
        sdt     ONLINE       0     0     0
      mirror-9  ONLINE       0     0     0
        sdu     ONLINE       0     0     0
        sdv     ONLINE       0     0     0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Another option, if you need better storage efficiency, is to use multiple RAIDZ or RAIDZ2 VDEVS in the pool. In a way, you're then creating the equivalent of a RAID50 or RAID60. &lt;/p&gt;
&lt;p&gt;Example similar to RAID 50:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@bunny:~# zfs list
NAME       USED  AVAIL  REFER  MOUNTPOINT
testpool  77.5K  14.3T  27.2K  /testpool

root@bunny:~# zpool status
  pool: testpool
 state: ONLINE
  scan: none requested
config:

NAME        STATE     READ WRITE CKSUM
testpool    ONLINE       0     0     0
  raidz1-0  ONLINE       0     0     0
    sdc     ONLINE       0     0     0
    sdd     ONLINE       0     0     0
    sde     ONLINE       0     0     0
    sdf     ONLINE       0     0     0
    sdg     ONLINE       0     0     0
  raidz1-1  ONLINE       0     0     0
    sdh     ONLINE       0     0     0
    sdi     ONLINE       0     0     0
    sdj     ONLINE       0     0     0
    sdk     ONLINE       0     0     0
    sdl     ONLINE       0     0     0
  raidz1-2  ONLINE       0     0     0
    sdm     ONLINE       0     0     0
    sdn     ONLINE       0     0     0
    sdo     ONLINE       0     0     0
    sdp     ONLINE       0     0     0
    sdq     ONLINE       0     0     0
  raidz1-3  ONLINE       0     0     0
    sdr     ONLINE       0     0     0
    sds     ONLINE       0     0     0
    sdt     ONLINE       0     0     0
    sdu     ONLINE       0     0     0
    sdv     ONLINE       0     0     0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You only need to deploy these kinds of pool/vdev configuratoins if you have valid reason that you need the random I/O performance they provide. Creating less but larger VDEVs is often more space efficient and will still saturate gigabit when transferring large files. &lt;/p&gt;
&lt;h3&gt;It's ok to use multiple VDEVs of different drive sizes&lt;/h3&gt;
&lt;p&gt;This only true in the context of a home NAS.  &lt;/p&gt;
&lt;p&gt;Let's take an example. You have an existing pool consisting of a single RAIDZ VDEV with 4 x 2 TB drives and your pool is filling up. &lt;/p&gt;
&lt;p&gt;It's then perfectly fine in the context of a home NAS to add a second VDEV consisting of a  5 x 4 TB RAIDZ. &lt;/p&gt;
&lt;p&gt;ZFS will take care of how data is distributed across the VDEVs. &lt;/p&gt;
&lt;p&gt;It is &lt;em&gt;NOT&lt;/em&gt; recommended to mix different RAIDZ schemas, so VDEV 1 = RAIDZ and VDEV 2 = RAIDZ2. Remember that losing a single VDEV = losing the whole pool. It doesn't make sense to mix redundancy levels. &lt;/p&gt;
&lt;h3&gt;VDEVs should consist of the optimal number of drives&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;Added August 2015:&lt;/em&gt; If you use the large_blocks feature and use 1MB records, you don't need to adhere to the rule of always putting a certain number of drives in a VDEV to prevent significant loss of storage capacity. &lt;/p&gt;
&lt;p&gt;This enables you to create an 8-drive RAIDZ2 where normally you would have to create either a RAIDZ2 VDEV that consists of 6 drives or 10 drives. &lt;/p&gt;
&lt;p&gt;For home use, expanding storage by adding VDEVs is often suboptimal because you may spend more disks on redundancy than required, as explained earlier. The support of large_blocks allows you to buy the number of disks upfront that suits current and future needs.&lt;/p&gt;
&lt;p&gt;In my own personal case, with my 19" chassis filled with 24 drives, I would enable the large_blocks feature and create a single 24-drive RAID-Z3 VDEV to give me optimal space and still very good redundancy.&lt;/p&gt;
&lt;p&gt;The large_blocks feature is supported on ZFS on Linux since version 0.6.5 (September 2015).&lt;/p&gt;
&lt;p&gt;Thanks to user "SirMaster" on Reddit for introducing this feature to me.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Original advice: &lt;/p&gt;
&lt;p&gt;Depending on the type of 'RAID' you may choose for the VDEV(s) in your ZFS pool, you might want to make sure you only put in the right number of disks in the VDEV. &lt;/p&gt;
&lt;p&gt;This is important, if you don't use the right amount, performance will suffer, but more importantly: you will lose storage space, which can ad up to over 10% of the available capacity. That's quite a waste. &lt;/p&gt;
&lt;p&gt;This is a straight copy&amp;amp;paste from &lt;a href="http://forums.anandtech.com/showthread.php?p=35760300"&gt;sub.mesa's post&lt;/a&gt; &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;The following ZFS pool configurations are optimal for modern 4K sector harddrives:
RAID-Z: 3, 5, 9, 17, 33 drives
RAID-Z2: 4, 6, 10, 18, 34 drives
RAID-Z3: 5, 7, 11, 19, 35 drives
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Sub.mesa also explains the details on why this is true. And &lt;a href="http://www.opendevs.org/ritk/zfs-4k-aligned-space-overhead.html"&gt;here&lt;/a&gt; is another example.&lt;/p&gt;
&lt;p&gt;The gist is that you must use a power of two for your data disks and then add the number of parity disks required for your RAIDZ level on top of that. So 4 data disks + 1 parity disk (RAIDZ) is a total of 5 disks. Or 16 data disks + 2 parity disks (RAIDZ2) is 18 disks in the VDEV.&lt;/p&gt;
&lt;p&gt;Take this into account when deciding on your pool configuration. Also, RAIDZ2 is absolutely recommended. with more than 6-8 disks. The risk of losing a second drive during 'rebuild' (resilvering) is just too high with current high-density drives.&lt;/p&gt;
&lt;h3&gt;You don't need to limit the number of data disks in a VDEV&lt;/h3&gt;
&lt;p&gt;For home use, creating larger VDEVs is not an issue, even an 18 disk VDEV is probably fine, but don't expect any significant random I/O performance. It is always recommended to use multiple smaller VDEVs to increase random I/O performance (at the cost of capacity lost to parity) as ZFS does stripe I/O-requests across VDEVs. If you are building a home NAS, random I/O is probably not very relevant. &lt;/p&gt;
&lt;h3&gt;You don't need to run ZFS at home&lt;/h3&gt;
&lt;p&gt;ZFS is cool technology and it's perfectly fine to run ZFS at home. However, &lt;a href="https://louwrentius.com/should-i-use-zfs-for-my-home-nas.html"&gt;the world doesn't end if you don't&lt;/a&gt;. &lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id="fn:singledrive"&gt;
&lt;p&gt;https://blogs.oracle.com/roch/entry/when_to_and_not_to&amp;#160;&lt;a class="footnote-backref" href="#fnref:singledrive" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="ZFS"/><category term="ZFS"/><category term="Storage"/></entry><entry><title>ZFS on Linux: monitor cache hit ratio</title><link href="https://louwrentius.com/zfs-on-linux-monitor-cache-hit-ratio.html" rel="alternate"/><published>2013-12-23T12:00:00+01:00</published><updated>2013-12-23T12:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2013-12-23:/zfs-on-linux-monitor-cache-hit-ratio.html</id><summary type="html">&lt;p&gt;I'm performing some FIO random read 4k I/O benchmarks on a ZFS file system. So since I didn't trust the numbers I got, I wanted to know how many of the IOPs I got were due to cache hits rather than disk hits. &lt;/p&gt;
&lt;p&gt;This is why I wrote a …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I'm performing some FIO random read 4k I/O benchmarks on a ZFS file system. So since I didn't trust the numbers I got, I wanted to know how many of the IOPs I got were due to cache hits rather than disk hits. &lt;/p&gt;
&lt;p&gt;This is why I wrote a &lt;a href="https://louwrentius.com/files/architratio.sh"&gt;small shell script called archhitratio&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Sample output: &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;IOPs: 133 | ARC cache hit ratio: 48.00 % | Hitrate: 64 / Missrate: 69
IOPs: 131 | ARC cache hit ratio: 48.00 % | Hitrate: 63 / Missrate: 68
IOPs: 136 | ARC cache hit ratio: 49.00 % | Hitrate: 67 / Missrate: 69
IOPs: 128 | ARC cache hit ratio: 46.00 % | Hitrate: 59 / Missrate: 69
IOPs: 127 | ARC cache hit ratio: 46.00 % | Hitrate: 59 / Missrate: 68
IOPs: 135 | ARC cache hit ratio: 48.00 % | Hitrate: 65 / Missrate: 70
IOPs: 127 | ARC cache hit ratio: 45.00 % | Hitrate: 58 / Missrate: 69
IOPs: 125 | ARC cache hit ratio: 44.00 % | Hitrate: 56 / Missrate: 69
IOPs: 128 | ARC cache hit ratio: 46.00 % | Hitrate: 60 / Missrate: 68
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In this example, I'm performing a random read test on a 16GB data set. This host has 16 GB RAM and 6 GB of this dataset was already in memory from previous FIO runs. This is why we see a ~45% hit ratio. &lt;/p&gt;
&lt;p&gt;This is a more interesting result:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;IOPs: 1404 | ARC cache hit ratio: 90.0 % | Hitrate: 1331 / Missrate: 73
IOPs: 1425 | ARC cache hit ratio: 90.0 % | Hitrate: 1350 / Missrate: 75
IOPs: 1395 | ARC cache hit ratio: 90.0 % | Hitrate: 1323 / Missrate: 72
IOPs: 1740 | ARC cache hit ratio: 90.0 % | Hitrate: 1664 / Missrate: 76
IOPs: 1351 | ARC cache hit ratio: 90.0 % | Hitrate: 1277 / Missrate: 74
IOPs: 1613 | ARC cache hit ratio: 90.0 % | Hitrate: 1536 / Missrate: 77
IOPs: 1920 | ARC cache hit ratio: 90.0 % | Hitrate: 1845 / Missrate: 75
IOPs: 1431 | ARC cache hit ratio: 90.0 % | Hitrate: 1354 / Missrate: 77
IOPs: 1675 | ARC cache hit ratio: 90.0 % | Hitrate: 1598 / Missrate: 77
IOPs: 1560 | ARC cache hit ratio: 90.0 % | Hitrate: 1484 / Missrate: 76
IOPs: 1574 | ARC cache hit ratio: 90.0 % | Hitrate: 1500 / Missrate: 74
IOPs: 2017 | ARC cache hit ratio: 90.0 % | Hitrate: 1946 / Missrate: 71
IOPs: 1696 | ARC cache hit ratio: 90.0 % | Hitrate: 1623 / Missrate: 73
IOPs: 1776 | ARC cache hit ratio: 90.0 % | Hitrate: 1702 / Missrate: 74
IOPs: 1671 | ARC cache hit ratio: 90.0 % | Hitrate: 1597 / Missrate: 74
IOPs: 1729 | ARC cache hit ratio: 90.0 % | Hitrate: 1656 / Missrate: 73
IOPs: 1902 | ARC cache hit ratio: 90.0 % | Hitrate: 1828 / Missrate: 74
IOPs: 2029 | ARC cache hit ratio: 90.0 % | Hitrate: 1956 / Missrate: 73
IOPs: 2228 | ARC cache hit ratio: 90.0 % | Hitrate: 2161 / Missrate: 67
IOPs: 2289 | ARC cache hit ratio: 90.0 % | Hitrate: 2216 / Missrate: 73
IOPs: 2385 | ARC cache hit ratio: 90.0 % | Hitrate: 2277 / Missrate: 108
IOPs: 2595 | ARC cache hit ratio: 90.0 % | Hitrate: 2524 / Missrate: 71
IOPs: 2940 | ARC cache hit ratio: 90.0 % | Hitrate: 2872 / Missrate: 68
IOPs: 2984 | ARC cache hit ratio: 90.0 % | Hitrate: 2872 / Missrate: 112
IOPs: 2622 | ARC cache hit ratio: 90.0 % | Hitrate: 2385 / Missrate: 237
IOPs: 1518 | ARC cache hit ratio: 90.0 % | Hitrate: 1461 / Missrate: 57
IOPs: 3221 | ARC cache hit ratio: 90.0 % | Hitrate: 3150 / Missrate: 71
IOPs: 3745 | ARC cache hit ratio: 90.0 % | Hitrate: 3674 / Missrate: 71
IOPs: 3363 | ARC cache hit ratio: 90.0 % | Hitrate: 3292 / Missrate: 71
IOPs: 3931 | ARC cache hit ratio: 90.0 % | Hitrate: 3856 / Missrate: 75
IOPs: 3765 | ARC cache hit ratio: 90.0 % | Hitrate: 3689 / Missrate: 76
IOPs: 4845 | ARC cache hit ratio: 90.0 % | Hitrate: 4772 / Missrate: 73
IOPs: 4422 | ARC cache hit ratio: 90.0 % | Hitrate: 4350 / Missrate: 72
IOPs: 5602 | ARC cache hit ratio: 90.0 % | Hitrate: 5531 / Missrate: 71
IOPs: 5351 | ARC cache hit ratio: 90.0 % | Hitrate: 5279 / Missrate: 72
IOPs: 6075 | ARC cache hit ratio: 90.0 % | Hitrate: 6004 / Missrate: 71
IOPs: 6586 | ARC cache hit ratio: 90.0 % | Hitrate: 6515 / Missrate: 71
IOPs: 7974 | ARC cache hit ratio: 90.0 % | Hitrate: 7907 / Missrate: 67
IOPs: 4434 | ARC cache hit ratio: 90.0 % | Hitrate: 4180 / Missrate: 254
IOPs: 9793 | ARC cache hit ratio: 90.0 % | Hitrate: 9721 / Missrate: 72
IOPs: 9395 | ARC cache hit ratio: 90.0 % | Hitrate: 9300 / Missrate: 95
IOPs: 6171 | ARC cache hit ratio: 90.0 % | Hitrate: 6089 / Missrate: 82
IOPs: 9209 | ARC cache hit ratio: 90.0 % | Hitrate: 9142 / Missrate: 67
IOPs: 14883 | ARC cache hit ratio: 90.0 % | Hitrate: 14817 / Missrate: 66
IOPs: 11304 | ARC cache hit ratio: 90.0 % | Hitrate: 11152 / Missrate: 152
IOPs: 228 | ARC cache hit ratio: 30.0 % | Hitrate: 71 / Missrate: 157
IOPs: 8321 | ARC cache hit ratio: 90.0 % | Hitrate: 8072 / Missrate: 249
IOPs: 15550 | ARC cache hit ratio: 90.0 % | Hitrate: 15450 / Missrate: 100
IOPs: 11819 | ARC cache hit ratio: 90.0 % | Hitrate: 11683 / Missrate: 136
IOPs: 28630 | ARC cache hit ratio: 90.0 % | Hitrate: 28367 / Missrate: 263
IOPs: 40484 | ARC cache hit ratio: 90.0 % | Hitrate: 40409 / Missrate: 75
IOPs: 104501 | ARC cache hit ratio: 90.0 % | Hitrate: 103982 / Missrate: 519
IOPs: 164483 | ARC cache hit ratio: 90.0 % | Hitrate: 163997 / Missrate: 486
IOPs: 229729 | ARC cache hit ratio: 90.0 % | Hitrate: 228956 / Missrate: 773
IOPs: 236479 | ARC cache hit ratio: 90.0 % | Hitrate: 235886 / Missrate: 593
IOPs: 249232 | ARC cache hit ratio: 90.0 % | Hitrate: 248836 / Missrate: 396
IOPs: 259156 | ARC cache hit ratio: 90.0 % | Hitrate: 258968 / Missrate: 188
IOPs: 276099 | ARC cache hit ratio: 90.0 % | Hitrate: 275857 / Missrate: 242
IOPs: 249382 | ARC cache hit ratio: 90.0 % | Hitrate: 249287 / Missrate: 95
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;What does this result mean? The RAM size is 16 GB and the test data size is only 6 GB. If you just continue performing random I/O, eventually all data will be in RAM. I believe that here, you witness the moment when all data is in RAM and the already high IOPs goes through the roof (250K IOPS). However, I cannot explain the increase of the Missrate. &lt;/p&gt;</content><category term="ZFS"/><category term="ZFS"/></entry><entry><title>Experiences running ZFS on Ubuntu Linux 12.04</title><link href="https://louwrentius.com/experiences-running-zfs-on-ubuntu-linux-1204.html" rel="alternate"/><published>2012-10-18T23:00:00+02:00</published><updated>2012-10-18T23:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2012-10-18:/experiences-running-zfs-on-ubuntu-linux-1204.html</id><summary type="html">&lt;p&gt;I really like ZFS because with current data sets, I do believe that data corruption may start becoming an issue. The thing is that the license under which ZFS is released does not permit it to be used in the Linux kernel. That's quite unfortunate, but there is hope. There …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I really like ZFS because with current data sets, I do believe that data corruption may start becoming an issue. The thing is that the license under which ZFS is released does not permit it to be used in the Linux kernel. That's quite unfortunate, but there is hope. There is a project called &lt;a href="http://zfsonlinux.org"&gt;'ZFS on Linux'&lt;/a&gt; which provides ZFS support through a kernel module, circumventing any license issues.&lt;/p&gt;
&lt;p&gt;But as ZFS is a true next generation file system and the only one in its class stable enough for production use, I decided to give it a try.&lt;/p&gt;
&lt;p&gt;I used my existing download server running Ubuntu 12.04 LTS. I followed these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;move all data to my big storage nas;&lt;/li&gt;
&lt;li&gt;destroy the existing MDADM RAID arrays;&lt;/li&gt;
&lt;li&gt;recreate a new storage array through ZFS;&lt;/li&gt;
&lt;li&gt;move all data back to the new storage array.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Installation of ZFS is straight forward and well documented by the ZFSonLinux project. The main thing is how you setup your storage. My download server has six 500 GB disks and four 2 TB disks, thus a total of ten drives. So I decided to create a single zpool (logical volume) consisting of two vdevs (arrays). I thus created a vdev of 6 500 GB drives and a second vdev of the four 2 TB drives.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@server:~# zpool status
  pool: zpool
 state: ONLINE
 scan: scrub repaired 0 in 1h12m with 0 errors on Fri Sep  7 
config:

    NAME                               STATE   READ WRITE CKSUM
    zpool                              ONLINE     0     0     0
      raidz1-0                         ONLINE     0     0     0
        pci-0000:03:04.0-scsi-0:0:1:0  ONLINE     0     0     0
        pci-0000:03:04.0-scsi-0:0:2:0  ONLINE     0     0     0
        pci-0000:03:04.0-scsi-0:0:3:0  ONLINE     0     0     0
        pci-0000:03:04.0-scsi-0:0:4:0  ONLINE     0     0     0
      raidz1-1                         ONLINE     0     0     0
        pci-0000:00:1f.2-scsi-2:0:0:0  ONLINE     0     0     0
        pci-0000:00:1f.2-scsi-3:0:0:0  ONLINE     0     0     0
        pci-0000:03:04.0-scsi-0:0:0:0  ONLINE     0     0     0
        pci-0000:03:04.0-scsi-0:0:5:0  ONLINE     0     0     0
        pci-0000:03:04.0-scsi-0:0:6:0  ONLINE     0     0     0
        pci-0000:03:04.0-scsi-0:0:7:0  ONLINE     0     0     0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So the zpool consists of two vdevs that each consist of the physical drives. &lt;/p&gt;
&lt;p&gt;Everything is going smooth so far. I did have one issue though. I decided to remove a separate disk drive from the system that was no longer needed. As I initially setup the arrays based on device names (/dev/sda, /dev/sdb), the array broke as device names changed due to the missing drive. &lt;/p&gt;
&lt;p&gt;So I repared that by issuing these commands:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;zpool export zpool
zpool import zpool -d /dev/disk/by-path/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It's important to carefully read the &lt;a href="http://zfsonlinux.org/faq.html#WhatDevNamesShouldIUseWhenCreatingMyPool"&gt;FAQ of ZFS on Linux&lt;/a&gt; and understand that you should not use regular device names like /dev/sda for your ZFS array. 
It is recommended to use /dev/disk/by-path/ or /dev/disk/zpool/ exactly to prevent the issue I had with the disappeared drive.&lt;/p&gt;
&lt;p&gt;As discussed in my &lt;a href="https://louwrentius.com/blog/2011/02/why-i-do-not-use-zfs-as-a-file-system-for-my-nas/"&gt;blog entry&lt;/a&gt; on why I decided not to use ZFS for my big 18 TB storage NAS, ZFS does not support 'growing' of an array as Linux software RAID does. &lt;/p&gt;
&lt;p&gt;As the zpool consists of different hard disk types, performance tests are not consistent. I've seen 450 MB/s read speeds on the zpool, which is more than sufficient for me.&lt;/p&gt;
&lt;p&gt;ZFS on Linux works, is fast enough and easy to setup. If I would have setup my big storage NAS today, I would probably have chosen ZFS on Linux by now. I would have accepted that I could not just expand the array with extra drives the way MDADM permits you to grow an array.&lt;/p&gt;
&lt;p&gt;In some way, ZFS on Linux is combining the best of both world. One of the best modern file systems with a modern and well-supported Linux distribution. Only the ZFS module itself may be the weak factor as it's fairly new for Linux and not optimised yet. &lt;/p&gt;
&lt;p&gt;Or we might have to just wait until BTFS is mature enough for production use.&lt;/p&gt;</content><category term="ZFS"/></entry><entry><title>Why I do not use ZFS as a file system for my NAS</title><link href="https://louwrentius.com/why-i-do-not-use-zfs-as-a-file-system-for-my-nas.html" rel="alternate"/><published>2011-02-28T21:00:00+01:00</published><updated>2011-02-28T21:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2011-02-28:/why-i-do-not-use-zfs-as-a-file-system-for-my-nas.html</id><summary type="html">&lt;p&gt;Many people have asked me why I do not use ZFS for my NAS storage box. This is a good question and I have multpile reasons why I do not use ZFS and probably never will.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;** A lot has changed since this article was first published. &lt;a href="https://louwrentius.com/why-i-do-use-zfs-as-a-file-system-for-my-nas.html"&gt;I do now recommend …&lt;/a&gt;&lt;/p&gt;</summary><content type="html">&lt;p&gt;Many people have asked me why I do not use ZFS for my NAS storage box. This is a good question and I have multpile reasons why I do not use ZFS and probably never will.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;** A lot has changed since this article was first published. &lt;a href="https://louwrentius.com/why-i-do-use-zfs-as-a-file-system-for-my-nas.html"&gt;I do now recommend using ZFS&lt;/a&gt;. I've also based my new &lt;a href="https://louwrentius.com/74tb-diy-nas-based-on-zfs-on-linux.html"&gt;71 TiB NAS&lt;/a&gt; on ZFS. **&lt;/p&gt;
&lt;hr /&gt;
&lt;h3&gt;The demise of Solaris&lt;/h3&gt;
&lt;p&gt;ZFS is invented by Sun for the Solaris operating system. When I was building my NAS, the only full-featured and production-ready version of ZFS is implemented in Sun Solaris. The only usable version of Solaris was Open Solaris. I dismissed using Open Solaris because of the lack of hardware support and the small user base. This small user base is very important to me. More users is more testing. More support.  &lt;/p&gt;
&lt;p&gt;The FreeBSD implementation of ZFS became only stable in January 2010, 6 months after I build my NAS (summer 2009). So FreeBSD was not an option at that time.&lt;/p&gt;
&lt;p&gt;I am glad that I didn't go for Open Solaris, as Suns new owner Oracle has killed this operating system in August 2010. Although ZFS is open source software, I think it is actually closed source already. The only open source version was through Open Solaris. That software is now killed. Oracle will close the source of ZFS just by not publishing the code of new features and updates. Only their proprietary closed source Solaris platform will obtain updates. But I must say that I don't have proof on this. However, Oracle seems to have at least no interest in open source software and almost seems to be hostile towards it.&lt;/p&gt;
&lt;h3&gt;FreeBSD and ZFS&lt;/h3&gt;
&lt;p&gt;So I build my NAS when basically ZFS was not around yet. But with FreeBSD as of today you can build a NAS based on ZFS right? Sure, you can do that. I had no choice back then but you do. But to be honest, I still would not use ZFS. As of March 1th, 2011, I would still go with Linux software RAID and XFS.&lt;/p&gt;
&lt;p&gt;The reasons are maybe not that great, I just provide them for you. It's up for you to decide.&lt;/p&gt;
&lt;p&gt;I sincerely do respect the FreeBSD community and platform, but it is not for me. It may be that I have just much more experience with Debian Linux and just don't like changing platforms. I find the installation process much more user friendly, I see a year over year improvement on Debian, I see none on the 8.2 FreeBSD release.  Furthermore, I'm just thrilled with the really big APT repository. Last, I cannot oversee future requirements. But I'm sure that those requirements have a higher chance to support Linux than BSD.  &lt;/p&gt;
&lt;p&gt;Furthermore, although FreeBSD has a community, it is relatively small. Resources on Debian an Ubuntu are abundant. I consider Linux a safer bet, also on the part of hardware support. My NAS must be simple to build and rock stable. I don't want to have a day time job just getting my NAS to work and maintain it.&lt;/p&gt;
&lt;p&gt;If you are experienced with FreeBSD, by all means, built a ZFS setup if you want. If you have to learn either BSD or Linux, I consider knowledge about Linux more valuable in the long run.&lt;/p&gt;
&lt;h3&gt;ZFS is a hype&lt;/h3&gt;
&lt;p&gt;This is the part where people may strongly disagree with me. I admire ZFS, but I consider it total overkill for home usage. I have seen many people talking about ZFS like Apple users about Apple products. It is a hype. Don't get me wrong. As a long-time Mac user I'm also mocking myself here. I get the impression that ZFS is regarded as the second coming of Jesus Christ. It solves problems that I didn't know of in the first place. The only thing it can't do is beat Chuck Norris. But it does vacuum your house if you ask it to.&lt;/p&gt;
&lt;p&gt;As a side note, one of the things I do not like about ZFS is the terminology. It is just RAID 0, RAID 1, RAID 5 or 6 but no, the ZFS people had to use different, more cool sounding terms like RAID Z or something. But it is basically the same thing. &lt;/p&gt;
&lt;p&gt;Okay, now back to the point: nobody at home needs ZFS. You may argue that nobody needs 18 TB of storage space at home, but that's another story. Running ZFS means using FreeBSD or an out-of-the-box NAS solution based on FreeBSD. And there aren't any other relevant options. &lt;/p&gt;
&lt;p&gt;Now, lets take a look at the requirements of most NAS builders. They want as much storage that is possible at the lowest price possible. That's about it. Many people want to add additional disk drives as their demand for storage capacity increases. So people buy a solution with a capacity for say 10 drives and start out with 4 drives and add disks when they need it.&lt;/p&gt;
&lt;p&gt;Linux allows you to 'grow' or 'expand' an array, just like most hardware RAID solutions. As far as I know, this is a feature is still not available in ZFS. Maybe this feature is not relevant in the enterprise world, but it is for most people who actually have to think about how they spend their money.&lt;/p&gt;
&lt;p&gt;Furthermore, I don't understand Why I can run any RAID array with decent performance with maybe 512 MB of RAM while ZFS would just totally crash with so little memory installed. You seem to need at least 2 GB to prevent crashing your system. More is recommended if you want to prevent it from crashing under high load or something. I really can't wrap my mind about this. Honestly, I think this is insane.&lt;/p&gt;
&lt;p&gt;ZFS does great things. Management is easy. Many features are cool. Snapshots, other stuff. But most features are just not required for a home setup. ZFS seems to solve a lot of 'scares' that I've only heard about since ZFS came along. Like the RAID 5/6 write hole. Where others just hookup a UPS in the first place (if you don't use a UPS on your NAS, you might as well also try and see if you are lucky running RAID 0) they find a solution that prevents data loss when power fails. One of the most interesting features to me is though that ZFS checksums all data and detects corruption. But I like it because it sounds useful, but how high are the chances that you need this stuff? &lt;/p&gt;
&lt;p&gt;If ZFS would be available under Linux as a native option instead of through FUSE, I would probably consider using it if I would know in advance that I would not want to expand or grow my array in the future. But I am pessimistic about this scenario. It is not in Oracle's interest to change the license on ZFS in order to allow Linux to incorporate support for it in the kernel.&lt;/p&gt;
&lt;p&gt;To build my 20 disk RAID array, I had to puzzle with my drives to keep all data while migrating to the new system. Some of the 20 disks came from my old NAS system, so I had to repeatedly grow the array and add disks, which I couldn't have done with ZFS.&lt;/p&gt;
&lt;h3&gt;Why I choose to build this setup.&lt;/h3&gt;
&lt;p&gt;The array is just a single 20 disk RAID 6 volume created with a single MDADM command. The second command I issued to make my array operational was to format this new 'virtual' disk with XFS, which just takes seconds. A UPS protects the systems against power failure and I'm happy with it for 1.5 years now. Never had any problems. Never had a disk failure... A single RAID 6 array is simple and fast. XFS is old but reliable. My whole setup is just this: extremely simple. I just love simple.  &lt;/p&gt;
&lt;p&gt;My array does not use LVM, so I cannot create snapshots or stuff like that. But I don't need it. I just want so much storage that I don't have to think about it. And I think most people just want some storage share with lots of space. In that case, you don't need LVM or stuff like that. Just an array with a file system on top of it. If you can grow the array and the file system, you're set for the future. Speaking about the future: please note that on Linux, XFS is the only file system that is capable of addressing more than 16 TB of data. EXT4 is still limited to 16 TB. &lt;/p&gt;
&lt;p&gt;For the future, my hopes are that BTRFS will become a modern viable alternative to ZFS.&lt;/p&gt;</content><category term="ZFS"/></entry></feed>