{"id":547,"date":"2014-04-10T08:42:38","date_gmt":"2014-04-10T14:42:38","guid":{"rendered":"http:\/\/wmbuck.net\/blog\/?p=547"},"modified":"2020-05-23T11:11:22","modified_gmt":"2020-05-23T17:11:22","slug":"new-disk-layout-using-btrfs","status":"publish","type":"post","link":"https:\/\/wmbuck.net\/blog\/?p=547","title":{"rendered":"New disk layout using btrfs"},"content":{"rendered":"<p>Preparatory to doing an upgrade of Fedora on one of my linux boxes, I decided it was time to revise the disk layouts. Specifically, I finally got around to building a separate partition for \/home. After doing a little reading, it looked to me like a good way to do this was to use btrfs. Initially I also made a separate \/var, but decided that was both unneeded and error prone, and went another way. The main objective of this work was to reduce the drag in upgrading Fedora.<\/p>\n<p>Root is on a small (64GB) SSD, LUKS encrypted which has \/boot and an LVM VG for \/ and swap. \/ is ext4. I built a 2GB mdadm raid-1 mirror with LUKS encryption on top of it, and then layered a btrfs file system on that called oreganodata. The root of oreganodata is not typically mounted, but has the following subvolumes automounted at boot time:<\/p>\n<ol>\n<li>\/home -&gt; oreganodata\/home<\/li>\n<li>\/mail-&gt;oreganodata\/mail,&nbsp; \/var\/lib\/imap and \/var\/spool\/imap symlink to the \/mail\/lib and \/mail\/spool directories.<\/li>\n<li>\/var\/lib\/mysql-&gt;oreganodata\/maria<\/li>\n<li>\/usr\/local\/bin-&gt;oreganodata\/bin<\/li>\n<li>\/etc\/pki\/mycerts-&gt;oreganodata\/certs<\/li>\n<li>\/var\/webdata-&gt;oreganodata\/webdata (websites have symlinks to \/var\/webdata as needed)<\/li>\n<\/ol>\n<p><!--more--><br \/>\nIn addition oreganodata has two other subvolumes:<\/p>\n<ol>\n<li>oreganodata\/backupcache which has a nightly copy of \/etc and \/root,<\/li>\n<li>oreganodata\/snapshots where 2 nights of snapshots are kept of \/home, \/maria and \/mail.<\/li>\n<\/ol>\n<p>These two subvolumes are not typically mounted. The backupcache subvolume is mounted during the nightly backup process to capture \/etc,&nbsp; \/root and anything else that occurs to me that I might need.<\/p>\n<p>With this scheme creating a new \/ in order to install a new version of Fedora is much, much easier. After installing there is not much to do. Recreate the user accounts and the fstab, and some symlinks in various places.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Preparatory to doing an upgrade of Fedora on one of my linux boxes, I decided it was time to revise the disk layouts. Specifically, I finally got around to building a separate partition for \/home. After doing a little reading, it looked to me like a good way to do this was to use btrfs. &hellip; <a href=\"https:\/\/wmbuck.net\/blog\/?p=547\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">New disk layout using btrfs<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40,54,11,10,4],"tags":[],"class_list":["post-547","post","type-post","status-publish","format-standard","hentry","category-boot-issues","category-btrfs","category-encryption","category-fedora","category-linux"],"_links":{"self":[{"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/547"}],"collection":[{"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=547"}],"version-history":[{"count":5,"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/547\/revisions"}],"predecessor-version":[{"id":1129,"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/547\/revisions\/1129"}],"wp:attachment":[{"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=547"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=547"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=547"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}