Is it necessary to have the partitions that makeup a software RAID 1 array be aligned?
This guide states
"Software RAID: Although one needs to pay attention to correct
alignment here as well, this is not explicitly necessary as at least
64 KB-sized blocks are used."
I don't understand how Soft RAID changes the performance hit / write amplification issue given the underlying SSD controller is still staggering file system pages across more than necessary flash pages.
Here is one of my drives, I believe that the partition starting at LBA 63, means I'm not aligned. Partitions were created via CentOS 5 installer.
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 63 610469 305203+ fd Linux raid autodetect
/dev/sda2 610470 16996769 8193150 fd Linux raid autodetect
/dev/sda3 16996770 25189919 4096575 fd Linux raid autodetect
/dev/sda4 25189920 234436544 104623312+ 5 Extended
/dev/sda5 25189983 234436544 104623281 fd Linux raid autodetect
Thank you so much!
Best Answer
It is not necessary, everything will work and probably still much faster than spinning metal based drives, but better alignment will further improve performance particularly for write operations.
Newer installations get this right out of the box automatically (current Debian/Stable certainly does, no doubt newer CentOS variants will too) because recent releases of fdisk, lvm, mdadm, and related tools have been updated to account for best practise on these newer drive technologies, but for older releases you need to set your partitions up more manually to get the best out of your SSDs.
It should be possible to realign in-place but it would be much safer IMO to backup the data on the machine and rebuild - in either case the downtime involved might make this not worth the hassle for you.