From b5dc3d520e0d4dec441c85355b25e2356d9d2ab9 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Tue, 28 Feb 2012 17:43:43 +0000 Subject: [PATCH] optionally run "btrfs device scan" during mountall. As reported by Bryce L Nordgren. Multi-disk btrfs filesystems need to get assembled first before they become mountable. Enable this by explicitly assigning fsType = "btrfs" in the filesystems list in configuration.nix svn path=/nixos/trunk/; revision=32682 --- modules/tasks/filesystems.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/tasks/filesystems.nix b/modules/tasks/filesystems.nix index f568b60baf8f..614d4415062f 100644 --- a/modules/tasks/filesystems.nix +++ b/modules/tasks/filesystems.nix @@ -3,9 +3,12 @@ with pkgs.lib; let + needsBtrfsProgs = any (fs: fs.fsType == "btrfs") config.fileSystems; # Packages that provide fsck backends. - fsPackages = [ pkgs.e2fsprogs pkgs.reiserfsprogs pkgs.dosfstools ]; + fsPackages = [ pkgs.e2fsprogs pkgs.reiserfsprogs pkgs.dosfstools ] + ++ optional needsBtrfsProgs pkgs.btrfsProgs; + in @@ -175,6 +178,7 @@ in exec > /dev/console 2>&1 echo "mounting filesystems..." export PATH=${config.system.sbin.mount}/bin:${makeSearchPath "sbin" ([pkgs.utillinux] ++ fsPackages)}:$PATH + ${optionalString needsBtrfsProgs "${pkgs.btrfsProgs}/bin/btrfs device scan"} ${pkgs.mountall}/sbin/mountall ''; };