You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
401 B
18 lines
401 B
#!/usr/bin/bash
|
|
MDADM=/sbin/mdadm
|
|
DEVNAME=$1
|
|
|
|
export $(${MDADM} --examine --export ${DEVNAME})
|
|
if [ -z "${MD_UUID}" ]; then
|
|
exit 1
|
|
fi
|
|
|
|
UUID_LINK=$(readlink /dev/disk/by-id/md-uuid-${MD_UUID})
|
|
MD_DEVNAME=${UUID_LINK##*/}
|
|
export $(${MDADM} --detail --export /dev/${MD_DEVNAME})
|
|
if [ -z "${MD_METADATA}" ] ; then
|
|
exit 1
|
|
fi
|
|
|
|
${MDADM} --manage /dev/${MD_DEVNAME} --re-add ${DEVNAME} --verbose
|