From d5e46a6d3ddf7b264b4b278c6fd99cb6bc4890fc Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Tue, 18 Dec 2012 15:04:15 +0000 Subject: [PATCH] Add more logic in finding a suitable install disk. Turns out hardcoding sda as install disk breaks for example in some IBM bladecenter models, because sda is the CDROM. --- deployment.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/deployment.sh b/deployment.sh index 9f1f2b7..5d92c04 100755 --- a/deployment.sh +++ b/deployment.sh @@ -61,8 +61,17 @@ STATUS_WAIT=0 if [ -L /sys/block/vda ] ; then export DISK=vda # will be configured as /dev/vda else - export DISK=sda # will be configured as /dev/sda + # 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 +test -z "${DISK}" + && die "Error: No non-removable disk suitable for installation found" ### helper functions {{{