<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://lug.mtu.edu/w/index.php?action=history&amp;feed=atom&amp;title=ZFS</id>
	<title>ZFS - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://lug.mtu.edu/w/index.php?action=history&amp;feed=atom&amp;title=ZFS"/>
	<link rel="alternate" type="text/html" href="https://lug.mtu.edu/w/index.php?title=ZFS&amp;action=history"/>
	<updated>2026-04-30T02:10:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://lug.mtu.edu/w/index.php?title=ZFS&amp;diff=7107&amp;oldid=prev</id>
		<title>D2wn: initial commit (very rough draft)</title>
		<link rel="alternate" type="text/html" href="https://lug.mtu.edu/w/index.php?title=ZFS&amp;diff=7107&amp;oldid=prev"/>
		<updated>2024-07-14T10:36:51Z</updated>

		<summary type="html">&lt;p&gt;initial commit (very rough draft)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;This page is currently full of schizobabble as I work on creating it, please ignore for the time being.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Described as &amp;quot;the last word in filesystems&amp;quot; (cite), ZFS is cool&lt;br /&gt;
&lt;br /&gt;
Frequently used on servers, not typically workstations (leads into license issues, BTRFS claim to fame)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ZFS does block-level compression/redundancy vs file level as in BTRFS&lt;br /&gt;
&lt;br /&gt;
Everything is all built in, no dealing with layering filesystems with mdadm/dm-integrity(some guy on /g/ said is bad?) like the traditional way (link to page on software raid, should have a little diagram showing how block-device layering works, also figure out the correct terminology)&lt;br /&gt;
&lt;br /&gt;
bitrot protection&lt;br /&gt;
&lt;br /&gt;
error correcting&lt;br /&gt;
&lt;br /&gt;
how scrubs work&lt;br /&gt;
&lt;br /&gt;
== FOSS / License Status ==&lt;br /&gt;
not GPL compatible, SUN, Oracle, &lt;br /&gt;
&lt;br /&gt;
== RAID Levels ==&lt;br /&gt;
RAID0 = striped&lt;br /&gt;
&lt;br /&gt;
RAID1 = mirror&lt;br /&gt;
&lt;br /&gt;
RAID10 = a bunch of mirrors&lt;br /&gt;
&lt;br /&gt;
RAID5 = RAIDZ1 (&amp;quot;1&amp;quot; drive can fail?)&lt;br /&gt;
&lt;br /&gt;
RAID6 = RAIDZ2 (&amp;quot;2&amp;quot; drives can fail?)&lt;br /&gt;
&lt;br /&gt;
???? = RAIDZ3 (&amp;quot;3&amp;quot; drives can fail?)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://en.wikipedia.org/wiki/ZFS#RAID_(&amp;amp;#x22;RAID-Z&amp;amp;#x22;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ZFS is pretty flexible with pool layouts, it&amp;#039;s vdevs that aren&amp;#039;t&lt;br /&gt;
&lt;br /&gt;
you can add/remove vdevs from a pool, but you can&amp;#039;t add/remove disks from a vdev (well, until recently)&lt;br /&gt;
&lt;br /&gt;
no, you&amp;#039;d put the disks into two RAID1 (&amp;quot;mirrored&amp;quot;) vdevs in one single pool&lt;br /&gt;
&lt;br /&gt;
I actually sent this a little while ago, but ZFS abstracts storage into a couple different logical levels. It goes from Disks -&amp;gt; VDEVs -&amp;gt; zpools -&amp;gt; dataset&lt;br /&gt;
&lt;br /&gt;
we have 14 total raw disks, each in a mirrored vdev with one other disk, in one single zpool (named &amp;quot;zhome&amp;quot;), that itself has individual datasets for each user&amp;#039;s homedir (so each homedir can create/revert a snapshot independently)&lt;br /&gt;
&lt;br /&gt;
then each dataset is mounted to it&amp;#039;s respective path on the filesystem, in this example it&amp;#039;s always  /home/&amp;lt;user&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So for your plan with the disks, you&amp;#039;d put the first two into a mirrored vdev in one pool, then later once you get the other two disks, you simply add them to a new mirrored vdev in the same pool&lt;br /&gt;
&lt;br /&gt;
this isn&amp;#039;t recommended, as logically half the content in the pool will already be split among the first two disks, with the latter two disks having more space, so new content will be shifted onto them more often&lt;br /&gt;
&lt;br /&gt;
This causes a performance penalty but it will function just fine (and there may be a way to manually resliver a pool that has this issue, though I haven&amp;#039;t had to look into it)&lt;br /&gt;
&lt;br /&gt;
So for your pool, it&amp;#039;d probably look like this to start out:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
DISK  |    VDEV    |  ZPOOL  | DATASET&lt;br /&gt;
DISK1 -&amp;gt; mirror-0 -|         |&lt;br /&gt;
DISK2 /            | zpool1 -| zpool1/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
then once you add the two new disks:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
DISK  |    VDEV    |  ZPOOL  | DATASET&lt;br /&gt;
DISK1 -&amp;gt; mirror-0 -|         |&lt;br /&gt;
DISK2 /            | zpool1 -| zpool1/&lt;br /&gt;
DISK3 -&amp;gt; mirror-1 -|         |&lt;br /&gt;
DISK4 /            |         |&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;the command would be: &amp;lt;code&amp;gt;zpool create zpool1 mirror ata-APPLE_HDD_ST500LM012_S33MJ9AF303107 ata-WDC_WD5000BPVT-22HXZT3_WD-WXF1EB0NC891&amp;lt;/code&amp;gt; to create the initial pool (though with different disks serial numbers)&lt;br /&gt;
&lt;br /&gt;
and the command to add the two new disks would be: &amp;lt;code&amp;gt;zpool add zpool1 mirror ata-WDC_WD5000BEVT-75A0RT0_WD-WX81A70N2643 ata-WDC_WD5000LPVX-75V0TT0_WXB1AC41L1DY&amp;lt;/code&amp;gt; (also with different serial numbers)&lt;br /&gt;
&lt;br /&gt;
You can put whatever vdevs you want into a pool, for example this is my home NAS:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   DISK   |    VDEV    |  ZPOOL  | DATASET&lt;br /&gt;
10TB DISK -&amp;gt; raidz2-0 -|         |&lt;br /&gt;
10TB DISK /            |         |&lt;br /&gt;
10TB DISK /            |         |&lt;br /&gt;
10TB DISK /            |         |&lt;br /&gt;
10TB DISK /            |         |&lt;br /&gt;
10TB DISK /            |         |&lt;br /&gt;
10TB DISK /            |         |&lt;br /&gt;
10TB DISK -&amp;gt; raidz2-1 -|  JBOD  -| JBOD/Data&lt;br /&gt;
10TB DISK /            |         |&lt;br /&gt;
10TB DISK /            |         |&lt;br /&gt;
10TB DISK /            |         |&lt;br /&gt;
10TB DISK /            |         |&lt;br /&gt;
10TB DISK /            |         |&lt;br /&gt;
10TB DISK /            |         |&lt;br /&gt;
10TB DISK -&amp;gt; hotspare -|         |&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;a RAIDZ2 vdev means two disks total can fail without losing data, and since I have two of them it&amp;#039;s a RAID60&lt;br /&gt;
&lt;br /&gt;
I wouldn&amp;#039;t recommend it though, I plan to transfer all my data and reformat the pool as RAID10 because RAID60 is slooooooooooow &lt;br /&gt;
&lt;br /&gt;
Steal Stevens diagram in Storage_management on LVM and adjust for HDD/vdev/zpool/dataset layers to use as visual guide&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
yeah ZFS just abstracts devices a bit more than a normal RAID&lt;br /&gt;
&lt;br /&gt;
so you have disks-&amp;gt;vdevs-&amp;gt;pools-&amp;gt;datasets&lt;br /&gt;
&lt;br /&gt;
almost like a pseudo OSI-model for storage&lt;br /&gt;
&lt;br /&gt;
you can group multiple disks into a vdev, then multiple vdevs into a pool&lt;br /&gt;
&lt;br /&gt;
so for example, in that image you have 6 disks, grouped into 3 vdevs, in one pool&lt;br /&gt;
&lt;br /&gt;
and specifically, the vdevs are mirrors, which makes it RAID10 (a bunch of mini-RAID1&amp;#039;s in one big RAID0)&lt;br /&gt;
&lt;br /&gt;
the setup I have on my home NAS is RAID60, where I have two RAID6 vdevs in one pool&lt;br /&gt;
&lt;br /&gt;
and then datasets is just what sits on top of a pool, and lets you set quotas and separate snapshots&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On LUG&amp;#039;s shell for example, the zpool configuration looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
    DISK    |   VDEV    |  ZPOOL  | DATASET&lt;br /&gt;
500GB DISK -&amp;gt; mirror-0 -|         | zhome/adam&lt;br /&gt;
500GB DISK /            |         | zhome/alhirzel&lt;br /&gt;
500GB DISK -&amp;gt; mirror-1 -|         | zhome/allen&lt;br /&gt;
500GB DISK /            |         | zhome/avonyx&lt;br /&gt;
500GB DISK -&amp;gt; mirror-2 -|         | zhome/chefy&lt;br /&gt;
500GB DISK /            |         | zhome/dane&lt;br /&gt;
500GB DISK -&amp;gt; mirror-3 -| zhome - | zhome/david&lt;br /&gt;
500GB DISK /            |         | zhome/dev&lt;br /&gt;
500GB DISK -&amp;gt; mirror-4 -|         | zhome/jhstiebe&lt;br /&gt;
500GB DISK /            |         | zhome/noah&lt;br /&gt;
500GB DISK -&amp;gt; mirror-5 -|         | zhome/ron&lt;br /&gt;
500GB DISK /            |         | zhome/ryan&lt;br /&gt;
500GB DISK -&amp;gt; mirror-6 -|         | zhome/saladin&lt;br /&gt;
500GB DISK /            |         | etc etc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RAID 10 vs RAID 01:&lt;br /&gt;
&lt;br /&gt;
due to how many disks need to be spun up to rebuild, 1 with RAID10, 3 with RAID01&lt;br /&gt;
&lt;br /&gt;
no one uses RAID01, more disk wear for essentially same result&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
lz4 (link backblaze testing showing lz4 is more benifical than no compression due to reduced disk seek itmes)&lt;br /&gt;
&lt;br /&gt;
zstd&lt;br /&gt;
&lt;br /&gt;
gzip&lt;br /&gt;
&lt;br /&gt;
the ZFS exclusive one no one uses anymore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
can be applied at dataset or pool level&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
below example from the LUG Shell server, where each user&amp;#039;s home directory is a ZFS dataset with lz4 compression enabled:&lt;br /&gt;
&lt;br /&gt;
check a file&amp;#039;s size on disk:&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
noah@shell:~/hnarchive $ du -h hnarchive.db&lt;br /&gt;
13G hnarchive.db&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;check the actual file size (useful for webservers to tell how many bytes will go over the wire when a client downloads the file):&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
noah@shell:~/hnarchive $ du -h --apparent-size hnarchive.db&lt;br /&gt;
22G hnarchive.db&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;this data is very compressible because it is a database of text comments left by users on a social media platform (Hacker News)&lt;br /&gt;
&lt;br /&gt;
== Encryption ==&lt;br /&gt;
send/recive kinda broken in openzfs, user beware (send/recive from one encrypted pool to another encrypted pool with differing keys causes corruption, reportedly no issues when sending from or receiving to an unencrypted pool)&lt;br /&gt;
&lt;br /&gt;
encrypt whole pool and thus all future child datasets via inheritence, or indivusla encryption per-dataset&lt;br /&gt;
&lt;br /&gt;
script I use on freebsd to auto-decrypt and mount the root pool (and why it&amp;#039;s not needed on systemd, what it does)&lt;br /&gt;
&lt;br /&gt;
== Deduplication ==&lt;br /&gt;
dont use&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ECC memory (ZFS wants..?)&lt;br /&gt;
&lt;br /&gt;
memory hog misconception (only really when enabling dedupe, and you shouldnt most of the time)&lt;br /&gt;
&lt;br /&gt;
dedupe requires FS table to me stored in RAM, about 1GB of memory per 1TB of storage is general guide for memory needed for dedupe&lt;br /&gt;
&lt;br /&gt;
BTRFS apparently does offline dedupe and doesn&amp;#039;t have as much memory requirement&lt;br /&gt;
&lt;br /&gt;
== Snapshots ==&lt;br /&gt;
pretty neat&lt;br /&gt;
&lt;br /&gt;
snapshots occur at the block-level (like the rest of ZFS)&lt;br /&gt;
&lt;br /&gt;
take up more storage the more &amp;#039;different&amp;#039; the dataset becomes from the time you took the snapshot&lt;br /&gt;
&lt;br /&gt;
e.g. creating a snapshot of a dataset with 50G of data initially takes up zero space, but if you delete the 50G of data then the snapshot now occupies 50G of space.&lt;br /&gt;
&lt;br /&gt;
Alternatively, if the dataset has 50G of data and you copy over 100G more data, now the snapshot occupies 100G of space (meaning now a total of 200G of space is being taken up by the dataset in total) &lt;br /&gt;
&lt;br /&gt;
== Usage / Tips and Tricks / Guide ==&lt;br /&gt;
should be biggest section, just paste common commands and maybe steal some from tldr as well as their output in a code-block formatted text.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;zfs set quota=150G zhome/$username&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Performance Optimizations (/ &amp;quot;Tuning&amp;quot;) ==&lt;br /&gt;
ashift, 512 vs 4096 (for performance)&lt;br /&gt;
&lt;br /&gt;
Write/read cache (https://www.reddit.com/r/freenas/comments/70h8tf/slog_write_cache_question/dn3aau4/)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://www.youtube.com/watch?v=l55GfAwa8RI&lt;br /&gt;
&lt;br /&gt;
https://www.youtube.com/watch?v=Hjpqa_kjCOI&lt;br /&gt;
&lt;br /&gt;
same presentation, but some more modern than others? &lt;br /&gt;
&lt;br /&gt;
https://www.cs.utexas.edu/~dahlin/Classes/GradOS/papers/zfs_lc_preso.pdf&lt;br /&gt;
&lt;br /&gt;
https://pages.cs.wisc.edu/~dusseau/Classes/CS736/CS736-F13/Lectures/1_zfs_overview.pdf&lt;br /&gt;
&lt;br /&gt;
https://www.racf.bnl.gov/Facility/TechnologyMeeting/Archive/Apr-09-2007/zfs.pdf&lt;br /&gt;
&lt;br /&gt;
https://www.snia.org/sites/default/orig/sdc_archives/2008_presentations/monday/JeffBonwick-BillMoore_ZFS.pdf&lt;/div&gt;</summary>
		<author><name>D2wn</name></author>
	</entry>
</feed>