@@ -327,8 +327,6 @@ the file system even if it's marked as clean. This is not recommended! See
@uref{https://bugzilla.redhat.com/show_bug.cgi?id=625967#c8}. If REPAIR is
false, do not write to DEVICE. If it's #t, fix any errors found. Otherwise,
fix only those considered safe to repair automatically."
- ;; XXX Why make this conditional on (check? #t) at all?
- (system* "btrfs" "device" "scan") ; ignore errors
(if force?
(match (status:exit-val
(apply system* `("btrfs" "check" "--progress"
@@ -210,6 +210,16 @@ upon error."
(open source targets)))
mapped-devices))
+ (define file-system-scan-commands
+ ;; File systems like btrfs need help to assemble multi-device file systems
+ ;; but do not use manually-specified <mapped-devices>.
+ (let ((file-system-types (map file-system-type file-systems)))
+ (if (member "btrfs" file-system-types)
+ ;; Ignore errors: if the system manages to boot anyway, the better.
+ #~((system* (string-append #$btrfs-progs/static "/bin/btrfs")
+ "device" "scan"))
+ #~())))
+
(define kodir
(flat-linux-module-directory linux linux-modules))
@@ -245,7 +255,8 @@ upon error."
(map spec->file-system
'#$(map file-system->spec file-systems))
#:pre-mount (lambda ()
- (and #$@device-mapping-commands))
+ (and #$@device-mapping-commands
+ #$@file-system-scan-commands))
#:linux-modules '#$linux-modules
#:linux-module-directory '#$kodir
#:keymap-file #+(and=> keyboard-layout