Comment 0 for bug 1285197

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

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'.

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)