Linux 中怎么利用udev创建ASM DISK,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。
一、查看系统环境
内核版本:
[root@rh74 rules.d]# uname -a
Linux rh74 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
系统用户:
[root@rh74 rules.d]# id grid
uid=400(grid) gid=400(asmadmin) groups=400(asmadmin)
二、创建共享磁盘(可以采用分区或独立的磁盘)
[root@rh74 ~]# fdisk -l
Disk /dev/sdc: 24.3 GB, 24323964928 bytes
255 heads, 63 sectors/track, 2957 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
查看磁盘UUID:
[root@rh74 ~]# /sbin/scsi_id -g -u -d /dev/sdc
1ATA_VBOX_HARDDISK_VB3d5ccb5e-9c197b67
scsi_id -gud /dev/sdc
磁盘分区:
[root@rh74 ~]# fdisk -l
Disk /dev/sdc: 24.3 GB, 24323964928 bytes
255 heads, 63 sectors/track, 2957 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xeb09f8d3
Device Boot Start End Blocks Id System
/dev/sdc1 1 915 7349706 83 Linux
/dev/sdc2 916 1830 7349737+ 83 Linux
/dev/sdc3 1831 2957 9052627+ 83 Linux
三、建立UDEV规则文件
[root@rh74 ~]# cd /etc/udev/rules.d/
[root@rh74 rules.d]# ls
60-fprint-autosuspend.rules 60-raw.rules 80-kvm.rules 97-bluetooth-serial.rules
60-openct.rules 70-persistent-cd.rules 90-alsa.rules 98-kexec.rules
60-pcmcia.rules 70-persistent-net.rules 90-hal.rules 99-fuse.rules
[root@rh74 rules.d]# cat 99-oracle-asmdisk.rules
KERNEL=="sdc1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB3d5ccb5e-9c197b67", NAME="asm_disk1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sdc2", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB3d5ccb5e-9c197b67", NAME="asm_disk2", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sdc3", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB3d5ccb5e-9c197b67", NAME="asm_disk3", OWNER="grid", GROUP="asmadmin", MODE="0660"
四、启动udev service
载入配置文件:
[root@rh74 rules.d]# udevadm control --reload-rules
启动udev service:
[root@rh74 rules.d]# start_udev
Starting udev:
查看asm disks:
[root@rh74 rules.d]# ls -l /dev/asm*
brw-rw---- 1 grid asmadmin 8, 33 Jan 13 16:52 /dev/asm_disk1
brw-rw---- 1 grid asmadmin 8, 34 Jan 13 16:52 /dev/asm_disk2
brw-rw---- 1 grid asmadmin 8, 35 Jan 13 16:52 /dev/asm_disk3
看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注亿速云行业资讯频道,感谢您对亿速云的支持。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。