From a63d4764ddc451680c222016be4a5394bbffe17b Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 15 Jul 2015 13:55:26 -0400 Subject: [PATCH] Use blkid to find ephemeral disk on HP HP has disk labels on their disks. This is great to make sure that we're not trying to reformat the config drive if it's attached. Change-Id: Ie4d96e7356893c7df7219559775196d209507059 --- functions.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/functions.sh b/functions.sh index 8a2dc187..36913aa3 100644 --- a/functions.sh +++ b/functions.sh @@ -253,10 +253,13 @@ function fix_disk_layout { # disk and mount it on /opt, syncing the previous contents of /opt # over. if [ `grep SwapTotal /proc/meminfo | awk '{ print $2; }'` -eq 0 ]; then - if [ -b /dev/vdb ]; then - DEV='/dev/vdb' - elif [ -b /dev/xvde ]; then + if [ -b /dev/xvde ]; then DEV='/dev/xvde' + else + EPHEMERAL_DEV=$(blkid -L ephemeral0 || true) + if [ -n "$EPHEMERAL_DEV" -a -b "$EPHEMERAL_DEV" ]; then + DEV=$EPHEMERAL_DEV + fi fi if [ -n "$DEV" ]; then local swap=${DEV}1