{"id":248088,"date":"2022-08-04T09:32:43","date_gmt":"2022-08-04T01:32:43","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=248088"},"modified":"2022-07-22T11:33:05","modified_gmt":"2022-07-22T03:33:05","slug":"linux-udev","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-udev.html","title":{"rendered":"Linux\u4e0d\u91cd\u542f\u8bc6\u522b\u65b0\u6302\u8f7d\u78c1\u76d8"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | RAC\u6570\u636e\u5e93\u6269\u5bb9\u5b58\u50a8\u7a7a\u95f4\uff0c\u65b0\u6302\u8f7d\u8fc7\u6765\u7684\u76d8\u6ca1\u6709\u8bc6\u522b\u5230\uff0c\u901a\u8fc7fdisk -l\u547d\u4ee4\u6ca1\u6709\u770b\u5230\u3002\u7ecf\u67e5\u8be2\u9700\u8981\u91cd\u542f\u6216\u8005\u626b\u63cf\u6765\u770b\u5230\u65b0\u6302\u8f7d\u7684\u78c1\u76d8\uff0c\u4eca\u5929\u5206\u4eab\u4e00\u4e0b\u5177\u4f53\u7684\u65b9\u6cd5\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n <\/p>\n \u4e00\u3001\u6982\u8ff0<\/strong><\/div>\n RAC\u6570\u636e\u5e93\u6269\u5bb9\u5b58\u50a8\u7a7a\u95f4\uff0c\u65b0\u6302\u8f7d\u8fc7\u6765\u7684\u76d8\u6ca1\u6709\u8bc6\u522b\u5230\uff0c\u901a\u8fc7fdisk -l\u547d\u4ee4\u6ca1\u6709\u770b\u5230\u3002\u7ecf\u67e5\u8be2\u9700\u8981\u91cd\u542f\u6216\u8005\u626b\u63cf\u6765\u770b\u5230\u65b0\u6302\u8f7d\u7684\u78c1\u76d8\uff0c\u4eca\u5929\u5206\u4eab\u4e00\u4e0b\u5177\u4f53\u7684\u65b9\u6cd5\u3002<\/p>\n \u73af\u5883\uff1aOEL 6.4 \u548c RAC 11.2.0.4<\/p>\n \u4e8c\u3001\u5173\u952e\u4e8b\u9879<\/strong><\/div>\n \u4e0d\u8981\u4f7f\u7528\/dev\/sdX \u6216 \/dev\/dm-XX \u4f5c\u4e3a\u8bbe\u5907\u540d\u79f0\uff0c\u56e0\u4e3a\u6b64\u8bbe\u5907\u540d\u79f0\u5728\u91cd\u65b0\u542f\u52a8\u540e\u53ef\u80fd\u4f1a\u66f4\u6539 \u4e09\u3001\u663e\u793a\u7cfb\u7edf\u4e0a\u6240\u6709\u53ef\u7528\u7684 WWID<\/strong><\/div>\n \r\nShell script to display WWID on your system\r\n#!\/bin\/bash\r\n#\r\n#Usage: As root user run : .\/check_wwid.sh \r\n#\r\nfor FILE in `find \/dev -name \"sd*\" | sort`\r\n do\r\n WWID=`scsi_id --whitelisted --replace-whitespace --device=$FILE `\r\n echo $FILE \" WWID: \" $WWID\r\n done\r\n\r\n$ sudo .\/check_wwid.sh\r\n..\r\n\/dev\/sdb WWID: 1ATA_VBOX_HARDDISK_VB81c4f844-94203a15\r\n\/dev\/sdb1 WWID: 1ATA_VBOX_HARDDISK_VB81c4f844-94203a15\r\n\/dev\/sdc WWID: 1ATA_VBOX_HARDDISK_VB2ed83c09-e66dbcfb\r\n\/dev\/sdc1 WWID: 1ATA_VBOX_HARDDISK_VB2ed83c09-e66dbcfb\r\n..\r\n--> Of course WWIDs for partitions and for the complete disk are identical \r\n\r\n# cat 99-oracle-asmdevices.rules\r\nKERNEL==\"sd*\", SUBSYSTEM==\"block\", ENV{DEVTYPE}==\"disk\", ENV{ID_SERIAL}==\"14f504e46494c45523264556151442d5261336d2d566e4250\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\"\r\n\r\n# ls -ls \/dev\/sdr\r\n0 brw-rw----. 1 grid asmadmin 65, 16 Mar 19 14:42 \/dev\/sdr\r\n\r\nReload and Restart the udev rules \r\n# udevadm control --reload-rules\r\n# start_udev\r\nStarting udev: [ OK ]\r\nVerify disk protections:\r\n# ls -ltr \/dev\/asm*\r\nbrw-rw----. 1 grid asmadmin 8, 17 Mar 15 10:03 \/dev\/asmdisk1_udev_sdb1\r\nbrw-rw----. 1 grid asmadmin 8, 33 Mar 15 10:03 \/dev\/asmdisk2_udev_sdc1\r\n\r\nRedistribute 99-oracle-asmdevices.rules file to all cluster nodes and restat udev echo system on these nodes\r\n# scp 99-oracle-asmdevices.rules grac42:\/etc\/udev\/rules.d\r\n# scp 99-oracle-asmdevices.rules grac43:\/etc\/udev\/rules.d\r\n\r\nOn each RAC node\r\n# udevadm control --reload-rules\r\n# start_udev\r\n# ls -ltr \/dev\/asm*\r\nbrw-rw----. 1 grid asmadmin 8, 17 Mar 15 10:03 \/dev\/asmdisk1_udev_sdb1\r\nbrw-rw----. 1 grid asmadmin 8, 33 Mar 15 10:03 \/dev\/asmdisk2_udev_sdc1\r\n<\/pre>\n |