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:
- /home -> oreganodata/home
- /mail->oreganodata/mail, /var/lib/imap and /var/spool/imap symlink to the /mail/lib and /mail/spool directories.
- /var/lib/mysql->oreganodata/maria
- /usr/local/bin->oreganodata/bin
- /etc/pki/mycerts->oreganodata/certs
- /var/webdata->oreganodata/webdata (websites have symlinks to /var/webdata as needed)
In addition oreganodata has two other subvolumes:
- oreganodata/backupcache which has a nightly copy of /etc and /root,
- 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.