Lines 285-295
Link Here
|
285 |
fi |
285 |
fi |
286 |
|
286 |
|
287 |
# Add raid devices |
287 |
# Add raid devices |
288 |
if [ -z "$EVMS_ACTIVE" ] && [ -f /proc/mdstat -a -s /etc/raidtab ] && ! grep -iwqs noraidtab /proc/cmdline; then |
|
|
289 |
echo -n "Starting up RAID devices: " |
290 |
|
288 |
|
291 |
rc=0 |
289 |
mdadm_found() { |
292 |
|
290 |
[ -s /etc/mdadm.conf ] || return 1 |
|
|
291 |
for f in /sbin/mdadm /usr/sbin/mdadm /sbin/mdassemble /usr/sbin/mdassemble; do |
292 |
[ -x "$f" ] && return 0 |
293 |
done |
294 |
return 1 |
295 |
} |
296 |
|
297 |
raid_helpers_found() { |
298 |
mdadm_found && return 0 |
299 |
[ -s /etc/raidtab ] && return 0 |
300 |
return 1 |
301 |
} |
302 |
|
303 |
mount_raid_using_mdadm() { |
304 |
[ -s /etc/mdadm.conf ] || return 1 |
305 |
for f in /sbin/mdadm /usr/sbin/mdadm; do |
306 |
[ -x "$f" ] || continue |
307 |
echo -n "(using mdadm) " |
308 |
"$f" --assemble --scan |
309 |
return $? |
310 |
done |
311 |
for f in /sbin/mdassemble /usr/sbin/mdassemble; do |
312 |
[ -x "$f" ] || continue |
313 |
echo -n "(using mdassemble) " |
314 |
"$f" |
315 |
return $? |
316 |
done |
317 |
return 1 |
318 |
} |
319 |
|
320 |
mount_raid_using_raidtools() { |
321 |
local rc=0 |
322 |
[ -s /etc/raidtab ] || return 1 |
323 |
echo -n "(using raidtools) " |
293 |
for i in `grep -s "^raiddev" /etc/raidtab | awk '{print $2}'`; do |
324 |
for i in `grep -s "^raiddev" /etc/raidtab | awk '{print $2}'`; do |
294 |
RAIDDEV="${i##*/}" |
325 |
RAIDDEV="${i##*/}" |
295 |
RAIDSTAT=`grep -s "^$RAIDDEV : active" /proc/mdstat` |
326 |
RAIDSTAT=`grep -s "^$RAIDDEV : active" /proc/mdstat` |
Lines 315-320
Link Here
|
315 |
fi |
346 |
fi |
316 |
echo -n "$RAIDDEV " |
347 |
echo -n "$RAIDDEV " |
317 |
done |
348 |
done |
|
|
349 |
return $rc |
350 |
} |
351 |
|
352 |
if [ -z "$EVMS_ACTIVE" ] && [ -f /proc/mdstat ] && raid_helpers_found && ! grep -iwqs noraidtab /proc/cmdline; then |
353 |
|
354 |
echo -n "Starting up RAID devices: " |
355 |
rc=0 |
356 |
mount_raid_using_mdadm || mount_raid_using_raidtools || rc=1 |
318 |
echo |
357 |
echo |
319 |
|
358 |
|
320 |
# A non-zero return means there were problems. |
359 |
# A non-zero return means there were problems. |