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

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

我有一个 20TB RAID5 阵列(LSI 9265-8i / 8 x 3TB 7200rpm 驱动器),配置了 1MB 的条带大小。

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

我是一名 Linux 新手,因此非常希望能够提供具体的例子。

答案1

首先,我建议使用 RAID6 而不是 RAID5。由于卷很大,重建期间的 URE 很可能令人担忧,这会导致重建失败和数据丢失。

那么您将需要一个用于此大小的单个卷的 GPT 分区表,并且如果性能是最重要的因素,我不会使用 LVM 或类似的东西,但这意味着您以后无法轻松扩展卷。

此后,只需使用它mkfs.xfs来创建 FS。

答案2

如果您想知道的是条带对齐,请阅读“mkfs.xfs”的手册页并搜索“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 :条带宽度 = 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 中找到。

相关内容