這篇文章給大家介紹Redhat7 Udev如何綁定多路徑設(shè)備,內(nèi)容非常詳細(xì),感興趣的小伙伴們可以參考借鑒,希望對(duì)大家能有所幫助。
成都創(chuàng)新互聯(lián)主要從事成都網(wǎng)站設(shè)計(jì)、做網(wǎng)站、成都外貿(mào)網(wǎng)站建設(shè)公司、網(wǎng)頁設(shè)計(jì)、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)南關(guān),十余年網(wǎng)站建設(shè)經(jīng)驗(yàn),價(jià)格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):028-86922220
1) 取得DM_UUID:
cd /dev/mapper
for i in `ls mpath*`; do printf "%s %s\n" "$i" "$(udevadm info --query=all --name=/dev/mapper/$i |grep -i dm_uuid)"; done
LOG:
mpatha E: DM_UUID=mpath-14f504e46494c4552686a374a58592d763045432d5a305a6a
mpathb E: DM_UUID=mpath-14f504e46494c455267334f6f69422d6f51626c2d33516467
mpathc E: DM_UUID=mpath-14f504e46494c45527172433537322d476d47522d62757574
mpathd E: DM_UUID=mpath-14f504e46494c4552426f38676d392d626652342d6d6f7872
mpathe E: DM_UUID=mpath-14f504e46494c4552766d6e434c792d6a7065302d65346e70
mpathf E: DM_UUID=mpath-14f504e46494c45525a6c345564512d517274652d304e7a72
2) 生成rules文件
vi /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-14f504e46494c4552686a374a58592d763045432d5a305a6a",SYMLINK+="asm_test1",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-14f504e46494c455267334f6f69422d6f51626c2d33516467",SYMLINK+="asm_test2",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-14f504e46494c45527172433537322d476d47522d62757574",SYMLINK+="asm_test3",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-14f504e46494c4552426f38676d392d626652342d6d6f7872",SYMLINK+="asm_test4",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-14f504e46494c4552766d6e434c792d6a7065302d65346e70",SYMLINK+="asm_test5",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-14f504e46494c45525a6c345564512d517274652d304e7a72",SYMLINK+="asm_test6",OWNER="grid",GROUP="asmadmin",MODE="0660"
3) scp rules文件至其他節(jié)點(diǎn)
scp /etc/udev/rules.d/99-oracle-asmdevices.rules node2:/etc/udev/rules.d/
4) 重新加載rules文件
udevadm control --reload-rules
udevadm trigger
5) 查看綁定后設(shè)備信息
[root@test1 rules.d]# ls -l /dev/asm*
lrwxrwxrwx 1 root root 4 Aug 20 14:42 /dev/asm_test1 -> dm-2
lrwxrwxrwx 1 root root 4 Aug 20 14:42 /dev/asm_test2 -> dm-3
lrwxrwxrwx 1 root root 4 Aug 20 14:42 /dev/asm_test3 -> dm-4
lrwxrwxrwx 1 root root 4 Aug 20 14:42 /dev/asm_test4 -> dm-5
lrwxrwxrwx 1 root root 4 Aug 20 14:42 /dev/asm_test5 -> dm-6
lrwxrwxrwx 1 root root 4 Aug 20 14:42 /dev/asm_test6 -> dm-7
[root@test1 rules.d]# ls -l /dev/dm-*
brw-rw---- 1 grid asmadmin 253, 2 Aug 20 14:42 /dev/dm-2
brw-rw---- 1 grid asmadmin 253, 3 Aug 20 14:42 /dev/dm-3
brw-rw---- 1 grid asmadmin 253, 4 Aug 20 14:42 /dev/dm-4
brw-rw---- 1 grid asmadmin 253, 5 Aug 20 14:42 /dev/dm-5
brw-rw---- 1 grid asmadmin 253, 6 Aug 20 14:42 /dev/dm-6
brw-rw---- 1 grid asmadmin 253, 7 Aug 20 14:42 /dev/dm-7
關(guān)于Redhat7 Udev如何綁定多路徑設(shè)備就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到。