最近在
redhat AS 4和 redhat 5上面使用裸设备建库,发现者两者的裸设备的配置,不一致。记录一下。
AS 4下:
添加裸设备:
1、 添加原始磁盘
在虚拟机磁盘部分添加即可
2、使用fdisk -l查看磁盘,可以看到一块未分配的磁盘。
[root@RHEL4-32-227 ~]# fdisk -l
Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 6527 52323705 8e Linux LVM
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
3、fdisk /dev/sdb 分区,对于scsi硬盘只能有15个分区,IDE可以有63个
4、fdisk -l
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 98 787153+ 83 Linux
/dev/sdb2 99 172 594405 83 Linux
/dev/sdb3 173 234 498015 83 Linux
/dev/sdb4 235 1305 8602807+ 5 Extended
/dev/sdb5 235 296 497983+ 83 Linux
/dev/sdb6 297 303 56196 83 Linux
/dev/sdb7 304 310 56196 83 Linux
/dev/sdb8 311 335 200781 83 Linux
/dev/sdb9 336 360 200781 83 Linux
/dev/sdb10 361 385 200781 83 Linux
/dev/sdb11 386 410 200781 83 Linux
/dev/sdb12 411 435 200781 83 Linux
/dev/sdb13 436 460 200781 83 Linux
/dev/sdb14 461 704 1959898+ 83 Linux
5、vi /etc/sysconfig/rawdevices修改如下:
加入
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdb2
/dev/raw/raw3 /dev/sdb3
/dev/raw/raw4 /dev/sdb5
/dev/raw/raw5 /dev/sdb6
/dev/raw/raw6 /dev/sdb7
/dev/raw/raw7 /dev/sdb8
/dev/raw/raw8 /dev/sdb9
/dev/raw/raw9 /dev/sdb10
/dev/raw/raw10 /dev/sdb11
/dev/raw/raw11 /dev/sdb12
/dev/raw/raw12 /dev/sdb13
/dev/raw/raw13 /dev/sdb14
6、给与
oracle用户更改裸设备的权限:
chown -R oracle:oinstall /dev/raw
chmod -R 660 /dev/raw
7、把用户权限在启动时给用户
在etc/rc.local文件中添加
chown oracle:oinstall /dev/raw -R
chmod 660 /dev/raw –R
chmod a+x /dev/raw
删除裸设备
#raw /dev/raw/raw1 0 0
#raw /dev/raw/raw2 0 0
查询裸设备
#raw -qa
开启裸设备服务
#chkconfig --list |grep raw
#chkconfig --level 2 raw on
#service rawdevices start
[root@RHEL4-32-227 ~]# raw -qa
/dev/raw/raw1: bound to major 8, minor 17
/dev/raw/raw2: bound to major 8, minor 18
/dev/raw/raw3: bound to major 8, minor 19
/dev/raw/raw4: bound to major 8, minor 21
/dev/raw/raw5: bound to major 8, minor 22
/dev/raw/raw6: bound to major 8, minor 23
/dev/raw/raw7: bound to major 8, minor 24
/dev/raw/raw8: bound to major 8, minor 25
/dev/raw/raw9: bound to major 8, minor 26
/dev/raw/raw10: bound to major 8, minor 27
/dev/raw/raw11: bound to major 8, minor 28
/dev/raw/raw12: bound to major 8, minor 29
/dev/raw/raw13: bound to major 8, minor 30
=====================================
redhat 5下面:
只是第五步不同 ;
vim /etc/udev/rules.d/60-raw.rules
添加如下内容:
ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdb2", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdb3", RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sdb5", RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", KERNEL=="sdb6", RUN+="/bin/raw /dev/raw/raw5 %N"
ACTION=="add", KERNEL=="sdb7", RUN+="/bin/raw /dev/raw/raw6 %N"
ACTION=="add", KERNEL=="sdb8", RUN+="/bin/raw /dev/raw/raw7 %N"
ACTION=="add", KERNEL=="sdb9", RUN+="/bin/raw /dev/raw/raw8 %N"
ACTION=="add", KERNEL=="sdb10", RUN+="/bin/raw /dev/raw/raw9 %N"
ACTION=="add", KERNEL=="sdb11", RUN+="/bin/raw /dev/raw/raw10 %N"
ACTION=="add", KERNEL=="sdb12", RUN+="/bin/raw /dev/raw/raw11 %N"
ACTION=="add", KERNEL=="sdb13", RUN+="/bin/raw /dev/raw/raw12 %N"
ACTION=="add", KERNEL=="sdb14", RUN+="/bin/raw /dev/raw/raw13 %N"
KERNEL=="raw[1-9]", WNER="oracle", GROUP="oinstall", MODE="0660"
修改完成 执行 start_udev即可。
原文地址: http://space.itpub.net/22418990/viewspace-722927