detects bad alignment but doesn't correct it

Bug #742164 reported by Martin Pool
42
This bug affects 8 people
Affects Status Importance Assigned to Milestone
parted (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: parted

As a follow-on from bug 742123 (and on the same hardware, and also on Maverick):

'parted -a optimal' seems to be able to detect when partitions are misaligned, but it doesn't correct the allocation of new partitions to make them aligned, nor tell me how they should be aligned. This is very unhelpful.

mbp@joy% sudo parted -a optimal /dev/sdb
GNU Parted 2.3
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: ATA ST9750420AS (scsi)
Disk /dev/sdb: 750GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number Start End Size File system Name Flags
 2 250GB 750GB 500GB ntfs Basic data partition

(parted) mkpart primary ext4 0 250GB
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? c

Changing the units to cylinders and then making a new partition on whole cylinder boundaries means this message does not appear. But from what I understand, the optimal alignment for modern disks is not cylinder boundaries, and the cylinders for this disk are not evenly sized.

(parted) unit cyl
(parted) print
Model: ATA ST9750420AS (scsi)
Disk /dev/sdb: 91201cyl
Sector size (logical/physical): 512B/4096B
BIOS cylinder,head,sector geometry: 91201,255,63. Each cylinder is 8225kB.
Partition Table: gpt

Number Start End Size File system Name Flags
 2 30394cyl 91201cyl 60807cyl ntfs Basic data partition

(parted) mkpart
Partition name? []? base
File system type? [ext2]? ext4
Start? 1
End? 30393
(parted) print
Model: ATA ST9750420AS (scsi)
Disk /dev/sdb: 91201cyl
Sector size (logical/physical): 512B/4096B
BIOS cylinder,head,sector geometry: 91201,255,63. Each cylinder is 8225kB.
Partition Table: gpt

Number Start End Size File system Name Flags
 1 0cyl 30393cyl 30392cyl base
 2 30394cyl 91201cyl 60807cyl ntfs Basic data partition

(parted) align-check
alignment type(min/opt) [optimal]/minimal?
Partition number? 1
1 aligned

Revision history for this message
Martin Pool (mbp) wrote :

Creating a partition aligned to 1MB boundaries also does not produce a warning and might be (?) more likely to be optimally aligned.

(parted) mkpart
Partition name? []? base
File system type? [ext2]? ext4
Start? 1MB
End? 250GB
(parted) unit
Unit? [compact]? s
(parted) print
Model: ATA ST9750420AS (scsi)
Disk /dev/sdb: 1465149168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number Start End Size File system Name Flags
 1 2048s 488282111s 488280064s ext4 base
 2 488282112s 1465147391s 976865280s ntfs Basic data partition

(parted) align-check 1
parted: invalid token: 1
alignment type(min/opt) [optimal]/minimal?
Partition number? 1
1 aligned

Changed in parted (Ubuntu):
status: New → Confirmed
Revision history for this message
Phillip Susi (psusi) wrote :

You requested that the partition start at 0 MB. Parted tries to find the closest valid location within half of a MB, which is at 16 KiB. That is not aligned to a multiple of 1 MiB. You might use a start of 0% instead, which will give a large enough search radius to to snap to the optimal alignment.

Changed in parted (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Martin Pool (mbp) wrote : [Bug 742164] Re: detects bad alignment but doesn't correct it

It might be nice if it said so, then.

On Fri Dec 20 2013 at 9:06:18 AM, Phillip Susi <email address hidden> wrote:

> You requested that the partition start at 0 MB. Parted tries to find
> the closest valid location within half of a MB, which is at 16 KiB.
> That is not aligned to a multiple of 1 MiB. You might use a start of 0%
> instead, which will give a large enough search radius to to snap to the
> optimal alignment.
>
>
> ** Changed in: parted (Ubuntu)
> Status: Confirmed => Invalid
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/742164
>
> Title:
> detects bad alignment but doesn't correct it
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/parted/+bug/
> 742164/+subscriptions
>

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.