Show Table of Contents
3.2. 在生成多路径设备时忽略逻辑磁盘
有些机器在其内部磁盘中有本地 SCSI 卡。不建议在这些设备中使用 DM Multipath。如果将
find_multipaths 配置参数设定为 yes,则不一定要将这些设备列入黑名单。有关 find_multipaths 配置参数的详情,请参考 第 4.3 节 “配置文件默认设置”。
如果没有将
find_multipaths 配置参数设定为 yes,则可以使用以下步骤修改多路径配置文件,以便在配置多路径时忽略本地磁盘。
- 确定哪些磁盘是内部磁盘并将其列入黑名单。在这个示例中,
/dev/sda是内部磁盘。注:因为在默认多路径配置文件中已经对其进行了配置,所以执行multipath -v2会在多路径映射中显示本地磁盘/dev/sda。有关multipath命令输出的详情请参考 第 5.8 节 “多路径命令输出”。#
multipath -v2create: SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1 undef WINSYS,SF2372 size=33 GB features="0" hwhandler="0" wp=undef `-+- policy='round-robin 0' prio=1 status=undef |- 0:0:0:0 sda 8:0 [--------- device-mapper ioctl cmd 9 failed: Invalid argument device-mapper ioctl cmd 14 failed: No such device or address create: 3600a0b80001327d80000006d43621677 undef WINSYS,SF2372 size=12G features='0' hwhandler='0' wp=undef `-+- policy='round-robin 0' prio=1 status=undef |- 2:0:0:0 sdb 8:16 undef ready running `- 3:0:0:0 sdf 8:80 undef ready running create: 3600a0b80001327510000009a436215ec undef WINSYS,SF2372 size=12G features='0' hwhandler='0' wp=undef `-+- policy='round-robin 0' prio=1 status=undef |- 2:0:0:1 sdc 8:32 undef ready running `- 3:0:0:1 sdg 8:96 undef ready running create: 3600a0b80001327d800000070436216b3 undef WINSYS,SF2372 size=12G features='0' hwhandler='0' wp=undef `-+- policy='round-robin 0' prio=1 status=undef |- 2:0:0:2 sdd 8:48 undef ready running `- 3:0:0:2 sdg 8:112 undef ready running create: 3600a0b80001327510000009b4362163e undef WINSYS,SF2372 size=12G features='0' hwhandler='0' wp=undef `-+- policy='round-robin 0' prio=1 status=undef |- 2:0:0:3 sdd 8:64 undef ready running `- 3:0:0:3 sdg 8:128 undef ready running - 为防止设备映射器将
/dev/sda与其多路径对应,请编辑/etc/multipath.conf文件的 blacklist 部分,使其包括该设备。虽然可以使用devnode类型将sda设备列入黑名单,但并不安全,因为重启时无法保证/dev/sda使用同一个名称。要将单独的设备列入黑名单,可以使用那个设备的 WWID 将其列入黑名单。请注意:在multipath -v2命令的输出中,/dev/sda设备的 WWID 是 SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1。要将这个设备列入黑名单,请在/etc/multipath.conf文件中添加以下内容。blacklist { wwid SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1 } - 更新
/etc/multipath.conf文件后,必须手动让multipathd守护进程重新载入该文件。以下命令可重新载入更新的/etc/multipath.conf文件。#
service multipathd reload - 运行以下命令删除多路径设备:
#
multipath -f SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1 - 要确定被列入黑名单的设备没有被重新添加回来,可输入
multipath命令,如下所示。如果没有指定-v选项,则multipath命令默认详细等级为v2。#
multipathcreate: 3600a0b80001327d80000006d43621677 undef WINSYS,SF2372 size=12G features='0' hwhandler='0' wp=undef `-+- policy='round-robin 0' prio=1 status=undef |- 2:0:0:0 sdb 8:16 undef ready running `- 3:0:0:0 sdf 8:80 undef ready running create: 3600a0b80001327510000009a436215ec undef WINSYS,SF2372 size=12G features='0' hwhandler='0' wp=undef `-+- policy='round-robin 0' prio=1 status=undef |- 2:0:0:1 sdc 8:32 undef ready running `- 3:0:0:1 sdg 8:96 undef ready running create: 3600a0b80001327d800000070436216b3 undef WINSYS,SF2372 size=12G features='0' hwhandler='0' wp=undef `-+- policy='round-robin 0' prio=1 status=undef |- 2:0:0:2 sdd 8:48 undef ready running `- 3:0:0:2 sdg 8:112 undef ready running create: 3600a0b80001327510000009b4362163e undef WINSYS,SF2372 size=12G features='0' hwhandler='0' wp=undef `-+- policy='round-robin 0' prio=1 status=undef |- 2:0:0:3 sdd 8:64 undef ready running `- 3:0:0:3 sdg 8:128 undef ready running

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.