Warning: The resulting partition is not properly aligned for best performance.

I’m adding a disk to an ubuntu machine and creating a new partition which uses the whole disk.

GNU Parted 2.2
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: /dev/sdb: unrecognised disk label

So I make a new dos partition

(parted) mklabel
New disk label type? msdos
(parted) print
Model: - (scsi)
Disk /dev/sdb: 53.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
 
Number  Start  End  Size  Type  File system  Flags
 
(parted) mkpart primary ext4 0 -1
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel?

You should align the first partition at block 64
(parted) mkpart primary ext4 64 -1
mkpart syntax is: mkpartfs part-type fs-type start-mb end-mb
so this just wastes the first 64 MB of space on the disk. Setting the start at 1 avoids the error message as well.

mkpart primary ext4 1 -1
(parted)

And your error free. Go forth and partition.
Thanks to Stefan.
This is why I put stuff on the internet.

 

derak

 

14 thoughts on “Warning: The resulting partition is not properly aligned for best performance.

  1. Hm, that just wastes the first 64MB of your device. Though not optimal either, a

    (parted) mkpart primary ext4 1 -1

    at least only wastes 1MB.

  2. Thanks for the info on how you guys used Parted. There is lacking documentation on how to properly format these Advance Format drives that lie to the OS.

    parted -a optimal /dev/sdb

    (parted) u s

    (parted) mkpart primary linux-swap 1 1G

    (parted) mkpart primart ext4 1953792s -1

    (parted) p
    Model: ATA WDC WD10EARS-00Y (scsi)
    Disk /dev/sdb: 1953525168s
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos

    Number Start End Size Type File system Flags
    1 2048s 1953791s 1951744s primary linux-swap(v1)
    2 1953792s 1953525167s 1951571376s primary ext4

    This seemed to solve all of my performance problems.

  3. thanks that helped me partition my 2TB hard drive.
    for some reason the debian squeeze’s fdisk does support GPT partitions but after creation i didnt see it in /dev/sdb1. only saw /dev/sdb

    after using parted the problem solved.
    thanks!

  4. Percents work as well and get auto aligned.
    (parted) mkpart
    Partition name? []? data
    File system type? [ext2]? ext4
    Start? 0%
    End? 100%

  5. Thanks guys, the percents tip is the one that fixed it for me. Was trying to create a partition to fill a disk on a VM and no combination of sectors seemed to be working, and even defining a "correct" start of a divisible by 8 sector and 100% was failing.

Leave a Reply

Your email address will not be published. Required fields are marked *