From this article, you will learn about Partition Alignment and how to do this.
Introduction
By “partition alignment,” we mean the proper alignment of partitions to the physical sector boundaries of a data storage device (such as a hard drive, SSD, RAID volume). Correct partition alignment ensures optimal performance for accessing data. Faulty alignment of partitions can lead to reduced performance, especially for SSDs (with internal page sizes of 4,096 or 8,192 bytes, for example), for hard drives with 4 KB sectors (4,096 bytes) and for RAID volumes.
General information
When operating systems are installed via Robot or via the installimage in the Rescue System, the alignment is automatically correct alignment. For unassisted installation via Remote Console (KVM Console) or via VNC (eg. CentOS 6.X), you need to configure the alignment manually. As a rough guide, the more recent the operating system that you want to install, the higher the chance that the installation programm will correctly align the partitions. You can check the alignment using the following command:
sfdisk -uS -l fdisk -u -l /dev/sdX
The boot sector for each partition should be divisible by at least 8 (8 * 512 bytes = 4 KB), and ideally by 2048 (2048 * 512 bytes = 1 MB).
Background: Partitioning
Typical drives work with a physical sector size of 512 bytes. The first partition begins in the last sector of the first track with the (logical) block address 63. The size of such a (logical) sector also amounts to 512 bytes. As logical and physical sectors are of an equal size, there are no problems. Newer drives in Advanced Format work with a physical sector size of 4,096 bytes (4 KB). However, outwardly, they emulate a sector size of 512 bytes (Advanced Format 512e). SSDs also work with a page size of 4 KB or 8 KB. The use of “classical” partitioning, which starts at LBA address 63, is no longer recommended for these newer drives or SSDs. Current file systems, such as ext4 or ntfs, use a 4 KB block size. The file system´s 4 KB blocks do not fit directly into the 4 KB sectors of the hard drive or 4 KB/8 KB SSD pages. When writing one single 4 KB file system block, two 4 KB sectors or pages need to be changed. This is further complicated by the need to retain the corresponding 512 byte blocks — which leads to a Read/Modify/Write. This results in a significant reduction in performance.