Get the App
SLTechnology News&Howtos  ›  Servers  › 

How Redhat7 Udev binds multipath devices

Shulou Source: shulou.com Published: 2022-06-01 03:07:55 11月13日 Update

This article introduces how Redhat7 Udev binds multipath devices, the content is very detailed, interested friends can refer to, I hope it can be helpful to you.

Solve the problem of binding multipath devices to RedHat7 Udev and record it for everyone's convenience.

1) obtain DM_UUID:

Cd / dev/mapper

For i in `ls mpath* `; do printf "% 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) generate rules file

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 files to other nodes

Scp / etc/udev/rules.d/99-oracle-asmdevices.rules node2:/etc/udev/rules.d/

4) reload the rules file

Udevadm control-reload-rules

Udevadm trigger

5) View the device information after binding

[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

So much for sharing about how Redhat7 Udev binds multipath devices. I hope the above content can be helpful to you and learn more. If you think the article is good, you can share it for more people to see.

Tags: Devices paths files content more help good information interests guys partners articles knowledge articles nodes questions references generation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple MariaDB Redmi Shulou Tech Info Shulou Information