您好,登錄后才能下訂單哦!
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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。