1、檢視磁碟分割槽UUID:
2、檢視磁碟UUID
使用/lib/udev/scsi_id檢視磁碟UUID
命令:/lib/udev/scsi_id –whitelisted –device=/dev/sd*
******************************************************************************
注:
redhat 6.x命令為:
scsi_id –whitelisted –device=/dev/sd*
******************************************************************************
3、使用指令碼輸入磁碟UUID
符號“c d e f g h”為磁碟名
linux 7.x指令碼為
******************************************************************************
注:
linux 6.x指令碼為
******************************************************************************
4、Oracle ASM配置
生成檔案內容的指令碼
編寫/etc/udev/rules檔案,新增ASM塊裝置
將生成的內容儲存在99-oracle-asmdevices.rules檔案中。
修改磁碟名,便於識別:asm-grid1……
vim /etc/udev/rules.d/99-oracle-asmdevices.rules linux 6.x #linux 6.x KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29cd6841d61d151f17cfaae37c1", NAME="asm-grid1", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29981370abb4b6dbf6101ad8e9f", NAME="asm-grid2", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29b71c709b99b63547534028558", NAME="asm-dgsystem", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29bbaf58c22dcb92b6f6e4c67e9", NAME="asm-dgrecovery", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c2942fbfb7d286d52d2e7fa5cf05", NAME="asm-dgdata1", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29ac6f46745dccdcb2e623064da", NAME="asm-dgdata2", OWNER="grid", GROUP="asmadmin", MODE="0660"
linux7.x
5、重啟udev裝置
/sbin/udevadm control --reload-rules /sbin/start_udev udevadm trigger systemctl restartsystemd-udevd.service [root@rac01 ~]# partprobe [root@rac01 ~]# ll /dev/a* crw-rw----. 1 root video 10, 175 9月 4 02:47 /dev/agpgart lrwxrwxrwx. 1 root root 3 9月 4 02:59 /dev/asm-dgdata1 -> sdg lrwxrwxrwx. 1 root root 3 9月 4 02:59 /dev/asm-dgdata2 -> sdh lrwxrwxrwx. 1 root root 3 9月 4 02:59 /dev/asm-dgrecovery -> sdf lrwxrwxrwx. 1 root root 3 9月 4 02:59 /dev/asm-dgsystem -> sde lrwxrwxrwx. 1 root root 3 9月 4 02:59 /dev/asm-grid1 -> sdc lrwxrwxrwx. 1 root root 3 9月 4 02:59 /dev/asm-grid2 -> sdd crw-------. 1 root root 10, 235 9月 4 02:47 /dev/autofs [root@rac01 ~]#
6、重新生成
# rm -rf /dev/asm-dgsystem /sbin/udevadm control --reload-rules /sbin/start_udev udevadm trigger systemctl restartsystemd-udevd.service ll /dev/a*
***************************************************************************************
RestartUDEV Service
Restart the UDEV service.
# #OL5
# /sbin/udevcontrol reload_rules
# #OL6 and OL7
# udevadm control --reload-rules
# #OL5 and OL6 : Not needed for OL7
# /sbin/start_udev
***************************************************************************************
參考:
https://oracle-base.com/articles/linux/udev-scsi-rules-configuration-in-oracle-linux