Show Table of Contents
3.2. 產生 multipath 裝置時,忽略本機磁碟
有些電腦上的內部磁碟含有本機 SCSI 卡。不建議為這些裝置使用 DM Multipath。若您將
find_multipaths 配置參數設為 yes,您便無須將這些裝置納入黑名單中。欲取得更多有關於 find_multipaths 配置參數上的相關資訊,請參閱〈節 4.3, “配置檔案的預設值”〉。
若您不將
find_multipaths 配置參數設為 yes,您可使用下列程序來修改 multipath 配置檔案,以在配置 multipath 時忽略本機磁碟。
- 決定哪些磁碟為本機磁碟,並將這些磁碟標示於黑名單中。在此範例中,
/dev/sda是內部磁碟。請注意預設的 multipath 配置檔案中原有的值為何,執行multipath -v2指令會在 multipath 映射中顯示本機硬碟/dev/sda。欲取得更多有關於multipath指令輸出的相關資訊,請參閱〈節 5.8, “Multipath 指令的輸出”〉。#
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檔案之後,您必須手動告訴multipathddaemon 重新載入這檔案。以下指令可以重新載入更新過的/etc/multipath.conf檔案。#
service multipathd reload - 請執行下列指令,以移除 multipath 裝置:
#
multipath -f SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1 - 若要檢查裝置移除是否成功,您可執行
multipath -ll指令以顯示目前的 multipath 配置。若希望取得multipath -ll指令上的相關資訊,請參閱〈節 5.9, “使用 multipath 指令來進行 Multipath 查詢”〉。若要檢查被納入黑名單中的裝置是否沒有被加回,您可執行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.