Ubuntu – Partition is misaligned by 3072 bytes… Pavilion DV7-6199US

dual-boothard drivehppartitioning

I bought a new HP Pavilion DV7-6199US. In the past on all my computers I have always used Ubuntu primarily and I keep a version of Windows in case I need something that I can't do easily in Linux. I have always just re-sized the main Windows partition to leave enough space for Linux to run with no problems. I would leave the remaining space for Linux on the disk with no partition or anything, just unused space. Then I would run Ubuntu's installer and tell it to use the unused space. Never a problem, Ubuntu would create partitions there however it wanted to.

This time I did all this, but when I resized the partition in Windows the remaining space was labelled unusable by Linux and Windows. So I said OK no problem I booted Ubuntu 11.10 from USB and I just deleted the whole Windows partition and created a 492 GB partition to install Windows on again.

After doing this the Disk Management Utility in Ubuntu said the following error: "Warning: The partition is misaligned by 3072 bytes. This may result in very poor performance. Repartitioning is suggested." Do I keep going? Is this just a screwy error that I can ignore? I can't handle bad performance issues.

I'm not very experienced with the command line so GUI-only unless you can really be patient with me, please.

Best Answer

The older hard drives used smaller 512-byte sectors; recently newer drives use larger sectors, usually 4096 bytes.

Software, however, is still sees the disk in 512-byte "logical" sectors, although it often reads the data in 4K chunks

When creating a partition, it is important to align the beginning of the partition with the beginning of the large physical sector, otherwise each read will require reading 2 physical sectors, which will affect performance.

As you can see, your partition starts from logical sector #3 (#1 and #2 take 512*2=1024 bytes), so to fix the problem you need to move the start of the partition by 3072 (4096-1024) bytes.

Newer versions of gparted are aware of this - just boot from Ubuntu LiveCD and create a new partition selecting the default alignment option (which is "align to 1 MB", which is optimal even for larger sector size, such as in SSDs).

If you already installed OS and do not want to re-create partitions, you could move the start of the partitions to align properly, but that would involve some pen-and-paper calculations. Also, you'll need to reinstall the bootloader if you moved Ubuntu partition.