Partitions are misaligned when using GPT on disks w/ 4096 byte physical sectors

Bug #1006894 reported by Christopher Townsend
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OEM Priority Project
Fix Released
Critical
Chris Van Hoof
Precise
Fix Released
Critical
James M. Leddy
Quantal
Fix Released
Critical
Chris Van Hoof
partman-base (Debian)
Fix Released
Unknown
partman-base (Ubuntu)
Fix Released
Critical
Colin Watson
Precise
Fix Released
Critical
Colin Watson
Quantal
Fix Released
Critical
Colin Watson

Bug Description

[Impact] GPT partitioning always uses cylinder alignment, which is pessimal for performance on most modern disks.
[Test Case] Do a server install on a blank disk with the 'partman-partitioning/default_label=gpt' boot parameter. Accept all defaults for partitioning. Before confirming partitioning, look in /var/log/partman (from tty2); the byte numbers for the start of each partition should be multiples of 1048576.
[Regression Potential] The plausible things that might go wrong that are worth testing are: (a) it is possible that a bug might cause partitions to be misaligned with things such as large gaps between them or crazy sizes, so check that their sizes look vaguely reasonable; (b) non-GPT partitioning (i.e. in practice the traditional PC MBR partition table format) should not be changed as a result of this work.

Original report follows:

I'm doing a fully preseeded install using a partman-auto disk recipe. This is an EFI install which obviously uses GPT. When I launch Disk Utility is complains that the EFI fat32 partition and the next ext4 Linux partition are misaligned by 3072 bytes and 2048 bytes respectively.

When I dump the partitioning out in parted, I can see that the partition begins on logical sector 34:

$ sudo parted /dev/sda unit s print
Model: ATA ST9500423AS (scsi)
Disk /dev/sda: 976773168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number Start End Size File system Name Flags
 1 34s 390659s 390626s fat32 boot
 2 390660s 39453160s 39062501s ext4

So the partition begins right after the GPT headers, but since this is a 4096 byte physical sector drive, this does not begin on a physical sector boundary. It should begin on logical sector 40 (physical sector 5) to have proper alignment.

I'm not sure if this should be filed against partman-auto since this is a fully preseeded install or just partman-base.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: ubiquity (not installed)
ProcVersionSignature: Ubuntu 3.2.0-24.38-generic 3.2.16
Uname: Linux 3.2.0-24-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.0.1-0ubuntu7
Architecture: amd64
Date: Thu May 31 08:45:45 2012
DistributionChannelDescriptor:
 # This is a distribution channel descriptor
 # For more information see http://wiki.ubuntu.com/DistributionChannelDescriptor
 canonical-oem-sutton-precise-amd64-20120523-0
InstallCmdLine: BOOT_IMAGE=/casper/vmlinuz boot=casper automatic-ubiquity partman/alignment=minimal file=/cdrom/install/preseed.cfg quiet splash -- nouveau.modeset=0
InstallationMedia: Ubuntu 12.04 "Precise" - Build amd64 LIVE Binary 20120523-03:49
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: ubiquity
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Christopher Townsend (townsend) wrote :
Revision history for this message
Christopher Townsend (townsend) wrote :

Also, note that the "partman/alignment=minimal" was just used as a test to see if it made any difference. I found this issue without using any special kernel command line option.

Also, I'm attaching the disk-recipe I used for the install.

description: updated
Revision history for this message
Christopher Townsend (townsend) wrote :

Adding the OEM Priority task because this issue affects some of Canonical's OEM customer projects in which disk performance will be degraded and cause a poor user experience.

Also, I can make an image available that has the full preseeded install.

Changed in oem-priority:
importance: Undecided → High
Revision history for this message
Colin Watson (cjwatson) wrote :

Could you post:

  /sys/block/sda/alignment_offset
  /sys/block/sda/queue/minimum_io_size
  /sys/block/sda/queue/optimal_io_size
  /sys/block/sda/queue/physical_block_size

Changed in oem-priority:
assignee: nobody → James M. Leddy (jm-leddy)
Changed in partman-base (Ubuntu):
status: New → Incomplete
assignee: nobody → Colin Watson (cjwatson)
importance: Undecided → High
Revision history for this message
Christopher Townsend (townsend) wrote :

@Colin:

Here is your requested info:

$ cat /sys/block/sda/alignment_offset
0
$ cat /sys/block/sda/queue/minimum_io_size
4096
$ cat /sys/block/sda/queue/optimal_io_size
0
$ cat /sys/block/sda/queue/physical_block_size
4096

Also note that this has been seen on both Dell and Lenovo hardware.

Changed in partman-base (Ubuntu):
status: Incomplete → Confirmed
Changed in partman-base (Ubuntu):
importance: High → Critical
tags: added: rls-mgr-p-tracking
Changed in oem-priority:
importance: High → Critical
Steve Magoun (smagoun)
Changed in oem-priority:
status: New → Incomplete
status: Incomplete → Confirmed
Revision history for this message
Christopher Townsend (townsend) wrote :

This upstream bug seems like it may be related: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=674894

Chris Van Hoof (vanhoof)
Changed in oem-priority:
assignee: James M. Leddy (jm-leddy) → Chris van Hoof (vanhoof)
tags: added: rls-q-incoming
Steve Langasek (vorlon)
Changed in partman-base (Ubuntu Precise):
status: New → Confirmed
importance: Undecided → Critical
assignee: nobody → Colin Watson (cjwatson)
milestone: none → ubuntu-12.04.1
tags: removed: rls-mgr-p-tracking rls-q-incoming
Colin Watson (cjwatson)
Changed in partman-base (Ubuntu Quantal):
status: Confirmed → In Progress
milestone: none → quantal-alpha-3
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package partman-base - 158ubuntu1

---------------
partman-base (158ubuntu1) quantal; urgency=low

  * Resynchronise with Debian. Remaining changes:
    - Ubiquity integration: If PARTMAN_NO_COMMIT is set, then exit rather
      than running commit.d and finish.d scripts; add a partman-commit
      script; dump extra information to /var/lib/partman/snoop if
      PARTMAN_SNOOP is set; check for per-menu 'no_show_choices' file in
      ask_user and don't reshow the menu if it exists.
    - Don't skip over dmraid devices if the user chooses not to activate
      them.
    - If the only thing mounted on a disk is the installation medium and it
      uses more or less the whole disk, then silently exclude that disk; if
      the installation medium is mounted but doesn't use the whole disk,
      issue a warning that partitioning may be difficult; if anything else
      is mounted, offer to unmount it. partman/filter_mounted=false disables
      this.

partman-base (158) unstable; urgency=low

  * Permit non-cylinder alignment again on GPT (closes: #674894,
    LP: #1006894).

partman-base (157) unstable; urgency=low

  * Team upload

  [ Updated translations ]
  * Croatian (hr.po) by Tomislav Krznar
  * Portuguese (Brazil) (pt_BR.po) by Felipe Augusto van de Wiel (faw)
 -- Colin Watson <email address hidden> Mon, 02 Jul 2012 14:42:31 +0100

Changed in partman-base (Ubuntu Quantal):
status: In Progress → Fix Released
Colin Watson (cjwatson)
description: updated
description: updated
Changed in partman-base (Ubuntu Precise):
status: Confirmed → In Progress
Changed in partman-base (Debian):
status: Unknown → Fix Released
Changed in oem-priority:
status: Confirmed → In Progress
Revision history for this message
Adam Conrad (adconrad) wrote : Please test proposed package

Hello Christopher, or anyone else affected,

Accepted partman-base into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/partman-base/153ubuntu5 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 change the bug tag from verification-needed to verification-done. If it does not, 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 partman-base (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Chris Van Hoof (vanhoof)
Changed in oem-priority:
status: In Progress → Fix Committed
Revision history for this message
Christopher Townsend (townsend) wrote :

For Precise, I tested this on both GPT style partition tables and PC MBR style partition tables. The GPT disks are now aligned. I detected no regressions in the MBR disks.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package partman-base - 153ubuntu5

---------------
partman-base (153ubuntu5) precise-proposed; urgency=low

  * Permit non-cylinder alignment again on GPT (closes: #674894,
    LP: #1006894).
 -- Colin Watson <email address hidden> Mon, 02 Jul 2012 14:54:45 +0100

Changed in partman-base (Ubuntu Precise):
status: Fix Committed → Fix Released
Changed in partman-base (Debian):
status: Fix Released → New
Revision history for this message
Jesse Newland (jnewland) wrote :

Does anyone have any clever approaches for install this updated udeb into a precise installer? Things I've tried:

* downloading and installing an updated deb in preseed/early_command fails since the postinst tries to run parted and it's too early to do so
* downloading and installing an updated deb in partman/early_command doesn't work since it runs it as a part of partman and thus runs partition twice
* expanding the package into the initrd and booting w/ that results in the old package (153ubuntu4) being installed over it.

Any other ideas? Thanks in advance.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Images in:
http://cdimages.ubuntu.com/ubuntu-server/precise/daily/current/
Have this updated partman-base.

Changed in partman-base (Debian):
status: New → 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.