这篇文章给大家介绍Redhat7 Udev如何绑定多路径设备,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。
创新互联主营盘州网站建设的网络公司,主营网站建设方案,app软件定制开发,盘州h5微信小程序定制开发搭建,盘州网站营销推广欢迎盘州等地区企业咨询
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文件至其他节点
scp /etc/udev/rules.d/99-oracle-asmdevices.rules node2:/etc/udev/rules.d/
4) 重新加载rules文件
udevadm control --reload-rules
udevadm trigger
5) 查看绑定后设备信息
[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
关于Redhat7 Udev如何绑定多路径设备就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。