diff options
author | martin f. krafft <madduck@debian.org> | 2010-01-29 18:01:01 +1300 |
---|---|---|
committer | martin f. krafft <madduck@debian.org> | 2010-01-29 18:49:55 +1300 |
commit | a82f419df02a4dacf4046cbee9dfb48ccbeaab11 (patch) | |
tree | ad7daf9472533d51e1a9c16c3dbc819dd1fb16de /debian/initramfs | |
parent | 50715745e936ac937084ae390519bd5862ce2985 (diff) |
check for running devices based on UUID
Signed-off-by: martin f. krafft <madduck@debian.org>
Diffstat (limited to 'debian/initramfs')
-rw-r--r-- | debian/initramfs/hook | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/debian/initramfs/hook b/debian/initramfs/hook index d4a62371..9b730551 100644 --- a/debian/initramfs/hook +++ b/debian/initramfs/hook @@ -226,13 +226,15 @@ if [ "$INITRDSTART" != none ] && [ -n "$devpairs" ]; then esac done - # see if /etc/mdadm/mdadm.conf looks like it's missing devices - $MDADM --detail --scan | while read array device rubbish; do - if ! echo $devpairs | grep -qw $device; then - warn "You appear to be missing $device from /etc/mdadm/mdadm.conf !" - warn "If this array is required to boot, you must add the following line:" - rubbish=`echo $rubbish | sed 's/metadata=[^ ]* //'` - warn "$array $device $rubbish" + # make sure the configuration file knows about all running devices + $MDADM --detail --scan | while read array device params; do + uuid=${params#*UUID=}; uuid=${uuid%% *} + if ! grep -q "UUID=$uuid" $DESTMDADMCONF; then + warn "the array $device with UUID $uuid" + warn "is currently active, but it is not listed in mdadm.conf. if" + warn "it is needed for boot, then YOUR SYSTEM IS NOW UNBOOTABLE!" + warn "please inspect the output of /usr/share/mdadm/mkconf, compare" + warn "it to $CONFIG, and make the necessary changes." fi done |