大网数据广告活动
服务器运维问答

SSD Software RAID Alignment Necessary?

· 52CE 我爱测

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 a…

问题原文

原帖链接 · charles s · CC BY-SA 3.0

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!

已采纳解答

原帖链接 · David Spillett · CC BY-SA 3.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-04-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。