RHEL6與5在多路徑的配置上有一些小區別。scsi_id命令有些參數不再支持。在RHEL 6中獲取磁盤的wwid可以通過–whitelist參數獲取:
[root@db1 ~]# scsi_id --whitelist /dev/sdg 360060160a2212f00f8139df761ece111
可以通過一條shell命令,來獲取系統所有磁盤的wwid:
# for i in `cat /proc/partitions ¦ awk {'print $4'} ¦grep sd`; do echo "### $i: `scsi_id --whitelist /dev/$i`"; done
在RHEL 5中,可以通過如下方式獲取磁盤wwid:
# for i in `cat /proc/partitions ¦ awk {'print $4'} ¦grep sd`; do echo "### $i: `scsi_id -g -u -s /block/$i`"; done
另外,RHEL 6中,多路徑配置文件也出現變化:
# multipath.conf written by anaconda
defaults {
user_friendly_names yes
}
blacklist {
devnode "^(ramrawloopfdmddm-srscdst)[0-9]*"
devnode "^hd[a-z]"
devnode "^dcssblk[0-9]*"
device {
vendor "DGC"
product "LUNZ"
}
device {
vendor "IBM"
product "S/390.*"
}
# don't count normal SATA devices as multipaths
device {
vendor "ATA"
}
# don't count 3ware devices as multipaths
device {
vendor "3ware"
}
device {
vendor "AMCC"
}
# nor highpoint devices
device {
vendor "HPT"
}
wwid "20080930-1"
wwid "20080930-1"
device {
vendor Cisco
product Virtual_CD_DVD
}
wwid "*" //其實可以注釋這項,這樣就不需要單獨填寫blacklist_exceptions
}
blacklist_exceptions { //排除在黑名單之外的wwid
wwid "360060160a2212f00a67e0b91f2dbe111"
wwid "360060160a2212f0044a0fc6ef5eae111"
}
multipaths {
multipath {
uid 0 //磁盤讀所屬用戶uid
gid 0 //磁盤所屬組gid
wwid "360060160a2212f00a67e0b91f2dbe111" //wwid號
mode 0600 //磁盤讀寫權限
}
multipath {
wwid "360060160a2212f0044a0fc6ef5eae111"
alias data //別名
}
... ... //還可以根據實際情況,配置其它磁盤的別名、uid、gid、mode etc...
}
配置完了之後,重啟multipathd服務,之後通過multipath -ll查看經過多路徑軟件綁定後的磁盤。
注意,如果要對磁盤進行格式化,請采用/dev/mapper/[alias]這類設備名進行fdisk。