diff mbox series

[1/1] UBUNTU: SAUCE: autotest: sfdisk: let sfdisk decide the first available sector

Message ID 20200304121523.28802-2-paolo.pisati@canonical.com
State New
Headers show
Series [1/1] UBUNTU: SAUCE: autotest: sfdisk: let sfdisk decide the first available sector | expand

Commit Message

Paolo Pisati March 4, 2020, 12:15 p.m. UTC
Using 0 as a fixed starting sector causes an error:

>>> Created a new DOS disklabel with disk identifier 0x9b4a9cf7.
/dev/loop1p1: Start sector 0 out of range.
Failed to add #1 partition: Numerical result out of range
Leaving.

Fix it by letting sfdisk pick the first available sector instead of
using a fixed value.

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
---
 client/partition.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/client/partition.py b/client/partition.py
index bec7a37f..727cf806 100644
--- a/client/partition.py
+++ b/client/partition.py
@@ -909,7 +909,7 @@  class virtual_partition:
         """
         logging.debug('Creating single partition on %s', loop_path)
         try:
-            single_part_cmd = '0,,c\n'
+            single_part_cmd = ',,c\n'
             sfdisk_file_path = '/tmp/create_partition.sfdisk'
             sfdisk_cmd_file = open(sfdisk_file_path, 'w')
             sfdisk_cmd_file.write(single_part_cmd)