Bindings for bare devices under the Linux platform:

Source: Internet
Author: User

Bindings for bare devices under the Linux platform:

using raw bindings
Method one raw configuration (1)

[Email protected] mapper]# cat/etc/rc.local

#!/bin/sh

#

# This script is executed *after* all theother init scripts.

# can put your own initialization stuff inhere if you don ' t

# want to does the full Sys V style init stuff.

Touch/var/lock/subsys/local

#####

# Oracle Cluster Voting disks

#####

Chown oracle:oinstall/dev/mapper/voting*

chmod 660/dev/mapper/voting*

Raw/dev/raw/raw5/dev/mapper/votingdiskp1

Raw/dev/raw/raw6/dev/mapper/votingdiskp2

Raw/dev/raw/raw7/dev/mapper/votingdiskp3

Raw/dev/raw/raw8/dev/mapper/votingdiskp4

#sleep 2

Chown oracle:oinstall/dev/raw/raw5

Chown ORACLE:OINSTALL/DEV/RAW/RAW6

Chown Oracle:oinstall/dev/raw/raw7

Chown Oracle:oinstall/dev/raw/raw8

chmod 660/dev/raw/raw5

chmod 660/dev/raw/raw6

chmod 660/dev/raw/raw7

chmod 660/dev/raw/raw8

Method One (2)

[Email protected] raw]# vi/etc/rc.local

#!/bin/sh

#

# This script is executed *after* all theother init scripts.

# can put your own initialization stuff inhere if you don ' t

# want to does the full Sys V style init stuff.

Touch/var/lock/subsys/local

Chown-r oracle:oinstall/dev/raw/raw*

Chmod-r 660/dev/raw/raw*

~

(1) Edit the rawdevices configuration file:

[Email protected] sysconfig]# pwd

/etc/sysconfig

[Email protected] sysconfig]# VI rawdevices

# RW Device Bindings

# format: <rawdev> <major> <minor>

# <rawdev> <blockdev>

# Example:/dev/raw/raw1/dev/sda1

#/DEV/RAW/RAW2 8 5

#--join? Binding entries for bare devices and block devices:

/dev/raw/raw1/dev/sdb1

/dev/raw/raw2/dev/sdc1

/dev/raw/raw3/dev/sdd1

/dev/raw/raw4/dev/sde1

(2) Start rawdevices service:

Service Rawdevices Start

(3) When the configuration system starts, self-initiated rawdevices service:

Chkconfig rawdevices on

(4) Confirm that the Rawdevices service is successfully started and that the bare device is created correctly. Check the status of the Rawdevices service first:

Service Rawdevicesstatus

[[Email protected] sysconfig]# service rawdevices status

/dev/raw/raw1:bound to Major 8, minor 17

/dev/raw/raw2:bound to Major 8, minor 33

/dev/raw/raw3:bound to Major 8, minor 49

/dev/raw/raw4:bound to Major 8, minor 65

To view the bare device again:

[Email protected] sysconfig]# Cd/dev/raw

[email protected] raw]# LL

Total 0

CRW-RW----1 Oracle Oinstall 162, 1 May 15:03RAW1

CRW-RW----1 Oracle Oinstall 162, 2 May 15:35RAW2

CRW-RW----1 Oracle Oinstall 162, 3 May 15:35RAW3

CRW-RW----1 Oracle Oinstall 162, 4 May 15:35RAW4

[Email protected] raw]#

(5) ASM is performed as an Oracle user, and to enable ASM to discover these devices, the owner of these devices must be changed:

[Email protected] raw]# chown oracle:oinstall/dev/raw/raw*

[email protected] raw]# LL

Total 0

CRW-RW----1 Oracle Oinstall 162, 1 May 15:03RAW1

CRW-RW----1 Oracle Oinstall 162, 2 May 15:37RAW2

CRW-RW----1 Oracle Oinstall 162, 3 May 15:37RAW3

CRW-RW----1 Oracle Oinstall 162, 4 May 15:37RAW4

method Two uses the UDEV device bindings:

Change/etc/udev/rules.d/60-raw.rules file

# Now that we know the/DEV/SDB1 to RAW1, can we add it to the/etc/udev/rules.d/60-raw.rules file? For example, the following:

[Email protected]~] #vi/etc/udev/rules.d/60-raw.rules

Cat >>/etc/udev/rules.d/60-raw.rules<< EOF

action== "Add", kernel== "sdb1", run+= "/bin/raw/dev/raw/raw1%N"

action== "Add", kernel== "SDC1", run+= "/bin/raw/dev/raw/raw2%N"

action== "Add", kernel== "Sdd1", run+= "/bin/raw/dev/raw/raw3%N"

action== "Add", kernel== "Sde1", run+= "/bin/raw/dev/raw/raw4%N"

action== "Add", kernel== "Raw[1-5", owner= "Oracle", group= "Oinstall", mode= "660"

Eof

Restart the Udev service:

[Email protected] ~]# Start_udev

[Email protected] asmfileapp-linux5.4]# ls-lat/dev/raw/raw*

CRW-RW----1 Oracle Oinstall 162, 4 APR 00:49/DEV/RAW/RAW4

CRW-RW----1 Oracle Oinstall 162, 3 APR 00:49/DEV/RAW/RAW3

CRW-RW----1 Oracle Oinstall 162, 2 APR 00:49/dev/raw/raw2

CRW-RW----1 Oracle Oinstall 162, 1 APR 00:49/dev/raw/raw1

Bindings for bare devices under the Linux platform:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.