From ada1a01892f417657164747ae245556e8df3cf8b Mon Sep 17 00:00:00 2001 From: rogarb Date: Fri, 21 Jul 2023 15:46:02 +0200 Subject: [PATCH] docs/upgrade-guide.md: BTRFS subvolume changes The upgrade guide is updated to reflect the changes introduced in commit 7f3b98f. --- docs/upgrade-guide.md | 53 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/docs/upgrade-guide.md b/docs/upgrade-guide.md index 9c1b293..c967863 100644 --- a/docs/upgrade-guide.md +++ b/docs/upgrade-guide.md @@ -1,3 +1,56 @@ +# 2023-07-09 121df48 + +Changes: + - BTRFS subvolumes are mounted if and only their `mountpoint` is set. + +Especially, if you have specific mount options for a subvolume (through `mountOptions`), make sure to set `mountpoint` otherwise the subvolume will not be mounted. + +This change allows more flexibility when using BTRFS, giving access to its volume management functionality. + +It allows layouts as the following: +```nix +content = { + type = "btrfs"; + # BTRFS partition is not mounted as it doesn't set a mountpoint explicitly + subvolumes = { + # This subvolume will not be mounted + "SYSTEM" = { }; + # mounted as "/" + "SYSTEM/rootfs" = { + mountpoint = "/"; + }; + # mounted as "/nix" + "SYSTEM/nix" = { + mountOptions = [ "compress=zstd" "noatime" ]; + mountpoint = "/nix"; + }; + # This subvolume will not be mounted + "DATA" = { }; + # mounted as "/home" + "DATA/home" = { + mountOptions = [ "compress=zstd" ]; + mountpoint = "/home"; + }; + # mounted as "/var/www" + "DATA/www" = { + mountpoint = "/var/www"; + }; + }; +}; +``` +corresponding to the following BTRFS layout: +``` +BTRFS partition # not mounted + | + |-SYSTEM # not mounted + | |-rootfs # mounted as "/" + | |-nix # mounted as "/nix" + | + |-DATA # not mounted + |-home # mounted as "/home" + |-www # mounted as "/var/www" +``` + # 2023-04-07 7d70009 Changes: