{"id":5738,"date":"2020-04-26T14:17:41","date_gmt":"2020-04-26T14:17:41","guid":{"rendered":"https:\/\/really.zonky.org\/?p=5738"},"modified":"2020-04-29T05:56:43","modified_gmt":"2020-04-29T05:56:43","slug":"ubuntu-zfs-why-all-the-filesystems","status":"publish","type":"post","link":"https:\/\/really.zonky.org\/?p=5738","title":{"rendered":"Ubuntu ZFS: Why All The Filesystems?"},"content":{"rendered":"\n\n\n<p>A number of those who have experimented with Ubuntu&#8217;s ZFS install option (which as of 20.04 is marked as &#8220;experimental&#8221;) have expressed bewilderment over the number of filesystems created :-<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"695\" height=\"391\" src=\"https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/ubuntu-20-df.png?resize=695%2C391&#038;ssl=1\" alt=\"\" class=\"wp-image-5742\" srcset=\"https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/ubuntu-20-df.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/ubuntu-20-df.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/ubuntu-20-df.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/ubuntu-20-df.png?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/ubuntu-20-df.png?resize=2048%2C1152&amp;ssl=1 2048w, https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/ubuntu-20-df.png?w=1390&amp;ssl=1 1390w\" sizes=\"auto, (max-width: 695px) 100vw, 695px\" \/><\/figure>\n\n\n\n<p>The short answer as to why is that there are two schools of thought amongst grizzled old Unix veterans as to whether one big filesystem should be the way to go or lots of little ones. There are pros and cons to both approaches, and whilst I have a preference for lots of filesystems (especially on servers), I don&#8217;t care enough to change it on a laptop install.<\/p>\n\n\n\n<p>Even though those who insist on one big filesystem are wrong.<\/p>\n\n\n\n<p>As to the longer explanation \u2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Some History<\/h2>\n\n\n\n<p>A <em>long<\/em> time ago &#8211; the 1970s or the 1980s &#8211; Unix systems lacked sophisticated disk management software, and the disks were very much smaller (I started off with 80Mbyte disks and no that isn&#8217;t a typo, and many started with much smaller disks). On larger Unix servers, you <em>couldn&#8217;t<\/em> fit everything onto one disk, so we got used to splitting up the filesystem into many separate filesystem &#8211; \/ on one disk partition (or slice), \/usr on another, \/var on a third, \/home on yet another, etc. <\/p>\n\n\n\n<p>These very frequently got further subdivided &#8211; <em>\/var\/mail<\/em>, <em>\/var\/tmp<\/em>, <em>\/var\/spool<\/em>, etc. as Unix servers got larger and busier. <\/p>\n\n\n\n<p>Those days are long past, and nobody is keen to go back to those days so why do some still like to split things up?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Fringe Benefits of Splitting<\/h2>\n\n\n\n<p>It turns out that there was a fringe benefit to splitting up the filesystems &#8211; disk space exhaustion on one wouldn&#8217;t cause a problem elsewhere. For example if a mail server had a separate <em>\/var\/spool\/mail<\/em> filesystem for operating within it would still continue to operate if <em>\/var<\/em> filled up; similarly a DNS server wouldn&#8217;t crash and burn if it had a <em>\/var\/named<\/em> filesystem and <em>\/var<\/em> filled up. <\/p>\n\n\n\n<p>Both of those examples are known to me personally &#8211; and there are many other examples.<\/p>\n\n\n\n<p>Of course there is also a downside &#8211; if you create a separate <em>\/var\/spool\/mail<\/em> filesystem you need to make sure it is large enough to operate not just normally but in reasonable exceptional circumstances. Or your mail server crashes and burns. <\/p>\n\n\n\n<p>On the other hand, if you don&#8217;t separate things out then when something goes berserk and fills up <em>all<\/em> the disk space then you will have a good deal of trouble actually logging in to fix things.<\/p>\n\n\n\n<p>In a sense, the &#8220;everything in one&#8221; camp and &#8220;lots of little filesystems&#8221; camp are determined by what troubles we&#8217;ve seen over the years (and in some cases decades). <\/p>\n\n\n\n<p>With something like ZFS you can set <em>quotas<\/em> to limit the size of any filesystem so managing the sizes of these separate filesystems is a great deal easier than it ever was in the past! <em>Ubuntu does not set quotas by default on a desktop installation; for a server it may well be worth checking quotas and setting them appropriately.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">And Snapshots \u2026<\/h2>\n\n\n\n<p>One of the other things that Ubuntu does with ZFS and filesystem snapshots (we&#8217;ll worry about what those are another time) is to offer to rollback a broken update. People worry that upgrading their system will break things and the ability to quickly revert to the previous state is <em>very<\/em> comforting.<\/p>\n\n\n\n<p>But the Unix file layout &#8220;standard&#8221; and the later Linux file layout standard were not designed with snapshots in mind, and simply rolling back the whole of &#8220;\/&#8221; would have negative effects &#8211; not least you would lose any file changes you had made in <em>\/home<\/em> and any mail stashed away in <em>\/var\/mail<\/em>. <\/p>\n\n\n\n<p>So to implement the ability to rollback updates <em>requires<\/em> numerous separate filesystems to avoid losing important data. <\/p>\n\n\n\n<p>It is also likely that it would be beneficial to tune separate filesystems for different requirements.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Finally<\/h2>\n\n\n\n<p>In short, don&#8217;t worry about it. It&#8217;ll have very little effect on your operation of a normal Ubuntu machine unless you choose to take advantage of it. And it makes possible certain features that you will probably like &#8211; such as the ability to revert updates.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A number of those who have experimented with Ubuntu&#8217;s ZFS install option (which as of 20.04 is marked as &#8220;experimental&#8221;) have expressed bewilderment over the number of filesystems created :- The short answer as to why is that there are two schools of thought amongst grizzled old Unix veterans as to whether one big filesystem <a href='https:\/\/really.zonky.org\/?p=5738' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_share_on_mastodon":"0"},"categories":[4,209],"tags":[43,61,88],"class_list":["post-5738","post","type-post","status-publish","format-standard","hentry","category-it","category-linux-it","tag-linux","tag-ubuntu","tag-zfs","category-4-id","category-209-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1f2KI-1uy","_links":{"self":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/5738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5738"}],"version-history":[{"count":4,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/5738\/revisions"}],"predecessor-version":[{"id":5752,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/5738\/revisions\/5752"}],"wp:attachment":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}