Performance

ext4 RAID5 調整選項在 LVM 下有用嗎?

  • August 19, 2020

我正在使用帶有 mdadm RAID5 的系統設置系統,這是託管 4 個 LV 的 VG 的唯一 PV。

當我製作文件系統時,該mkfs.ext4 -E選項會有用嗎?還是因為 LVM 的惡作劇而無法知道它的效果?

-E extended-options
   Set extended options for the filesystem. Extended options are comma separated, and may take an argument using the equals ('=') sign. The -E option used to be -R in earlier versions of mke2fs. The -R option is still accepted for backwards compatibility. The following extended options are supported:  
stride=stride-size
   Configure the filesystem for a RAID array with stride-size filesystem blocks. This is the number of blocks read or written to disk before moving to the next disk, which is sometimes referred to as the chunk size. This mostly affects placement of filesystem metadata like bitmaps at mke2fs time to avoid placing them on a single disk, which can hurt performance. It may also be used by the block allocator. 
stripe-width=stripe-width
   Configure the filesystem for a RAID array with stripe-width filesystem blocks per stripe. This is typically stride-size * N, where N is the number of data-bearing disks in the RAID (e.g. for RAID 5 there is one parity disk, so N will be the number of disks in the array minus 1). This allows the block allocator to prevent read-modify-write of the parity in a RAID stripe if possible when the data is written. 

僅當您確保您的 PV 與 RAID 塊大小對齊(LV 應該是自動的)時,這才有意義。您可以通過以下方式檢查

pvs -o pe_start,pv_name --units s
dmsetup table name # with name what you see in /dev/mapper

這並沒有回答您的問題,但已經回答了。但是使用raid5 是個壞主意。它太慢而且太容易失敗。討論見:

“截至 2012 年 8 月,Dell、Hitachi、Seagate、Netapp、EMC、HDS、SUN Fishworks 和 IBM 目前已發布關於在大容量驅動器和大型陣列中使用 RAID 5 的建議。

$$ 51 $$ http://community.spiceworks.com/topic/251735-new-raid-level-recommendations-from-dell "

“當 RAID 5 陣列中的磁碟出現故障並且必須重建時,在重建期間很可能會出現不可恢復的讀取錯誤 (BER / UER)。由於不再有任何冗餘,因此 RAID 陣列無法重建”

我強烈建議使用raid10,或者如果您確實需要使用更多空間,請使用raid6。在 mdadm 中,您可以使用奇數磁碟數量,例如 3 或 5 磁碟 raid10:

引用自:https://serverfault.com/questions/506548