Skip to content

Instantly share code, notes, and snippets.

@omgjlk
Last active September 11, 2018 23:08
Show Gist options
  • Save omgjlk/5ca35182443bb7d6fd15ec335b1f18f2 to your computer and use it in GitHub Desktop.
Save omgjlk/5ca35182443bb7d6fd15ec335b1f18f2 to your computer and use it in GitHub Desktop.
mdadm_assemble() {
# mdadm will return '2' if the arrays already exist
set +e
mdadm --assemble --scan
ret="${?}"
set -e
if ! [[ "${ret}" == "0" || "${ret}" == "2" ]]; then
echo "Error assembling raid" >&2
exit "${ret}"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment