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
commit2c072b9ddc715040e29223a8dd0df70a7af44641
authorvolth <volth@webmaster.ms>
dateSat 1 Sep 2018, 13:26 (8 years ago)
parentda33269
nixos/modules/system/boot/stage-1-init.sh+7
@@ -263,6 +263,13 @@ checkFS() {
263263 return 0
264264 fi
265265
266+ # Device might be already mounted manually
267+ # e.g. NBD-device or the host filesystem of the file which contains encrypted root fs
268+ if mount | grep -q "^$device on "; then
269+ echo "skip checking already mounted $device"
270+ return 0
271+ fi
272+
266273 # Optionally, skip fsck on journaling filesystems. This option is
267274 # a hack - it's mostly because e2fsck on ext3 takes much longer to
268275 # recover the journal than the ext3 implementation in the kernel