Linux 經過udev建立ASM DISK (RAC共享存儲)

Linux 經過udev建立ASM DISK(RAC共享存儲)
oracle

系統環境:RedHat EL64app

Oracle:   Oracle 11gR2ide

   在Oracle 11gR2,構建RAC時能夠經過ASM建立asm disk,可是須要安裝asmlib相關軟件;對於RedHat EL64,Oracle的asm不能很好的支持,因此能夠經過udev來建立asm disk,就不須要安裝asmlib相關軟件。ui

1、查看系統環境spa

內核版本:3d

[root@rh64 rules.d]# uname -aorm

Linux rh64 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linuxci

系統用戶:it

[root@rh64 rules.d]# id gridasm

uid=400(grid) gid=400(asmadmin) groups=400(asmadmin)


2、建立共享磁盤(能夠採用分區或獨立的磁盤)

[root@rh64 ~]# 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@rh64 ~]# /sbin/scsi_id -g -u -d /dev/sdc

1ATA_VBOX_HARDDISK_VB3d5ccb5e-9c197b67


scsi_id -gud /dev/sdc


磁盤分區:

[root@rh64 ~]# 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

3、創建UDEV規則文件

[root@rh64 ~]# cd /etc/udev/rules.d/

[root@rh64 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@rh64 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"


4、啓動udev service

載入配置文件

[root@rh64 rules.d]# udevadm control --reload-rules

啓動udev service:

[root@rh64 rules.d]# start_udev

Starting udev:

查看asm disks:

[root@rh64 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


--------至此,asm disk建立成功 !

相關文章
相關標籤/搜索