HDD proper partition alignment
mouse 1050 · person cloud · link
Last update
2017-04-06
2017
04-06
« — »

Current disks partitions should be aligned at the one-megabyte boundary.

This is indicated by the fact that the start sector number for a partition can be divided by 2048 (2048 sectors * 512 bytes per sector equals 1048576 or one megabyte).

An extended partition is not required to respect this rule because it merely serve as a container for logical partitions which themselves are aligned at the one-megabyte boundaries.

For older disks the first partition always started at the 64th sector but for the newer ones it should start at 2048.

Test disk alignment with one of these commands:

1
2
sfdisk -d /dev/sdX
fdisk -l -u /dev/sdX  # with fdisk -v >= 2.17.1

Additional notes:

  • The disk physical block size information from Linux is often spurious, the kernel reports accurate information only for some disks, and the accuracy of the report also varies with the kernel version. This means that disk utilities (eg: hdparm -I /dev/sdX) are not reliable.

  • The discard option in /etc/fstab is not needed if your SSD has enough overprovisioning (spare space) or you leave (unpartitioned) free space on the SSD.


Source: Thomas-Krenn, IBM, Debian Alignment and SSD optimizations