Fix zconfig.sh partitioning error
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 24 Jan 2013 21:54:58 +0000 (13:54 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 24 Jan 2013 21:57:16 +0000 (13:57 -0800)
Parted version 3.0 doesn't allow us to specify the start and end
percentages as 50% and 100% respectively.  This results in:

  Error: The location 100% is outside the device /dev/zd0

Therefore we change the syntax to 51% and -1 for end of device.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
scripts/zconfig.sh

index 75e37d0..d1e796f 100755 (executable)
@@ -194,7 +194,7 @@ test_3() {
        ${ZFS} create -V 100M ${FULL_ZVOL_NAME} || fail 3
        label /dev/zvol/${FULL_ZVOL_NAME} msdos || fail 4
        partition /dev/zvol/${FULL_ZVOL_NAME} primary 1% 50% || fail 4
-       partition /dev/zvol/${FULL_ZVOL_NAME} primary 50% 100% || fail 4
+       partition /dev/zvol/${FULL_ZVOL_NAME} primary 51% -1 || fail 4
        ${ZFS} snapshot ${FULL_SNAP_NAME} || fail 5
        ${ZFS} clone ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 6
 
@@ -247,7 +247,7 @@ test_4() {
        ${ZFS} create -V 100M ${FULL_ZVOL_NAME} || fail 3
        label /dev/zvol/${FULL_ZVOL_NAME} msdos || fail 4
        partition /dev/zvol/${FULL_ZVOL_NAME} primary 1% 50% || fail 4
-       partition /dev/zvol/${FULL_ZVOL_NAME} primary 50% 100% || fail 4
+       partition /dev/zvol/${FULL_ZVOL_NAME} primary 51% -1 || fail 4
        ${ZFS} snapshot ${FULL_SNAP_NAME} || fail 5
        ${ZFS} clone ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 6