growpart failed in ppc64el guest

Bug #1285197 reported by Scott Moser
34
This bug affects 6 people
Affects Status Importance Assigned to Milestone
gdisk (Ubuntu)
Fix Released
High
William Grant
Precise
Fix Released
High
William Grant
Trusty
Fix Released
High
William Grant
Utopic
Fix Released
High
William Grant
Vivid
Fix Released
High
William Grant
Wily
Fix Released
High
William Grant

Bug Description

growpart uses sgdisk to resize gpt partition tables and then
'partx --update' to inform the kernel of those changes.

an example usage of sgdisk ends up looking like this:
  # Modify the partition table. all in one go (order is important!):
  # - move the GPT backup header to the end of the disk
  # - delete the partition
  # - recreate the partition with the new size
  # - set the partition code
  # - set the partition GUID
  # - set the partition name
  sgdisk --move-second-header --delete=1 --new=1:18432:20971486
    --typecode=1:0FC63DAF-8483-4772-8E79-3D69D8477DE4
    --partition-guid=1:53FFEF70-1623-46CC-AFB7-EBC1EB5340F2
    '--change-name=1:Linux filesystem' /dev/sda

We're seeing an issue on ppc64el systems with gpt partition tables.
This reproduces only occasionally.

Note, when growpart runs, the partition it is updating is mounted.
It does this to accomodate space at the end (a grow virtual disk).

The failure we saw was this (we only have logs), and subsequent run of
'growpart' finished fine:
command: growpart /dev/sda 1
exit code: 2
stdout:
  FAILED: disk=/dev/sda partition=1: failed to repartition
stderr:
  failed [sgdisk_mod:4] sgdisk --move-second-header --delete=1
     --new=1:18432:20971486 --typecode=1:0FC63DAF-8483-4772-8E79-3D69D8477DE4
     --partition-guid=1:53FFEF70-1623-46CC-AFB7-EBC1EB5340F2
     --change-name=1:Linux filesystem /dev/sda
  Could not create partition 1 from 40532396646334464 to 0
  Could not change partition 1's type code to 0FC63DAF-8483-4772-8E79-3D69D8477DE4!
  Unable to set partition 1's name to 'Linux filesystem'!
  Error encountered; not saving changes.
  ***** WARNING: Resize failed, attempting to revert ******
  ***** Appears to have gone OK ****

Note there the odd '1 from 40532396646334464 to 0'.

[Test Case]

On a ppc64el system with a sacrificial GPT disk (because it will blow away your /dev/sda1):

  while sudo sgdisk --delete=1 --new=1:18432:37748702 /dev/sda; do :; done

This will normally fail after less than 20 iterations, usually like this:

  Could not create partition 1 from 40532396646334464 to 0

[Regression Potential]

Very minimal. The patch just initialises an uninitialised variable, which happens to usually (and on x86 apparently always) contain a benign value.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: cloud-guest-utils 0.27-0ubuntu7
ProcVersionSignature: User Name 3.13.0-12.32-generic 3.13.4
Uname: Linux 3.13.0-12-generic ppc64le
ApportVersion: 2.13.2-0ubuntu5
Architecture: ppc64el
Date: Wed Feb 26 14:50:02 2014
PackageArchitecture: all
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: cloud-utils
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Scott Moser (smoser) wrote :

To generally reproduce what is going on here via use of /dev/loop0, we can
do:

imgurl="http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-ppc64el-gpt1.img"
 imgdist="${imgurl##*/}"
 wget "$imgurl" -O "$imgdist"
 qemu-img convert -O raw "$imgdist" my.img
 qemu-img resize my.img 10G
 LODEV="/dev/loop0"
 sudo losetup $LODEV "$PWD/my.img"
 mkdir ./mp
 sudo mount ${LODEV}p1 ./mp
 sudo growpart "$LODEV" 1

 sudo umount ./mp
 sudo losetup -d "$LODEV"

Revision history for this message
Scott Moser (smoser) wrote :
Changed in cloud-utils (Ubuntu):
importance: Undecided → High
Changed in gdisk (Ubuntu):
importance: Undecided → High
Revision history for this message
Scott Moser (smoser) wrote :

Well, for the first time in quite a while, I saw this on a 20140407 image.
There were other things changed though, this system:
 * had a 120G root (versus normal ~10G)
 * is a power 8 host
 * had 4 cores not 2

relavent output (cleaned from /var/log/cloud-init.log):
2014-04-07 15:19:51,256 - util.py[WARNING]: Failed: growpart /dev/sda 1
2014-04-07 15:19:51,257 - util.py[DEBUG]: Failed: growpart /dev/sda 1
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/cloudinit/config/cc_growpart.py", line 109, in resize
    util.subp(["growpart", diskdev, partnum])
  File "/usr/lib/python2.7/dist-packages/cloudinit/util.py", line 1539, in subp
    cmd=args)
ProcessExecutionError: Unexpected error while running command.
Command: ['growpart', '/dev/sda', '1']
Exit code: 2
Reason: -
Stdout:
  FAILED: disk=/dev/sda partition=1: failed to repartition
  Warning! Current disk size doesn't match that of the backup!
  Adjusting sizes to match, but subsequent problems are possible!
  Warning: The kernel is still using the old partition table.
  The new table will be used at the next reboot.
  The operation has completed successfully.
Stderr:
  failed [sgdisk_mod:4] sgdisk --move-second-header --delete=1
    --new=1:18432:251658206 --typecode=1:0FC63DAF-8483-4772-8E79-3D69D8477DE4
    --partition-guid=1:C0311AC8-8E4B-4FB1-AA6D-F0FD7B470DBF
    --change-name=1: /dev/sda
  Could not create partition 1 from 40532396646334464 to 0
  Could not change partition 1's type code to 0FC63DAF-8483-4772-8E79-3D69D8477DE4!
  Unable to set partition 1's name to ''!
  Error encountered; not saving changes.
  ***** WARNING: Resize failed, attempting to revert ******
  ***** Appears to have gone OK ****

(remember 'The operation has completed successfully' is the revert operation).

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cloud-utils (Ubuntu):
status: New → Confirmed
Changed in gdisk (Ubuntu):
status: New → Confirmed
William Grant (wgrant)
Changed in gdisk (Ubuntu):
assignee: nobody → William Grant (wgrant)
status: Confirmed → In Progress
Revision history for this message
William Grant (wgrant) wrote :
Scott Moser (smoser)
Changed in cloud-utils (Ubuntu):
status: Confirmed → Invalid
no longer affects: cloud-utils (Ubuntu)
William Grant (wgrant)
Changed in gdisk (Ubuntu Trusty):
assignee: nobody → William Grant (wgrant)
Changed in gdisk (Ubuntu Utopic):
assignee: nobody → William Grant (wgrant)
Changed in gdisk (Ubuntu Vivid):
assignee: nobody → William Grant (wgrant)
Changed in gdisk (Ubuntu Trusty):
importance: Undecided → High
Changed in gdisk (Ubuntu Utopic):
importance: Undecided → High
Changed in gdisk (Ubuntu Vivid):
importance: Undecided → High
Changed in gdisk (Ubuntu Trusty):
status: New → In Progress
Changed in gdisk (Ubuntu Utopic):
status: New → In Progress
Changed in gdisk (Ubuntu Vivid):
status: New → In Progress
William Grant (wgrant)
Changed in gdisk (Ubuntu Precise):
assignee: nobody → William Grant (wgrant)
importance: Undecided → High
status: New → In Progress
William Grant (wgrant)
description: updated
Revision history for this message
Adam Conrad (adconrad) wrote : Please test proposed package

Hello Scott, or anyone else affected,

Accepted gdisk into precise-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gdisk/0.8.1-1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in gdisk (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Changed in gdisk (Ubuntu Trusty):
status: In Progress → Fix Committed
Revision history for this message
Adam Conrad (adconrad) wrote :

Hello Scott, or anyone else affected,

Accepted gdisk into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gdisk/0.8.8-1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in gdisk (Ubuntu Vivid):
status: In Progress → Fix Committed
Revision history for this message
Adam Conrad (adconrad) wrote :

Hello Scott, or anyone else affected,

Accepted gdisk into vivid-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gdisk/0.8.10-2ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

William Grant (wgrant)
Changed in gdisk (Ubuntu Utopic):
status: In Progress → Fix Committed
Adam Conrad (adconrad)
Changed in gdisk (Ubuntu Wily):
status: In Progress → Fix Committed
Revision history for this message
William Grant (wgrant) wrote :

Copied trusty-proposed to utopic-proposed.

William Grant (wgrant)
tags: added: verification-done-trusty
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdisk - 1.0.0-2ubuntu1

---------------
gdisk (1.0.0-2ubuntu1) wily; urgency=medium

  * debian/patches/bug-1285197.diff: Don't leave suffix uninitialised when
    none was passed to IeeeToInt. Fixes incorrect partition boundaries and
    other failures on ppc64el and possibly other architectures. (LP: #1285197)

 -- William Grant <email address hidden> Sat, 20 Jun 2015 10:04:18 +1000

Changed in gdisk (Ubuntu Wily):
status: Fix Committed → Fix Released
William Grant (wgrant)
tags: added: verification-done-precise verification-done-utopic verification-done-vivid
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdisk - 0.8.1-1ubuntu0.1

---------------
gdisk (0.8.1-1ubuntu0.1) precise-proposed; urgency=medium

  * debian/patches/bug-1285197.diff: Don't leave suffix uninitialised when
    none was passed to IeeeToInt. Fixes incorrect partition boundaries and
    other failures on ppc64el and possibly other architectures. (LP: #1285197)

 -- William Grant <email address hidden> Sat, 20 Jun 2015 10:13:21 +1000

Changed in gdisk (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of the Stable Release Update for gdisk has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdisk - 0.8.8-1ubuntu0.1

---------------
gdisk (0.8.8-1ubuntu0.1) trusty-proposed; urgency=medium

  * debian/patches/bug-1285197.diff: Don't leave suffix uninitialised when
    none was passed to IeeeToInt. Fixes incorrect partition boundaries and
    other failures on ppc64el and possibly other architectures. (LP: #1285197)

 -- William Grant <email address hidden> Fri, 19 Jun 2015 19:34:36 +1000

Changed in gdisk (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdisk - 0.8.10-2ubuntu0.1

---------------
gdisk (0.8.10-2ubuntu0.1) vivid-proposed; urgency=medium

  * debian/patches/bug-1285197.diff: Don't leave suffix uninitialised when
    none was passed to IeeeToInt. Fixes incorrect partition boundaries and
    other failures on ppc64el and possibly other architectures. (LP: #1285197)

 -- William Grant <email address hidden> Sat, 20 Jun 2015 10:10:22 +1000

Changed in gdisk (Ubuntu Vivid):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdisk - 0.8.8-1ubuntu0.1

---------------
gdisk (0.8.8-1ubuntu0.1) trusty-proposed; urgency=medium

  * debian/patches/bug-1285197.diff: Don't leave suffix uninitialised when
    none was passed to IeeeToInt. Fixes incorrect partition boundaries and
    other failures on ppc64el and possibly other architectures. (LP: #1285197)

 -- William Grant <email address hidden> Fri, 19 Jun 2015 19:34:36 +1000

Changed in gdisk (Ubuntu Utopic):
status: Fix Committed → Fix Released
Revision history for this message
Rod Smith (rodsmith) wrote :

FWIW, this is fixed upstream (in GPT fdisk 1.0.1), and bug 1514400 now requests an update to that version.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.