From d159aec4f01795726dccc2bc8ccece3655668e2f Mon Sep 17 00:00:00 2001 From: Jay Faulkner Date: Wed, 11 Jun 2014 16:10:41 -0700 Subject: Fix: partitions recently imaged not being detected When we have just written out a whole disk image, if we do not run partprobe none of the new partitions show up in blkid, therefore even images with a built-in configdrive partition will have one created Change-Id: I6ec98dc237b42bfe94ce79cf84d155332335c9f6 --- ironic_python_agent/shell/copy_configdrive_to_disk.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ironic_python_agent/shell') diff --git a/ironic_python_agent/shell/copy_configdrive_to_disk.sh b/ironic_python_agent/shell/copy_configdrive_to_disk.sh index 8d6da02c..8b41cdca 100755 --- a/ironic_python_agent/shell/copy_configdrive_to_disk.sh +++ b/ironic_python_agent/shell/copy_configdrive_to_disk.sh @@ -37,6 +37,10 @@ DEVICE="$2" [[ -f $CONFIGDRIVE ]] || usage "$CONFIGDRIVE (CONFIGDRIVE) is not a regular file" [[ -b $DEVICE ]] || usage "$DEVICE (DEVICE) is not a block device" +# We need to run partprobe to ensure all partitions are visible so the +# following blkid command returns partitions just imaged to the device +/sbin/partprobe $DEVICE || fail "running partprobe against $DEVICE" + # Check for preexisting partition for configdrive EXISTING_PARTITION=`/sbin/blkid -l -o device $DEVICE -t LABEL=config-2` if [[ $? == 0 ]]; then -- cgit v1.2.1