我在硬件 RAID6 中有 10 个磁盘,每个磁盘有 8 TB(因此,8 个数据磁盘 + 2 个奇偶校验)。按照一个非常相似的问题的答案,我希望自动检测所有必要的参数。但是,在最后创建 XFS 文件系统时,我得到了
# 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
Run Code Online (Sandbox Code Playgroud)
这看起来像没有使用条带化。由于我在不同网站上找到的不同术语(条带大小、条带大小、条带块……),我想问一下我的手动参数是否正确。
RAID 6 的条带大小设置为 256KB:
# ./storcli64 /c0/v1 show all | grep Strip
Strip Size = 256 KB
Run Code Online (Sandbox Code Playgroud)
因此,条带大小为 8*256KB = 2048KB = 2MB。这样对吗?根据这个(如果我理解正确的话),pvcreate必须使用条(或块)大小作为参数dataalignment:
# pvcreate --dataalignment 256K /dev/sdb
Physical volume "/dev/sdb" successfully created
Run Code Online (Sandbox Code Playgroud)
请注意,我使用了没有分区的整个 RAID 设备。现在一个
# vgcreate vgdata /dev/sdb
Volume group "vgdata" successfully created
Run Code Online (Sandbox Code Playgroud)
默认 PE 大小为 4MB 应该没问题,因为它是条带大小 2MB 的倍数。正确的?
现在,将 vgroup 的一部分分配给逻辑卷:
# lvcreate -L 40T vgdata -n lvscratch
Logical volume "lvscratch" created.
Run Code Online (Sandbox Code Playgroud)
最后,文件系统已创建,但现在具有正确的参数(条带大小为 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
Run Code Online (Sandbox Code Playgroud)
这种方法是否正确?对于逻辑卷或卷组的扩展,有什么需要注意的吗?我想如果卷组将使用另一个 RAID6 系统进行扩展,则条带大小应该等于当前的 RAID6。
编辑:我的困惑似乎主要是基于与条带相关的术语的不同用法。我的 RAID 控制器、LSI 或 Avago 的制造商以下列方式定义这些术语:
条纹宽度
条带宽度是实施条带化的驱动器组中涉及的驱动器数量。例如,具有磁盘条带化的四磁盘驱动器组的条带宽度为四。
条纹尺寸
条带大小是 RAID 控制器跨多个驱动器写入的交错数据段的长度,不包括奇偶校验驱动器。例如,考虑一个包含 64 KB 磁盘空间和 16 KB 数据驻留在条带中每个磁盘上的条带。在这种情况下,条带大小为 64 KB,条带大小为 16 KB。
带材尺寸
条带大小是位于单个驱动器上的条带部分。
在操作在下一个磁盘上继续之前写入磁盘或从磁盘读取的顺序数据段通常称为块、跨步或条带单元,而它们形成单个条带操作的逻辑组称为条带或条带。一个块(条带单元)中的数据量,通常以字节为单位,被称为块大小、步幅大小、条带大小、条带深度或条带长度。阵列中数据磁盘的数量有时称为条带宽度,但它也可能指一个条带内的数据量。
一个步幅中的数据量乘以阵列中的数据磁盘数量(即,条带深度乘以条带宽度,在几何类比中会产生一个区域)有时称为条带大小或条带宽度。当数据块分布在多个阵列(可能是系统中的所有驱动器)中时,就会发生宽条带化。当数据块分布在单个阵列中的驱动器上时,就会发生窄条带化。
即使在上面的 Wikipedia 文本中,条纹大小也有两种不同的含义。但是,我现在想,在创建 xfs 文件系统时,必须将存储在单个驱动器上的单个块的大小作为参数提供给 su。这个,应该mkfs.xfs -d su=256k,sw=8在上面的命令中。正确的?
Mic*_*ton 12
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.
Run Code Online (Sandbox Code Playgroud)
因此,如果您的阵列报告的条带大小为 256KiB,您可以指定su=256K或sunit=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.
Run Code Online (Sandbox Code Playgroud)
对于 10 个轴(8 个数据,2 个奇偶校验),您可以指定sw=8(数据轴)或swidth=2M(条带大小乘以数据轴)。
需要注意的是 xfs_info和mkfs.xfs解释sunit,并swidth在512B扇区为单位被指定; 然而,不幸的是,这不是他们报告的单位。xfs_info并mkfs.xfs以基本块大小 ( bsize) 的倍数而不是 512B 扇区报告它们。
特尔;博士:
指定这些的最简单方法通常是通过带材尺寸和锭子数,即su=带材尺寸和sw=锭子数。
| 归档时间: |
|
| 查看次数: |
5775 次 |
| 最近记录: |