Skip to content

Commit

Permalink
MTL-1447 RAID PENDING sync on read-only
Browse files Browse the repository at this point in the history
  • Loading branch information
rustydb committed Aug 26, 2021
1 parent 2a577bd commit 82d4055
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.7
1.5.8
17 changes: 16 additions & 1 deletion 90metalmdsquash/metal-md-scan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,19 @@ if ! lsmod | grep -q raid1 ; then :
# assume that this is a disk boot already loaded with artifacts or this is a network boot
# that's about to obtain artifacts into an existing array (/sbin/metal-md-disks.sh).
# We also can't check for the oval image for the same reason.
fi
else
# If the raid module is loaded then give it a bump so any code in this file can anticipate RAID
# RAID arrays to be available if they exist.
mdadm --assemble --scan
udevadm settle 2>/dev/null
fi

# Also check for any RAIDs that may be in PENDING, sometimes the RAID arrays may stall the boot
# if they did not fully sync before rebooting. The stall is usually only 1-5minutes, but it may vary
# to an hour or indefinite.
for md in $(find /dev/md** -type b); do
handle=$(echo -n $md | cut -d '/' -f3)
if grep -B 2 $handle /proc/mdstat | grep -qi pending ; then
mdadm --readwrite $md
fi
done

0 comments on commit 82d4055

Please sign in to comment.