need support for gpt partition tables

Bug #1087526 reported by Scott Moser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-utils
Fix Released
Medium
Unassigned
cloud-initramfs-tools (Ubuntu)
Fix Released
Medium
Unassigned
cloud-utils (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

msdos partition table runs out at like 2TB.
growpart needs support to be able to grow gpt disks.

Related bugs:
 * bug 1096999: add new partx update and resize upstream features

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: cloud-initramfs-growroot (not installed)
ProcVersionSignature: Ubuntu 3.5.0-19.30-generic 3.5.7
Uname: Linux 3.5.0-19-generic x86_64
ApportVersion: 2.6.1-0ubuntu6
Architecture: amd64
Date: Fri Dec 7 01:44:26 2012
MarkForUpload: True
SourcePackage: cloud-initramfs-tools
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Scott Moser (smoser) wrote :
Scott Moser (smoser)
summary: - need support for gpt drives
+ need support for gpt partition tables
Revision history for this message
Scott Moser (smoser) wrote :

Fix committed in revision 213.

Changed in cloud-utils:
status: New → Fix Committed
importance: Undecided → Medium
assignee: nobody → Juerg Haefliger (juergh)
assignee: Juerg Haefliger (juergh) → nobody
Scott Moser (smoser)
description: updated
Revision history for this message
Scott Moser (smoser) wrote :

Juerg just added support to growpart to use 'sgdisk'.
The remaining step here is to make cloud-initramfs-growpart to include 'sgdisk'.
That would allow GPT resizing from the initramfs.

There are 2 reasons not to "just do that":
a.) it changes initramfs size dramatically:
$ ls -l /boot/initrd.img*
-rw-r--r-- 1 root root 14936523 Feb 4 17:19 /boot/initrd.img-3.8.0-2-generic
-rw-r--r-- 1 root root 6047018 Feb 4 17:10 /boot/initrd.img-3.8.0-2-generic.dist
b.) As I've described on a thread at http://www.gossamer-threads.com/lists/openstack/dev/23573 , this is actually no longer required to be in the initramfs at all.

bug 1096999 is there to request the function into util-linux for partx and resizepart command.

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

I've just manually tested on raring, and the following seems to work the whole way through, when having installed psusi's branch at https://code.launchpad.net/~psusi/ubuntu/raring/util-linux/cherry-pick-resize and the new growpart with gpt partition support.

$ img=/tmp/my.img
$ mp=/tmp/mp
$ size=800M
$ osize="400M"
$ sudo rm -f $img; sudo rm -Rf $mp; sudo mkdir $mp

## create a new image $osize big
$ sudo truncate --size $osize "$img"

## add a single GPT partition that takes up the whole image
$ sudo sgdisk --new 1:2048: "$img"

## grow the image (as a hypervisor would do)
$ sudo truncate --size $size $img

## attach the image to a device
$ lodev=$(sudo losetup --show --find "$img")
$ echo $lodev
/dev/loop0

## put a filesystem on it, mount it, then grow the partition
$ sudo mkfs.ext4 ${lodev}p1
$ sudo mount ${lodev}p1 "$mp"
$ sudo growpart ${lodev} 1

## /proc/partitions still has old information

## tell kernel about grown partition
$ sudo partx --update 1 ${lodev}

## /proc/partitions has new information

## filesystem can now be re-sized
$ sudo resize2fs ${lodev}p1

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

At the moment, I'm thinking that growpart should actually just grow the ability to invoke partx. There isn't any reason why cloud-init or some other tool should have to know about this other than possibly knowing to pass a new flag to growpart.

The other path would be to have cloud-init know that it should invoke growpart and then to invoke partx, but that seems unnecessary.

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

This bug was fixed in the package cloud-utils - 0.26-0ubuntu2

---------------
cloud-utils (0.26-0ubuntu2) raring; urgency=low

  * debian/copyright: fix formatting
  * sync to trunk at revno 216
    * support for GPT partitions in growpart via sgdisk (LP: #1087526)
    * depend on wget and ca-certificates for ubuntu-cloudimg-query
      (LP: #1062671)
    * fix sfdisk parsing (LP: #1007415)
 -- Scott Moser <email address hidden> Mon, 04 Feb 2013 15:18:49 -0500

Changed in cloud-utils (Ubuntu):
status: New → Fix Released
Scott Moser (smoser)
Changed in cloud-initramfs-tools (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Changed in cloud-utils (Ubuntu):
importance: Undecided → Medium
Scott Moser (smoser)
Changed in cloud-initramfs-tools (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Scott Moser (smoser) wrote :

fixed in 0.28

Changed in cloud-utils:
status: Fix Committed → Fix Released
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.