我正在build立一个带有mdadm RAID5系统的系统,该系统是唯一支持4个LV的VG的PV。
当我创build文件系统时, 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 (eg 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应自动)alignment时才有意义。 你可以通过检查
pvs -o pe_start,pv_name --units s dmsetup table name # with name what you see in /dev/mapper
这不是你的问题,但它已经回答了。 然而使用raid5是一个坏主意。 这太慢了,太容易失败。 讨论请参阅:
“截至2012年8月,戴尔,日立,希捷,Netapp,EMC,HDS,SUN Fishworks和IBM目前都有关于在大容量硬盘和大型arrays中使用RAID 5的build议。[51] http://community.spiceworks .com / topic / 251735-new-raid-level-recommendations-from-dell “
“当RAID 5arrays中的磁盘出现故障并且需要重build时,在重build(BER / UER)过程中,出现不可恢复的读取错误的可能性很大,因为不再有冗余,RAIDarrays不能重build”
我强烈build议使用raid10,或者如果你真的需要利用更多的空间使用raid6。 在mdadm中,您可以使用奇数磁盘数量,例如3或5个磁盘raid10: