11.04 beta aligns 4k disks on cylinder 63

Bug #756853 reported by Todd A. Jacobs on 2011-04-10
This bug affects 4 people
Affects Status Importance Assigned to Milestone
partman-base (Ubuntu)

Bug Description

Binary package hint: ubiquity

The default install partitions disks with 4k sectors improperly. When electing to use the entire disk, the primary partition is misaligned on newer systems. On my disk, the partitions were aligned at cylinder 63. The automatic installer should either check the reported sector size (not always reliable), or leave unallocated space at the front of the drive to ensure that newer disks with 4k sectors, as well as older drives with 512-byte sectors, are aligned properly.

The only workaround I could find was to manually allocate *all* partitions. To do that seems to require two full trips through the installer, because manual partitions are only written during final installation--it doesn't appear that there's a way to create a 1MB partition and then allow Ubuntu to install the rest automatically unless the empty space is detected before the partitioning section of the installer.

Colin Watson (cjwatson) wrote :

It should be behaving this way already, so we need to inspect logs to see why it isn't working. Could you please attach /var/log/syslog and /var/log/partman to this bug, following the directions in http://wiki.ubuntu.com/DebuggingUbiquity/AttachingLogs? Thanks in advance.

affects: ubiquity (Ubuntu) → partman-base (Ubuntu)
Changed in partman-base (Ubuntu):
status: New → Incomplete
Todd A. Jacobs (codegnome) wrote :

I am currently unable to reproduce this issue. When I reported the bug, I had reinstalled several times; there may have been some steps taken that are difficult to reproduce.

Since I am unable to reproduce the issue, please close this bug. Thanks.

alp (atoker) wrote :

Hi Colin,

I can confirm that the Ubuntu 11.04 64-bit desktop release continues to exhibit this issue, and I have installer logs pinpointing exactly when this happened. The installation was done on a MacBook Pro with a WDC WD7500BPKT-75PK4T0 750 GB hard drive featuring Advanced Format 4096 blocks:

# cat /sys/block/sda/queue/physical_block_size
# cat /sys/block/sda/queue/logical_block_size

Before starting, Mac OS X Snow Leopard was allocated 650 GB with the remaining 100 GB unallocated. I selected the automatic single click partitioning option in the graphical desktop Ubuntu installer assuming it would create boot, root and swap partitions in the remaining space, which it did without any intervention.

However, while the boot and swap partitions it created were appropriately aligned, the main root partition (number 4) the installer created was unfortunately not aligned. This is a printout from gdisk:

Disk /dev/disk0: 1465149168 sectors, 698.6 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): ***
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1465149134
Partitions will be aligned on 8-sector boundaries
Total free space is 86 sectors (43.0 KiB)

Number Start (sector) End (sector) Size Code Name
   1 40 409639 200.0 MiB EF00 EFI System Partition
   2 409640 1269940895 605.4 GiB AF00 Untitled 1
   3 1269940896 1269942849 977.0 KiB EF02
   4 1269942850 1456800271 89.1 GiB 0700
   5 1456800272 1465149054 4.0 GiB 8200

As you can see, partition 4, the main Linux ext4 partition is not aligned.

The Ubuntu disk utility has also identified this issue (screenshot with my serial number redacted attached):

WARNING: The partition is misaligned by 3072 bytes. This may result in very poor performance. Repartitioning is suggested.

Excerpt from the partman log where it created the misaligned partition:

parted_server: Opening outfifo
parted_server: requested partition with type primary
parted_server: requested partition with file system ext4
parted_server: add_primary_partition(disk(1465149168),1269942850-1456800271)
parted_server: OUT: OK

I've no idea if this might have happened because the hardware or kernel mis-reported the optimal alignment, or if it's some other issue, but I would assume that the easy solution is to enforce 4096 alignment on all drives when partitioning automatically, as the benefit outweighs the potential loss of a megabyte or two.

Let me know if you need the entire partman installer log or any other details. Also, please let me know if you find the issue so I can wipe the misaligned partition and re-install, as I'm only keeping it around to help diagnose this bug.

Uli Tillich (utillich) wrote :

I can also confirm this bug.

As a workaround the partitions can be created from a live disk before installing, as described here: http://askubuntu.com/questions/55214/how-do-i-correctly-align-partions-on-a-hdd-with-sector-size-of-4096-bytes.

Uli Tillich (utillich) wrote :

In addition to 10.04 I can also confirm this bug for 11.10 alpha.

Changed in partman-base (Ubuntu):
status: Incomplete → Confirmed
Mikael Frykholm (mikael) wrote :

Please, this is hassle. every time I install a ubuntu server I need to manually partition the disks to get around this. Is the installer using the logical value instead of the physical? I tested both the precise installer and oneiric.

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

Other bug subscribers