{"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":"\n\n\n
\u5bfc\u8bfb<\/td>\nRAC\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
\n\u4f7f\u7528WWID \u8bc6\u522b\u8bbe\u5907
\n\u5168\u5c40\u6807\u8bc6\u7b26 (WWID) \u53ef\u7528\u4e8e\u53ef\u9760\u5730\u8bc6\u522b\u78c1\u76d8\u8bbe\u5907\u3002
\nWWID \u662f SCSI \u6807\u51c6\u8981\u6c42\u6240\u6709 SCSI \u8bbe\u5907\u63d0\u4f9b\u7684\u6301\u4e45\u7684\u3001\u72ec\u7acb\u4e8e\u7cfb\u7edf\u7684 ID\u3002<\/p>\n

\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
\u56db\u3001\u4f7f\u7528 \/sbin\/scsi_id \u7684\u78c1\u76d8\u5206\u533a\u7684 UDev \u89c4\u5219\uff08\u9996\u9009\u6a21\u5f0f\uff0c\u56e0\u4e3a\u6211\u4eec\u53ef\u4ee5\u66f4\u6539\u540d\u79f0\uff09<\/strong><\/div>\n

\u8bf7\u6ce8\u610f\u6b64\u793a\u4f8b\u6620\u5c04\uff1a \/dev\/sdb1 \u5230 \/dev\/asmdisk1_udev_sdb1\uff1a<\/p>\n

\r\n# cat 99-oracle-asmdevices.rules\r\nKERNEL==\"sd?1\", BUS==\"scsi\", PROGRAM==\"\/sbin\/scsi_id -g -u -d \/dev\/$parent\", RESULT==\"1ATA_VBOX_HARDDISK_VB81c4f844-94203a15\", NAME=\r\n\"asmdisk1_udev_sdb1\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\"\r\nKERNEL==\"sd?1\", BUS==\"scsi\", PROGRAM==\"\/sbin\/scsi_id -g -u -d \/dev\/$parent\", RESULT==\"1ATA_VBOX_HARDDISK_VB2ed83c09-e66dbcfb\", NAME=\r\n\"asmdisk1_udev_sdc1\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\"\r\n\r\n# ls -l \/dev\/asmdisk1_udev_sdb1 \/dev\/asmdisk1_udev_sdc1\r\nbrw-rw----. 1 grid asmadmin 8, 17 Mar 19 13:53 \/dev\/asmdisk1_udev_sdb1\r\nbrw-rw----. 1 grid asmadmin 8, 33 Mar 19 13:53 \/dev\/asmdisk1_udev_sdc1\r\n<\/pre>\n
\u4e94\u3001\u78c1\u76d8\u7ec4<\/strong><\/div>\n

(1) \u6269\u5bb9\u78c1\u76d8\u7ec4<\/p>\n

\u67e5\u627e\u5230path\uff1a<\/p>\n

\r\nselect group_number,disk_number ,path from v$asm_disk;\r\n<\/pre>\n

\u6269\u5bb9\u78c1\u76d8\u7ec4\uff1a<\/p>\n

\r\nalter diskgroup data2 add disk '\/dev\/asm-diski';\r\nALTER DISKGROUP DATA2 REBALANCE POWER 10; \r\n<\/pre>\n

\u67e5\u770b\u662f\u5747\u8861\u5b8c\u6210\uff1a<\/p>\n

\r\nselect operation,est_minutes from v$asm_operation;\r\n<\/pre>\n

\u5b8c\u6210\u4e4b\u540e\u4fee\u6539\u56de\u53bb\uff1a<\/p>\n

\r\nalter diskgroup DATA rebalance power 1;\r\n<\/pre>\n

\u6216\u8005\uff1a\u76f4\u63a5\u505a\u5747\u8861\uff1a<\/p>\n

\r\nalter diskgroup DATA add disk '\/dev\/asm-diski' rebalance power 10;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

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 […]<\/p>\n","protected":false},"author":1469,"featured_media":248111,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-248088","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/248088","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1469"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=248088"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/248088\/revisions"}],"predecessor-version":[{"id":248116,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/248088\/revisions\/248116"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/248111"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=248088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=248088"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=248088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}