Skip to content

Instantly share code, notes, and snippets.

@SiKing
Created January 18, 2017 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SiKing/f7301a9e29af32ad3feffd4c174d4232 to your computer and use it in GitHub Desktop.
Save SiKing/f7301a9e29af32ad3feffd4c174d4232 to your computer and use it in GitHub Desktop.
Check all raid arrays for errors.
#!/bin/bash -e
#
# Check all raid arrays for errors.
#
# Inspiration:
# https://wiki.archlinux.org/index.php/RAID#RAID_Maintenance
#
echo "Are we superuser?"
[[ $EUID -eq 0 ]]
echo "OK"
echo "Initiate all RAID checks."
for block in /sys/block/md*
do
echo check > $block/md/sync_action
done
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment