From 4e364304fa62157bda0e9789044b50011ed9ad1e Mon Sep 17 00:00:00 2001 From: Nikos Skalkotos Date: Wed, 29 Jan 2014 17:00:23 +0200 Subject: [PATCH] Use blockdev instead of partprobe after disklabel partprobe creates the partitions by itself and since it does not support disklabels, the disklabel partitons are not recreated --- snf-image-helper/tasks/10FixPartitionTable.in | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/snf-image-helper/tasks/10FixPartitionTable.in b/snf-image-helper/tasks/10FixPartitionTable.in index a0388d2..55ea769 100644 --- a/snf-image-helper/tasks/10FixPartitionTable.in +++ b/snf-image-helper/tasks/10FixPartitionTable.in @@ -36,9 +36,14 @@ if [ ! -b "$SNF_IMAGE_DEV" ]; then fi if [ "$SNF_IMAGE_PROPERTY_OSFAMILY" = openbsd ]; then - @scriptsdir@/disklabel.py -d "$(blockdev --getsz "$SNF_IMAGE_DEV")" -p "$SNF_IMAGE_DEV" - # Inform the kernel about the changes - partprobe "$SNF_IMAGE_DEV" + @scriptsdir@/disklabel.py -d "$($BLOCKDEV --getsz "$SNF_IMAGE_DEV")" -p "$SNF_IMAGE_DEV" + # Tell the kernel to recreate the disk partitions. + # We cannot use partprobe to do this because partprobe uses BLKPG ioctl + # to create the partitions device files by itself one by one. Since parted + # does not support disklabels, the partitions with id larger than 4 will + # not be created. + # We need to tell the kernel to read the partition table by itself. + $BLOCKDEV --rereadpt "$SNF_IMAGE_DEV" exit 0 fi -- 1.7.10.4