mirror of
https://github.com/nix-community/disko
synced 2024-11-10 06:14:14 +00:00
fix(btrfs): subvolume mount behaviour
Since subvolumes appear automatically when their parent is mounted, no action is required until the user wants them to be mounted somewhere else. This allows access to the volume manager capabilities of BTRFS.
This commit is contained in:
parent
5b19fb2e74
commit
4f1cc11c51
1 changed files with 4 additions and 10 deletions
|
@ -91,16 +91,10 @@
|
|||
let
|
||||
subvolMounts = lib.concatMapAttrs
|
||||
(_: subvol:
|
||||
let
|
||||
mountpoint =
|
||||
if (subvol.mountpoint != null) then subvol.mountpoint
|
||||
else if (config.mountpoint == null) then subvol.name
|
||||
else null;
|
||||
in
|
||||
lib.optionalAttrs (mountpoint != null) {
|
||||
${mountpoint} = ''
|
||||
if ! findmnt ${config.device} "${rootMountPoint}${mountpoint}" > /dev/null 2>&1; then
|
||||
mount ${config.device} "${rootMountPoint}${mountpoint}" \
|
||||
lib.optionalAttrs (subvol.mountpoint != null) {
|
||||
${subvol.mountpoint} = ''
|
||||
if ! findmnt ${config.device} "${rootMountPoint}${subvol.mountpoint}" > /dev/null 2>&1; then
|
||||
mount ${config.device} "${rootMountPoint}${subvol.mountpoint}" \
|
||||
${lib.concatMapStringsSep " " (opt: "-o ${opt}") (subvol.mountOptions ++ [ "subvol=${subvol.name}" ])} \
|
||||
-o X-mount.mkdir
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue