fails to install on disk with pre-existing broken partition table

Bug #1722322 reported by Steve Langasek on 2017-10-09
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
curtin
High
Unassigned
curtin (Ubuntu)
Medium
Unassigned

Bug Description

Attempting to use subiquity to install to a disk that has a pre-existing inconsistent partition table, curtin fails with the following complaint:

labeling device: '/dev/sdc' with 'gpt' partition table
Running command ['sgdisk', '--clear', '/dev/sdc'] with allowed return codes [0] (capture=False)

***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.
***************************************************************

Non-GPT disk; not saving changes. Use -g to override.
An error occured handling 'disk-1': ProcessExecutionError - Unexpected error while running command.
Command: ['sgdisk', '--clear', '/dev/sdc']
Exit code: 3
Reason: -
Stdout: ''
Stderr: ''
finish: cmd-install/stage-partitioning/builtin/cmd-block-meta: FAIL: configuring disk: disk-1
finish: cmd-install/stage-partitioning/builtin/cmd-block-meta: FAIL: curtin command block-meta
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/curtin/commands/main.py", line 215, in main
    ret = args.func(args)
  File "/usr/lib/python3/dist-packages/curtin/commands/block_meta.py", line 67, in block_meta
    meta_custom(args)
  File "/usr/lib/python3/dist-packages/curtin/commands/block_meta.py", line 1199, in meta_custom
    handler(command, storage_config_dict)
  File "/usr/lib/python3/dist-packages/curtin/commands/block_meta.py", line 387, in disk_handler
    util.subp(["sgdisk", "--clear", disk])
  File "/usr/lib/python3/dist-packages/curtin/util.py", line 268, in subp
    return _subp(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/curtin/util.py", line 140, in _subp
    cmd=args)
curtin.util.ProcessExecutionError: Unexpected error while running command.
Command: ['sgdisk', '--clear', '/dev/sdc']

Related branches

Ryan Harper (raharper) wrote :

This happens if curtin doesn't get a 'wipe: superblock' and the target device has a non-gpt partition already.

Curtin should use sgdisk --zap-all (which will wipe mbr and gpt) instead of just --clear.

Changed in curtin:
importance: Undecided → High
status: New → Confirmed
Scott Moser (smoser) on 2017-10-11
Changed in curtin:
status: Confirmed → Fix Committed

This bug is believed to be fixed in curtin in 17.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in curtin:
status: Fix Committed → Fix Released
Scott Moser (smoser) wrote :

A fix for this bug is being SRU to Ubuntu 16.04 and 17.10 under bug 1743618.

Changed in curtin (Ubuntu):
status: New → Fix Released
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers