create asmdisk


在oracle上有自己的存储解决方案asm,日后asm会慢慢的变成趋势,下面是创建asm磁盘的过程
1.asm相关的rpm包
os:rhel5u4 x86上可能需要下面这些包
(1)oracleasm-support-2.1.4-1.el5.i386.rpm
(2)oracleasmlib-2.0.4-1.el5.i386.rpm
这两个包无论哪个版本的rhel都需要打的,算是公共的包吧,当然据说oracle unbreakable linux不用额外的去oracle.com去下载这些asmlibs相关的包
可能这也是oracle干的一件好事吧。
(3)oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm
(4)oracleasm-2.6.18-164.el5PAE-2.0.5-1.el5.i686.rpm
(5)oracleasm-2.6.18-164.el5debug-2.0.5-1.el5.i686.rpm
(6)oracleasm-2.6.18-164.el5xen-2.0.5-1.el5.i686.rpm
(7)oracleasm-2.6.18-164.el5-debuginfo-2.0.5-1.el5.i686.rpm
其中xen和debug相关的包,也可能环境中并不需要,但我是打上了,遇到依赖性的问题就去补充相应的包,例如kernel-PAE,kernel-debug等等

2.格式化盘
我的环境是虚拟机,分了四块盘给os。/dev/sde,/dev/sdf,/dev/sdg,/dev/sdh
格式化成单个的主分区:(follow this)
[root@r ~]# fdisk /dev/sdf
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won’t be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130):
Using default value 130

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

3.配置ASM环境
[root@r asmlibs]# oracleasm configure -i
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets (‘[]’). Hitting without typing an
answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface []: oracle
Default group to own the driver interface []: oinstall
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done

4.创建ASM磁盘
查看一下asm配置的是否正确
[root@r ~]# lsmod|grep oracleasm
oracleasm 46356 1
[root@rhel5u4test ~]# dmesg|grep oracleasm
ASM: oracleasmfs mounted with options:

创建ASM磁盘
[root@rhel5u4test ~]# /etc/init.d/oracleasm createdisk VOL1 /dev/sde1
Marking disk “VOL1” as an ASM disk: [ OK ]
[root@rhel5u4test ~]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdf1
Marking disk “VOL2” as an ASM disk: [ OK ]
[root@rhel5u4test ~]# /etc/init.d/oracleasm createdisk VOL3 /dev/sdg1
Marking disk “VOL3” as an ASM disk: [ OK ]
[root@rhel5u4test ~]# /etc/init.d/oracleasm createdisk VOL4 /dev/sdh1
Marking disk “VOL4” as an ASM disk: [ OK ]
//查看创建的ASM磁盘信息
[root@rhel5u4test ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4