14
if ! mdadm --misc --scan --detail 2> /dev/null ; then
14
if ! mdadm --misc --scan --detail >/dev/null 2>&1; then
16
There appears to be one or more degraded RAID devices, and your root device
17
may depend on the RAID devices being online. One or more of the following RAID
16
** WARNING: There appears to be one or more degraded RAID devices **
18
The system may have suffered a hardware fault, such as a disk drive
19
failure. The root device may depend on the RAID devices being online. One
20
or more of the following RAID devices are degraded:
23
If you want to attempt to boot with the RAID in degraded mode, type:
25
where X is the number of the md device listed above.
25
# Read BOOT_DEGRADED from file
26
if [ -r "/conf/conf.d/mdadm" ]; then
29
# But allow for overides on the kernel command line
30
for x in $(cat /proc/cmdline); do
36
BOOT_DEGRADED=${x#bootdegraded=}
40
# Allow for a couple of permutations, {true|1|yes|on}
41
case "$BOOT_DEGRADED" in
42
1) BOOT_DEGRADED="true";;
43
yes) BOOT_DEGRADED="true";;
44
on) BOOT_DEGRADED="true";;
46
# Finally, prompt interactively if the user has not specified
47
# to boot degraded either in a configuration file or as a
48
# kernel boot parameter
49
if [ "$BOOT_DEGRADED" != "true" ]; then
51
You may attempt to start the system anyway, or stop now and attempt
52
manual recovery operations. To do this automatically in the future,
53
add "bootdegraded=true" to the kernel boot options.
55
If you choose to start the degraded RAID, the system may boot normally,
56
but performance may be degraded, and a further hardware fault could
57
result in permanent data loss.
59
If you abort now, you will be provided with a recovery shell.
62
# Set a 15-second timeout for this question
64
read -t 15 -p "Do you wish to start the degraded RAID? [y/N]: " -r ANSWER
66
unanswered) echo "Timed out" ;;
67
y*|Y*) BOOT_DEGRADED="true" ;;
68
*) BOOT_DEGRADED="false";;
71
if [ "$BOOT_DEGRADED" = "true" ]; then
72
echo "Attempting to start the RAID in degraded mode..."
73
if mdadm --assemble --scan --run; then
74
echo "Started the RAID in degraded mode."
77
echo "Could not start the RAID in degraded mode."