lvm上的xfs硬件RAID:正确的参数?

我有10个磁盘,每个8TB在一个硬件RAID6(因此,8个数据磁盘+2个奇偶校验)。 在回答了一个非常类似的问题之后 ,我希望自动检测所有必要的参数。 但是,在最后创buildXFS文件系统时,我得到了

# mkfs.xfs /dev/vgdata/lvscratch meta-data=/dev/vgdata/lvscratch isize=256 agcount=40, agsize=268435455 blks = sectsz=4096 attr=2, projid32bit=1 = crc=0 finobt=0 data = bsize=4096 blocks=10737418200, imaxpct=5 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=0 log =internal log bsize=4096 blocks=521728, version=2 = sectsz=4096 sunit=1 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 

这看起来像条纹没有被使用过。 由于我在不同的网站上发现了不同的术语(条纹大小,条纹大小,条纹大小,…),我想问一下我是否已经手动获取了正确的参数。

RAID 6已经设置为256KB的条带大小:

 # ./storcli64 /c0/v1 show all | grep Strip Strip Size = 256 KB 

因此,条带大小是8 * 256KB = 2048KB = 2MB。 它是否正确? 据此(如果我理解正确), pvcreate必须使用strip(或chunk)大小作为数据dataalignment参数:

 # pvcreate --dataalignment 256K /dev/sdb Physical volume "/dev/sdb" successfully created 

请注意,我使用了整个RAID设备,没有分区。 现在一个

 # vgcreate vgdata /dev/sdb Volume group "vgdata" successfully created 

与默认的PE大小4MB应该罚款,因为它是2MB的条带大小的倍数。 正确?

现在,vgroup的一部分被分配给一个逻辑卷:

 # lvcreate -L 40T vgdata -n lvscratch Logical volume "lvscratch" created. 

最后,创build文件系统,但现在使用正确的参数(条带大小为2MB,条带宽度为8):

 # mkfs.xfs -d su=2048k,sw=8 /dev/vgdata/lvscratch meta-data=/dev/vgdata/lvscratch isize=256 agcount=41, agsize=268434944 blks = sectsz=4096 attr=2, projid32bit=1 = crc=0 finobt=0 data = bsize=4096 blocks=10737418240, imaxpct=5 = sunit=512 swidth=4096 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=0 log =internal log bsize=4096 blocks=521728, version=2 = sectsz=4096 sunit=1 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 

这种方法是否正确? 对于逻辑卷或卷组的扩展,有什么需要记住的吗? 我想如果卷组将被另一个RAID6系统所扩展,那么磁带的大小应该等于当前的RAID6。

编辑 :我的困惑似乎主要是基于连接到条纹的条款的不同用法。 我的RAID控制器,LSI或Avago的制造商按以下方式定义了这些条款 :

条纹宽度

条带宽度是执行条带化的驱动器组中涉及的驱动器数量。 例如,带有磁盘条带的四磁盘驱动器组的条带宽度为四。

条纹大小

条带大小是RAID控制器跨多个驱动器写入的交叉数据段的长度,不包括奇偶校验驱动器。 例如,考虑包含64 KB磁盘空间的条带,并且每个磁盘上的条带中包含16 KB的数据。 在这种情况下,条带大小是64 KB,条带大小是16 KB。

带大小

条带大小是位于单个驱动器上的条带的一部分。

维基百科 (和IBM )似乎使用其他定义:

在操作在下一个磁盘上继续操作之前,写入磁盘或从磁盘读取的顺序数据段通常称为块,步长或条带单元,而形成单个条带操作的逻辑组称为条带或条带。 通常以字节为单位的一个块(条带单元)中的数据量被不同地称为块大小,步幅大小,条带大小,条带深度或条带长度。 数组中的数据磁盘的数量有时称为条带宽度,但也可能指的是条带中的数据量。

一个步幅中的数据量乘以arrays中数据磁盘的数量(即条纹深度乘以条带宽度,几何类比将产生一个区域)有时称为条带大小或条带宽度。 当大块数据散布在多个arrays中,可能是系统中的所有驱动器时,就会发生宽条带化。 当数据块分散在单个arrays中的驱动器中时,会出现窄条带。

即使在维基百科上面,条纹大小也有两种不同的含义。 但是,现在我想,在创buildxfs文件系统时,存储在单个驱动器上的单个块的大小必须作为su的参数给出。 这个,上面的命令应该是mkfs.xfs -d su=256k,sw=8 。 正确?

XFS手册页不是“条带大小”和“条带大小”,而是分别使用术语“条带单位”和“条带宽度”。

这样就可以解码mkfs.xfs(8)手册页中令人困惑的文本:

  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 subop‐ tion 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. su=value This is an alternative to using sunit. The su sub‐ option is used to specify the stripe unit for a RAID device or a striped logical volume. The value has to be specified in bytes, (usually using the m or g suffixes). This value must be a multiple of the filesystem block size. 

因此,在您的arrays报告256KiB的条带大小时,您可以指定su=256Ksunit=512 (因为512个512字节块等于256KiB)。

  swidth=value This is used to specify the stripe width for a RAID device or a striped logical volume. The value has to be specified 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. sw=value suboption is an alternative to using swidth. The sw suboption is used to specify the stripe width for a RAID device or striped logical volume. The value is expressed as a multiplier of the stripe unit, usu‐ ally the same as the number of stripe members in the logical volume configuration, or data disks in a RAID device. When a filesystem is created on a logical volume device, mkfs.xfs will automatically query the logi‐ cal volume for appropriate sunit and swidth values. 

使用10个主轴(8个数据,2个奇偶校验),您可以指定sw=8 (数据主轴)或swidth=2M (条带大小乘以数据主轴)。

请注意, xfs_infomkfs.xfssunitswidth解释为以512B扇区为单位进行指定; 但不幸的是不是他们报告的单位。 xfs_infomkfs.xfs以基本块大小( bsize )的倍数报告它们,而不是在512B扇区中。

TL; DR:

指定这些最简单的方法通常是通过条带大小和主轴数量,因此su=条带大小和sw=主轴数量。