growpart failed in ppc64el guest
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-
--typecode=
--partition
'--
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-
--
--
--
Could not create partition 1 from 40532396646334464 to 0
Could not change partition 1's type code to 0FC63DAF-
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:
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
ProcVersionSign
Uname: Linux 3.13.0-12-generic ppc64le
ApportVersion: 2.13.2-0ubuntu5
Architecture: ppc64el
Date: Wed Feb 26 14:50:02 2014
PackageArchitec
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: cloud-utils
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in cloud-utils (Ubuntu): | |
importance: | Undecided → High |
Changed in gdisk (Ubuntu): | |
importance: | Undecided → High |
Changed in gdisk (Ubuntu): | |
assignee: | nobody → William Grant (wgrant) |
status: | Confirmed → In Progress |
Changed in cloud-utils (Ubuntu): | |
status: | Confirmed → Invalid |
no longer affects: | cloud-utils (Ubuntu) |
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 |
Changed in gdisk (Ubuntu Precise): | |
assignee: | nobody → William Grant (wgrant) |
importance: | Undecided → High |
status: | New → In Progress |
description: | updated |
Changed in gdisk (Ubuntu Utopic): | |
status: | In Progress → Fix Committed |
Changed in gdisk (Ubuntu Wily): | |
status: | In Progress → Fix Committed |
tags: | added: verification-done-trusty |
tags: |
added: verification-done-precise verification-done-utopic verification-done-vivid removed: verification-needed |
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" "${imgurl# #*/}"
imgdist=
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"