if an extended partition contains unallocated space before the first logical partition, the start of the extended partition is moved to start of first logical partition [first EBR is MOVED and affected MBR and EBR tables updated when no such partition changes are requested] (present in both GUI and text installers)

Bug #569201 reported by vadim
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
debian-installer (Ubuntu)
New
Undecided
Unassigned
partman-base (Ubuntu)
New
Undecided
Unassigned
ubiquity (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: ubiquity

Disk is partitioned as follows using Microsoft DiskPart version 6.1.7600
Primary1
Primary2
Primary3
Logical1
Logical2
Logical3
Logical4

DiskPart creates MBR and EBR tables padded with hidden sectors and uses 2048 sectors in total (in contrast to the traditional 63)
http://www.multibooters.co.uk/partitions.html

Ubuntu install:
During install 'specify partitions manually' is chosen.

Partition Logical2 is changed: Ext4, format the partition, mount point /
No other changes are made.

At some point during installation the following changes are made to the partition tables:
The EBR table preceding Logical1 is moved forward 2046 sectors toward the end of the hidden sectors created by DiskPart.
The MBR is updated accordingly to reflect the new offset of the table and the reduced extended partition size (2046 sectors smaller).
The EBR tables for Logical1 (now moved) Logical2 and Logical3 are changed to reflect the new offsets (reduced by 2046 sectors) of their proceeding respective extended partitions caused by moving the first EBR.

Behaviour does not occur if Logical2 contains and existing Ext4 filesystem. If Logical2 is filled with zeros then the EBR is moved.

Why does this happen? Ubuntu was not instructed to make changes to my partition tables. It was instructions only to format a partition (it did not even have to change the partition ID).

More to the point why the hell does this happen at all? There should be no reason to move the EBR table around like that!

Probably related to this:
https://bugs.launchpad.net/ubuntu/+source/partman-base/+bug/342485

Revision history for this message
vadim (x-mailinator) wrote :

Diagrammatic representation of changes

Revision history for this message
vadim (x-mailinator) wrote :

The /var/log/installer/partman log (which for some bizarre reason does not timestamp entries) only shows partition information of AFTER THE TABLES HAVE BEEN MODIFIED!

There appears to be no indication of what or why ubuntu is raping my partition.

Using gparted standalone to format the partition does not produce the same problem.

Nor does using disk utility.

vadim (x-mailinator)
description: updated
vadim (x-mailinator)
description: updated
Revision history for this message
vadim (x-mailinator) wrote :

Very easy to replicate.

Extended partition must exist.

Logical partition must exist (in the extended partition, obviously.)

Unallocated space must exist inside the extended partition and before the logical partition (ie between the start of the extended partition and the start of the logical partition it contains.)

Install to any partition using the 'specify partitions manually' option (while retaining the above.) *Target partition must not contain a previous ext filesystem or the partitioner won't have a reason to play with the partition tables*

The ubiquity installer will move the start of the extended partition to (a couple of sectors prior to) the start of the logical partition.

The installer is more than happy to move the start of the extended partition hundreds of gigabytes even, it doesn't care.

So what if I left that space at the start of my extended partition there for a reason? Say I wanted to put a partition there later. Too bad. Even if there are already 3 primary partitions, the installer moves the unallocated space outside! So you can forget about 4K alignment, or Windows 7 1024K alignment, it'll screw that up too.

The problem is even apparent during the manual partition setup page.

Either the installer has problems reading a partitioning system where the extended partition has unallocated space prior to the first logical partition, or it mistakenly *corrects* this configuration.

Either way this is a problem.

Changed in ubiquity (Ubuntu):
status: New → Confirmed
Revision history for this message
vadim (x-mailinator) wrote :

The same thing occurs in the alternate text based installer.

vadim (x-mailinator)
summary: - extended boot record tables MOVED and modified when no partition changes
- are requested
+ if an extended partition contains unallocated space before the first
+ logical partition, the start of the extended partition is moved to start
+ of first logical partition [first EBR is MOVED and affected MBR and EBR
+ tables updated when no such partition changes are requested] (present in
+ both GUI and text installers)
Revision history for this message
vadim (x-mailinator) wrote :

Exists in Debian.

Revision history for this message
vadim (x-mailinator) wrote :

My guess is partman-server (partman_base) is calling minimize_extended_partition (probably command_partitions) which calls ped_disk_minimize_extended_partition and it seems entirely intentional.

If I'm reading this right, then the behaviour is stupid.

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This release of Ubuntu is no longer receiving maintenance updates. If this is still an issue on a maintained version of Ubuntu please let us know.

Changed in ubiquity (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This issue has sat incomplete for more than 60 days now. I'm going to close it as invalid. Please feel free re-open if this is still an issue for you. Thank you.

Changed in ubiquity (Ubuntu):
status: Incomplete → Invalid
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.