New disk layout using btrfs

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.

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:

  1. /home -> oreganodata/home
  2. /mail->oreganodata/mail,  /var/lib/imap and /var/spool/imap symlink to the /mail/lib and /mail/spool directories.
  3. /var/lib/mysql->oreganodata/maria
  4. /usr/local/bin->oreganodata/bin
  5. /etc/pki/mycerts->oreganodata/certs
  6. /var/webdata->oreganodata/webdata (websites have symlinks to /var/webdata as needed)


In addition oreganodata has two other subvolumes:

  1. oreganodata/backupcache which has a nightly copy of /etc and /root,
  2. oreganodata/snapshots where 2 nights of snapshots are kept of /home, /maria and /mail.

These two subvolumes are not typically mounted. The backupcache subvolume is mounted during the nightly backup process to capture /etc,  /root and anything else that occurs to me that I might need.

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.