Linux上如何创建裸设备

之前好几个同事聊天的时候,说想自己装个RAC玩玩,怎么的也得两个节点吧,不行就整个虚拟机。VM team的同事干脆就用Oracle VM了。其实个人玩RAC也不是不可能,只要解决几个关键的问题就行了,比如双网卡,共享设备等。其中最关键的就是共享设备了,在一个独立硬盘上创建裸设备,作为OCR和Voting DISK甚至ASM的磁盘,下面就介绍一下,在Linux下面如何创建裸设备,也就是create raw device. 大致这么几个步骤:

1. Check iscsi has been autoenable;
using “/sbin/chkconfig –list|grep iscsi”. If it is enabled, using “/sbin/chkconfig –level 2345 iscsi on” to enable it.
2. using “fdisk -l ” to check the partition information;
“/sbin/fdisk -l /dev/sde”, and then use “fdisk” to create new partitions
3. Create “/etc/udev/devices/raw” directory if it does not exist;
4. Create “/dev/raw” directory if it does not exist;
5. Create new raw device on each node, using:
“mknod /etc/udev/devices/raw/name c 162 2”
And then change the device permissions;
6. Edit “/etc/sysconfig/rawdevices” to add new items referring to new partitions on each node; such as “/etc/udev/devices/raw/name /dev/b_name”;
7. run “/sbin/udevstart” and check whether new raw devices have been generate in “/etc/udev/devices/raw” and “/dev/raw/”;
8. Changt the mode and own of the raw devices under “/dev/” directory;
9. service rawdevices restart

至此,就基本可以了,注意OCR和VD只能建在raw device上
多谢blue_prince指正:其实OCR和VOTING DISK不一定非要在祼设备上面不可,以OCFS或者共享的NFS上面也可以的,只是可靠性不如祼设备那么强而已

This entry was posted in 数据库 and tagged . Bookmark the permalink.

3 Responses to Linux上如何创建裸设备

  1. blue_prince says:

    其实OCR和VOTING DISK不一定非要在祼设备上面不可,以OCFS或者共享的NFS上面也可以的,只是可靠性不如祼设备那么强而已。

  2. ricky.zhu says:

    多谢流云老兄指正,已经修改

  3. blue_prince says:

    嘿嘿,居然还知道我的花名:)

Leave a Reply

Your email address will not be published. Required fields are marked *