在Linux中用XFS格式化20TB分区的最佳方法是什么?

我有一个configuration为1MB条带大小的20TB RAID5arrays(LSI 9265-8i / 8 x 3TB 7200rpm驱动器)。

在Linux中对这个分区进行分区和格式化的最佳方式是什么,以便最大限度地提高单个〜20TB共享的性能?

我是一个Linux新手,所以具体的例子表示赞赏。

首先,我会build议使用RAID6而不是RAID5。 有了这么大的数量,重build期间的URE可能就足以担心了,这将导致重build失败和数据丢失。

那么,你将需要一个GPT分区表,这个大小的单一卷,如果性能是最重要的因素,我不会使用LVM或类似的东西,但这意味着你不能容易地扩大后来的音量。

之后,只需使用mkfs.xfs来创buildFS。

如果你想知道的是条纹alignment,请阅读“mkfs.xfs”的手册页并search“sunit”和“swidth”(也称为su和sw)。 从手册页:

 sunit=value: This is used to specify the stripe unit for a RAID device or a logical volume. The value has to be specified in 512-byte block units. Use the su suboption to specify the stripe unit size in bytes. This suboption ensures that data allocations will be stripe unit aligned when the current end of file is being extended and the file size is larger than 512KiB. Also inode allocations and the internal log will be stripe unit aligned. swidth=value This is used to specify the stripe width for a RAID device or a striped logical volume. The value has to be spec- ified in 512-byte block units. Use the sw suboption to specify the stripe width size in bytes. This suboption is required if -d sunit has been specified and it has to be a multiple of the -d sunit suboption. 

快速回顾一下:
sunit:512字节块中的条带单元

swidth:stripe width = sunit * $ num_data_disks

由于您有8个磁盘RAID5(分布式奇偶校验)$ num_data_disks = 8

条纹大小= 1M = 1024kB

因此,要格式化mkfs.xfs -d su = 1024k,sw = 8 / dev / sd {X}

这也可以在XFS.org FAQ中find。