redhat 7.x 、redhat 6.x查看硬盘UUID方法
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
***************************************************************************************
上一篇: Python学习小技巧总结
下一篇: NFS网络文件系统详解