about summary refs log tree commit diff
path: root/nixos/modules/system/boot
diff options
context:
space:
mode:
authorvolth <volth@webmaster.ms>2018-09-01 13:26:16 +0000
committerxeji <36407913+xeji@users.noreply.github.com>2018-09-01 15:26:16 +0200
commit2c072b9ddc715040e29223a8dd0df70a7af44641 (patch)
tree62d3275b124e9acd18f03c8083fbb0ee1e7f3234 /nixos/modules/system/boot
parentda3326902a54e9b897764d0d893660529c14d939 (diff)
downloadnixlib-2c072b9ddc715040e29223a8dd0df70a7af44641.tar
nixlib-2c072b9ddc715040e29223a8dd0df70a7af44641.tar.gz
nixlib-2c072b9ddc715040e29223a8dd0df70a7af44641.tar.bz2
nixlib-2c072b9ddc715040e29223a8dd0df70a7af44641.tar.lz
nixlib-2c072b9ddc715040e29223a8dd0df70a7af44641.tar.xz
nixlib-2c072b9ddc715040e29223a8dd0df70a7af44641.tar.zst
nixlib-2c072b9ddc715040e29223a8dd0df70a7af44641.zip
stage-1-init.sh: do not check mounted filesystems (#45891)
fsck of a mounted filesystems fails with error code 8 "Operational error" and halts the boot processing
Diffstat (limited to 'nixos/modules/system/boot')
-rw-r--r--nixos/modules/system/boot/stage-1-init.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh
index de8451bbe31b..3bc33a20a09f 100644
--- a/nixos/modules/system/boot/stage-1-init.sh
+++ b/nixos/modules/system/boot/stage-1-init.sh
@@ -263,6 +263,13 @@ checkFS() {
         return 0
     fi
 
+    # Device might be already mounted manually 
+    # e.g. NBD-device or the host filesystem of the file which contains encrypted root fs
+    if mount | grep -q "^$device on "; then
+        echo "skip checking already mounted $device"
+        return 0
+    fi
+
     # Optionally, skip fsck on journaling filesystems.  This option is
     # a hack - it's mostly because e2fsck on ext3 takes much longer to
     # recover the journal than the ext3 implementation in the kernel