diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-11-05 22:12:41 +0100 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-11-11 00:47:33 +0100 |
commit | b73a18a30b2d1fcb9b9107dab98e8d2881eca4ef (patch) | |
tree | cfb1d961c91ea622b624350a483dbb17ae1f7cc4 /shutdown | |
parent | d74d06d7936350df02a4233caf972b071eb74efc (diff) | |
download | mkinitcpio-b73a18a30b2d1fcb9b9107dab98e8d2881eca4ef.tar.gz mkinitcpio-b73a18a30b2d1fcb9b9107dab98e8d2881eca4ef.tar.xz |
shutdown: pamper RAID devices with external metadata
Ensure that these devices (likely FakeRAID) are clean before stopping,
to avoid leaving them in the dirty state and forcing a rebuild.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'shutdown')
-rw-r--r-- | shutdown | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -29,6 +29,14 @@ stop_device() { } ;; raid*) + # wait for arrays with external metadata to be marked as + # clean. unfortunately, there isn't a whole lot we can do + # if this fails, and the array may need a full rebuild on + # the next reboot. + IFS=: read metadata _ < "/sys/class/block/$1/md/metadata_version" + if [ "$metdata" = external ]; then + mdadm --wait-clean "/dev/$1" + fi mdadm --stop "/dev/$1" ;; dmraid) |