MT#19613 Add grml boot option targetdisk to perform disaster recovery on non-RAID drives

Otherwise deployment.sh abort disaster recovery installation if we have 1 drive only:
> Error: /dev/sdb does not look like a VirtIO, ServeRAID, LSILOGIC or PowerEdge disk/controller.
> Exiting to avoid possible data damage.

Change-Id: I4de4d0de75964fc6f09b8f0b1ae3104a6bdfc6ee
changes/66/6066/1
Alexander Lutay 9 years ago
parent 7ed4e3b147
commit 41b6375324

@ -88,24 +88,6 @@ VLAN_SIP_INT=1720
VLAN_HA_INT=1721
VLAN_RTP_EXT=1722
# if TARGET_DISK environment variable is set accept it
if [ -n "$TARGET_DISK" ] ; then
export DISK="${TARGET_DISK}"
else # otherwise try to find sane default
if [ -L /sys/block/vda ] ; then
export DISK=vda # will be configured as /dev/vda
else
# in some cases, sda is not the HDD, but the CDROM,
# so better walk through all devices.
for i in /sys/block/sd*; do
if grep -q 0 ${i}/removable; then
export DISK=$(basename $i)
break
fi
done
fi
fi
### helper functions {{{
get_deploy_status() {
if [ -r "${STATUS_DIRECTORY}/status" ] ; then
@ -347,9 +329,6 @@ logit "host-IP: $(ip-screen)"
logit "deployment-version: $SCRIPT_VERSION"
# }}}
test -z "${DISK}" \
&& die "Error: No non-removable disk suitable for installation found"
enable_deploy_status_server
set_deploy_status "checkBootParam"
@ -359,6 +338,30 @@ if checkBootParam debugmode ; then
enable_trace
fi
if checkBootParam targetdisk ; then
TARGET_DISK=$(getBootParam targetdisk)
fi
# if TARGET_DISK environment variable is set accept it
if [ -n "$TARGET_DISK" ] ; then
export DISK="${TARGET_DISK}"
else # otherwise try to find sane default
if [ -L /sys/block/vda ] ; then
export DISK=vda # will be configured as /dev/vda
else
# in some cases, sda is not the HDD, but the CDROM,
# so better walk through all devices.
for i in /sys/block/sd*; do
if grep -q 0 "${i}/removable"; then
export DISK=$(basename "$i")
break
fi
done
fi
fi
[ -z "${DISK}" ] && die "Error: No non-removable disk suitable for installation found"
if checkBootParam ngcpstatus ; then
STATUS_WAIT=$(getBootParam ngcpstatus || true)
[ -n "$STATUS_WAIT" ] || STATUS_WAIT=30

Loading…
Cancel
Save