티스토리 뷰

※ EMC등 Storage 장비에서 할당 받은 디스크를 RAW Device로 할당하는 방법

 

 

[ RHEL 5 계열 버전에서 RAW Device 정의 ]

 

1. RAW Configration 및 관련 service daemon 의 사용을 위해서 필요한 패키지 확인

 

[root@Test01 ~]#
[root@Test01 ~]#
[root@Test01 ~]# yum provides /etc/sysconfig/rawdevices
Loaded plugins: security
initscripts-8.45.38-2.0.1.el5.x86_64 : The inittab file and the /etc/init.d scripts.
Repo : installed
Matched from:
Other : Provides-match: /etc/sysconfig/rawdevices

 

[root@Test01 ~]#
[root@Test01 ~]#
[root@Test01 ~]# rpm -qa | grep initscripts
initscripts-8.45.38-2.0.1.el5
[root@Test01 ~]#
[root@Test01 ~]#

[root@Test01 ~]# rpm -qf /etc/sysconfig/rawdevices
initscripts-8.45.38-2.0.1.el5
[root@Test01 ~]#
[root@Test01 ~]# rpm -qf /etc/init.d/rawdevices
initscripts-8.45.38-2.0.1.el5
[root@Test01 ~]#
[root@Test01 ~]# chkconfig --list | grep rawdevices
rawdevices 0:해제 1:해제 2:해제 3:활성 4:활성 5:활성 6:해제
[root@Test01 ~]#
[root@Test01 ~]#  

 


2. /etc/sysconfig/rawdevices 에 아래 내역 추가

 

/dev/raw/raw136 /dev/emcpower***
/dev/raw/raw137 /dev/emcpower***
/dev/raw/raw138 /dev/emcpower***
/dev/raw/raw139 /dev/emcpower*** 



3. /etc/sysconfig/rawdevices 선언한 rawdevice를 맵핑 및 확인
 

[root@Test01 ~]#
[root@Test01 ~]# service rawdevices restart
[root@Test01 ~]#

[root@Test01 ~]#
[root@Test01 ~]# service rawdevices status | tail -4
/dev/raw/raw136: bound to major 120, minor 4593
/dev/raw/raw137: bound to major 120, minor 4081
/dev/raw/raw138: bound to major 120, minor 4097
/dev/raw/raw139: bound to major 120, minor 4113
[root@Test01 ~]#

 


4. 생성된 raw device 의 권한 확인 및 oracle 제어 권한 추가

 

[root@Test01 ~]#
[root@Test01 ~]# service rawdevices status | tail -4 | cut -d ":" -f 1 | xargs -i{} ls -l {}
crw-rw---- 1 root disk 162, 132 Dec 13 16:38 /dev/raw/raw136
crw-rw---- 1 root disk 162, 133 Dec 13 16:58 /dev/raw/raw137
crw-rw---- 1 root disk 162, 134 Dec 13 16:58 /dev/raw/raw138
crw-rw---- 1 root disk 162, 135 Dec 13 16:58 /dev/raw/raw139
[root@Test01 ~]#
[root@Test01 ~]#
[root@Test01 ~]# service rawdevices status | tail -4 | cut -d ":" -f 1 | xargs -i{} chown oracle:dba {}
[root@Test01 ~]#
[root@Test01 ~]#
[root@Test01 ~]# service rawdevices status | tail -4 | cut -d ":" -f 1 | xargs -i{} ls -l {}
crw-rw---- 1 oracle dba 162, 132 Dec 13 16:38 /dev/raw/raw136
crw-rw---- 1 oracle dba 162, 133 Dec 13 16:58 /dev/raw/raw137
crw-rw---- 1 oracle dba 162, 134 Dec 13 16:58 /dev/raw/raw138
crw-rw---- 1 oracle dba 162, 135 Dec 13 16:58 /dev/raw/raw139
[root@Test01 ~]#
[root@Test01 ~]#  

 

 

 

 

[ RHEL 6  계열 이상 버전 RAW Device 정의 ]

 

1. RAW 명령 사용을 위한 관련 패키지 확인

 

[root@Test01 ~]#
[root@Test01 ~]# yum provides /bin/raw
Loaded plugins: security
util-linux-2.13-0.52.el5_4.1.x86_64 : A collection of basic system utilities.
Repo : installed
Matched from:
Other : Provides-match: /bin/raw

[root@Test01 ~]#
[root@Test01 ~]# rpm -qa | grep util-linux
util-linux-2.13-0.52.el5_4.1
[root@Test01 ~]#
[root@Test01 ~]#
[root@Test01 ~]#
[root@Test01 ~]#
[root@Test01 ~]# rpm -qf /bin/raw
util-linux-2.13-0.52.el5_4.1
[root@Test01 ~]#
[root@Test01 ~]#  

 

 

2. RAW Device 맵핑작업

 

[root@Test01 ~]# raw /dev/raw/raw1 /dev/emcpower***
[root@Test01 ~]# raw /dev/raw/raw2 /dev/emcpower***
[root@Test01 ~]# raw /dev/raw/raw3 /dev/emcpower***
[root@Test01 ~]# raw /dev/raw/raw4 /dev/emcpower***

[root@Test01 ~]# raw /dev/raw/raw5 /dev/emcpower***

 

 

3. Device Mapping 완료된 raw device에 대한 Major No 및 Minor No 확인

 

[root@Test01 ~]# raw -qa
/dev/raw/raw1: bound to major 247, minor 177
/dev/raw/raw2: bound to major 247, minor 193
/dev/raw/raw3: bound to major 247, minor 209
/dev/raw/raw4: bound to major 247, minor 225
/dev/raw/raw5: bound to major 247, minor 241

 


4. /etc/udev/rules.d/60-raw.rules 이하 아래의 내역 추가

 

ACTION=="add", KERNEL="/dev/sddlmel1" RUN+="raw /dev/raw/raw1 %N"                  
ACTION=="add", KERNEL="/dev/sddlmem1" RUN+="raw /dev/raw/raw2 %N"                  
ACTION=="add", KERNEL="/dev/sddlmen1" RUN+="raw /dev/raw/raw3 %N"                  
ACTION=="add", KERNEL="/dev/sddlmeo1" RUN+="raw /dev/raw/raw4 %N"                  
ACTION=="add", KERNEL="/dev/sddlmep1" RUN+="raw /dev/raw/raw5 %N"                                  
           
ACTION=="add", ENV{MAJOR}="247", ENV{MINOR}="177", RUN+="raw /dev/raw/raw1 %M %m"  
ACTION=="add", ENV{MAJOR}="247", ENV{MINOR}="193", RUN+="raw /dev/raw/raw2 %M %m"  
ACTION=="add", ENV{MAJOR}="247", ENV{MINOR}="209", RUN+="raw /dev/raw/raw3 %M %m"  
ACTION=="add", ENV{MAJOR}="247", ENV{MINOR}="225", RUN+="raw /dev/raw/raw4 %M %m"  
ACTION=="add", ENV{MAJOR}="247", ENV{MINOR}="241", RUN+="raw /dev/raw/raw5 %M %m"  

 

ACTION=="add",KERNEL=="raw*" OWNER="grid",GROUP="dba",MODE="660"

 

 

5. udev mapper 서비스 시작

 

[root@Test01 ~]#
[root@Test01 ~]# start_udev
Starting udev:                                             [  OK  ]
[root@Test01 ~]#
[root@Test01 ~]#  

 


6. 추가된 RAW Device 에 대한 권한 확인

 

[root@Test01 ~]#
[root@Test01 ~]# raw -qa | cut -d ":" -f 1 | xargs -i{} ls -l {}
crw-rw---- 1 grid dba 162, 1 Feb 13 21:07 /dev/raw/raw1
crw-rw---- 1 grid dba 162, 2 Feb 13 21:07 /dev/raw/raw2
crw-rw---- 1 grid dba 162, 3 Feb 13 21:07 /dev/raw/raw3
crw-rw---- 1 grid dba 162, 4 Jan 25 19:51 /dev/raw/raw4
crw-rw---- 1 grid dba 162, 5 Jan 25 19:51 /dev/raw/raw5

[root@Test01 ~]#  

 

 

 

 

 

 

 

 

반응형
반응형
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday