Configure raw or SCSI rule for Redhat, 6
RedHat 4 Raw Configuration
1. modify the configuration file of the bare device service:/etc/sysconfig/rawdevices. Add the following two lines.
Format: bare device name block device name
/Dev/raw/raw1/dev/sdb1
/Dev/raw/raw2/dev/sdb2
2. Set the permission for an oracle user to access a bare device.
Edit udev permission file:/etc/udev/permissions. d/50-udev.permissions
Find the raw device and modify it to the following format:
# Raw Devices
Raw *: oracle: DBA: 0660
Raw/*: oracle: DBA: 0660
3. Check that the bare device service is self-started. Run the command on both nodes.
[Root @ raw1/] # chkconfig -- list rawdevices
Rawdevices 0: off 1: off 2: off 3: On 4: On 5: on 6: Off
4. Start the raw devices service and confirm that the raw device is successfully created. The permission is correct:
[Root @ raw1/] # service rawdevices restart
Assigning devices:
/Dev/raw/raw1 -->/dev/sdb1
/Dev/raw/raw1: bound to major 8, minor 17
/Dev/raw/raw1 -->/dev/sdb2
/Dev/raw/raw1: bound to major 8, minor 18
Done
[Oracle @ raw2 ~] $ CD/dev/raw
[Oracle @ raw2 raw] $ LS-LRT
Total 0
CrW-RW ---- 1 Oracle DBA 162, 1 Feb 28 raw1
CrW-RW ---- 1 Oracle DBA 162, 2 Feb 28 raw2
RedHat 5 raw Configuration
1. Modify the/etc/udev/rules. d/60-raw.rules file.
Action = "add", kernel = "/dev/sdb1", run + = "/bin/raw/dev/raw/raw1% N" Action = "add", ENV {major} = "8", ENV {minor} = "17 ", run + = "/bin/raw/dev/raw/raw1% m" Action = "add", kernel = "/dev/sdc1", run + = "/bin/raw/dev/raw/raw2% N" Action = "add", ENV {major} = "8", ENV {minor} = "33 ", run + = "/bin/raw/dev/raw/raw2% m" Action = "add", kernel = "/dev/sdd1", run + = "/bin/raw/dev/raw/raw3% N" Action = "add", ENV {major} = "8", ENV {minor} = "49 ", run + = "/bin/raw/dev/raw/raw3% m" Action = "add", kernel = "/dev/sde1", run + = "/bin/raw/dev/raw/raw4% N" Action = "add", ENV {major} = "8", ENV {minor} = "65 ", run + = "/bin/raw/dev/raw/raw4% m" Action = "add", kernel = "raw1", owner = "Grid", group = "asmadmin", mode = "0660" Action = "add", kernel = "raw2", owner = "Grid", group = "asmadmin", mode = "0660" Action = "add", kernel = "raw3", owner = "Grid", group = "asmadmin", mode = "0660" Action = "add", kernel = "raw4", owner = "Grid", group = "asmadmin", mode = "0777" |
2. Restart the service:
[Root @ Rac1 ~] # Start_udev
Starting udev: [OK]
3. View raw devices:
[Root @ Rac1 ~] # Ls-LRT/dev/raw
RedHat 5 udev SCSI rules Configuration
1. Obtain the uuid of the disk to be bound to the ASM disk.
#/Sbin/scsi_id-g-u-s/block/SDB SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3 _ |
2. Create/etc/udev/rules. d/99-oracle-asmdevices.rules and add the following content.
Kernel = "SD * 1", bus = "SCSI", program = "/sbin/scsi_id-g-u-s/block/$ parent ", result = "SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3 _", name = "asm-disk1", owner = "oracle", group = "dba", mode = "0660" |
3. Restart the service:
[Root @ Rac1 ~] # Start_udev
Starting udev: [OK]
RedHat 6 udev SCSI rules
1. Edit the/etc/scsi_id.config file. If the file does not exist, create the file and add the following lines:
Options = -- whitelisted -- replace-whitespace |
Note: In my tests, this step can be omitted
2. Obtain the uuid of the disk to be bound to the ASM disk. For example, if we want to use/dev/SDC as the ASM disk, then:
# Scsi_id -- whitelisted -- replace-whitespace -- device =/dev/SDC 1ata_vbox_harddisk_vb36a9e548-1838194a |
Or
#/Sbin/scsi_id-g-u-d/dev/SDB SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3 _ |
3. Create/etc/udev/rules. d/99-oracle-asmdevices.rules and add the following content.
Kernel = "SD * 1", bus = "SCSI", program = "/sbin/scsi_id-g-u-d/dev/$ parent ", result = "SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3 _", name = "asm-disk1", owner = "oracle", group = "dba", mode = "0660" |
Or
Kernel = "DM-*", program = "scsi_id -- page = 0x83 -- whitelisted -- device =/dev/% K", result = "3600c0ff00015c7b70253c0500000000", Owner: = "Grid", group: = "oinstall" Kernel = "DM-*", program = "scsi_id -- page = 0x83 -- whitelisted -- device =/dev/% K", result = "3600c0ff00015c7b72553c0500000000", Owner: = "Grid", group: = "oinstall" Kernel = "DM-*", program = "scsi_id -- page = 0x83 -- whitelisted -- device =/dev/% K", result = "3600c0ff00015c7b77165c0500000000", Owner: = "Grid", group: = "oinstall" Kernel = "DM-*", program = "scsi_id -- page = 0x83 -- whitelisted -- device =/dev/% K", result = "3600c0ff00015c7b73753c0500000000", Owner: = "Grid", group: = "oinstall" Kernel = "DM-*", program = "scsi_id -- page = 0x83 -- whitelisted -- device =/dev/% K", result = "3600c0ff00015c7b78065c0500000000", Owner: = "Grid", group: = "oinstall" |
Or
Kernel = "SD *", bus = "SCSI", program = "/sbin/scsi_id -- whitelisted -- replace-whitespace -- device =/dev/$ name ", result = "3600c0ff00015c7b70253c0500000000", name = "asmocrvote01", owner = "Grid", group = "asmadmin", mode = "0660" Kernel = "SD *", bus = "SCSI", program = "/sbin/scsi_id -- whitelisted -- replace-whitespace -- device =/dev/$ name ", result = "3600c0ff00015c7b77165c0500000000", name = "asmdata01", owner = "Grid", group = "asmadmin", mode = "0660" Kernel = "SD *", bus = "SCSI", program = "/sbin/scsi_id -- whitelisted -- replace-whitespace -- device =/dev/$ name ", result = "3600c0ff00015c7b73753c0500000000", name = "asmdata02", owner = "Grid", group = "asmadmin", mode = "0660" Kernel = "SD *", bus = "SCSI", program = "/sbin/scsi_id -- whitelisted -- replace-whitespace -- device =/dev/$ name ", result = "3600c0ff00015c7b72553c0500000000", name = "asmfra01", owner = "Grid", group = "asmadmin", mode = "0660" |
4. Restart the service:
[Root @ Rac1 ~] # Start_udev
Starting udev: [OK]