If you want to install Oracle software in Linux and create a database using bare devices, lvcreate will not create character devices for us, this article mainly discusses how to create character devices for logical volumes. The operating system uses rhel6u4 64bit
$ Uname-
Linux oracle11.cc 2.6.32-358. el6.x86 _ 64 #1 SMP Tue Jan 29 11:47:41 est 2013 x86_64 x86_64 x86_64 GNU/Linux
How to Create a logical volume is skipped. Let's take a look at the logical volumes in my current system.
$ LS-L/dev/vg00/* m
Lrwxrwxrwx 1 Root 7 Jul 5/dev/vg00/control1_16m-> ../dm-9
Lrwxrwxrwx 1 Root 8 Jul 5/dev/vg00/control2_16m-> ../dm-10
Lrwxrwxrwx 1 Root 8 Jul 5/dev/vg00/redo1_128m-> ../dm-11
Lrwxrwxrwx 1 Root 8 Jul 5/dev/vg00/redo2_128m-> ../dm-12
Lrwxrwxrwx 1 Root 8 Jul 5/dev/vg00/redo3_128m-> ../dm-13
Lrwxrwxrwx 1 Root 8 Jul 5/dev/vg00/spfile_16m-> ../dm-14
Lrwxrwxrwx 1 Root 7 Jul 5/dev/vg00/sysaux_1024m-> ../dm-5
Lrwxrwxrwx 1 Root 7 Jul 5/dev/vg00/system_1024m-> ../dm-4
Lrwxrwxrwx 1 Root 7 Jul 5/dev/vg00/temp_512m-> ../dm-6
Lrwxrwxrwx 1 Root 7 Jul 5/dev/vg00/undo_512m-> ../dm-7
Lrwxrwxrwx 1 Root 7 Jul 5/dev/vg00/user_16m-> ../dm-8
Use udev to map block device files into character Device Files
If you can use the/etc/sysconfig/rawdevices file write ing in rhel5, it is convenient. But this is not found in rhel6. Let's take a look at how to map them using udev.
First, find the major and minor of the block device.
Because the files in the/dev/vg00 directory are soft connections, you need to directly view the corresponding block device files.
# ID Root
Uid = 0 (Root) gid = 0 (Root) groups = 0 (Root)
# Ls-L/dev/DM-{4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}
BRW-RW ---- 1 root disk 253, 10 Jul 5/dev/dm-10
BRW-RW ---- 1 root disk 253, 11 Jul 5/dev/dm-11
BRW-RW ---- 1 root disk 253, 12 Jul 5/dev/dm-12
BRW-RW ---- 1 root disk 253, 13 Jul 5/dev/dm-13
BRW-RW ---- 1 Oracle DBA 253, 14 Jul 5/dev/dm-14
BRW-RW ---- 1 root disk 253, 4 Jul 5/dev/dm-4
BRW-RW ---- 1 root disk 253, 5 Jul 5/dev/dm-5
BRW-RW ---- 1 root disk 253, 6 Jul 5/dev/dm-6
BRW-RW ---- 1 root disk 253, 7 Jul 5/dev/dm-7
BRW-RW ---- 1 root disk 253, 8 Jul 5/dev/dm-8
BRW-RW ---- 1 root disk 253, 9 Jul 5/dev/dm-9
The Fifth Column is Major, the sixth column is minor, for example, the major of/dev/dm-0 is 253, and the minor is 0.
How are these two parameters used?
Use the following method to open the rule file. The example is all in it.
# Vi/etc/udev/rules. d/60-raw.rules
(I indent the original 60-raw.rules)
# Enter raw device bindings here.
#
# An example wocould be:
# Action = "add", kernel = "SDA", run + = "/bin/raw/dev/raw/raw1% N"
# To bind/dev/raw/raw1 to/dev/SDA, or
# Action = "add", ENV {major} = "8", ENV {minor} = "1 ", run + = "/bin/raw/dev/raw/raw2% m"
# To bind/dev/raw/raw2 to the device with major 8, minor 1.
As mentioned in the example, there are two ways to write raw ing. The first is what will be used in this article. The second one can be understood at a glance.
The writing method is relatively fixed, for example:
Action = "add", ENV {major} = "253", ENV {minor} = "4 ", run + = "/bin/raw/dev/raw/raw1% m"
Action = "add", ENV {major} = "253", ENV {minor} = "5 ", run + = "/bin/raw/dev/raw/raw2% m"
Action = "add", ENV {major} = "253", ENV {minor} = "6 ", run + = "/bin/raw/dev/raw/raw3% m"
Action = "add", ENV {major} = "253", ENV {minor} = "7 ", run + = "/bin/raw/dev/raw/raw4% m"
Action = "add", ENV {major} = "253", ENV {minor} = "8 ", run + = "/bin/raw/dev/raw/raw5% m"
Action = "add", ENV {major} = "253", ENV {minor} = "9 ", run + = "/bin/raw/dev/raw/raw6% m"
Action = "add", ENV {major} = "253", ENV {minor} = "10 ", run + = "/bin/raw/dev/raw/raw7% m"
Action = "add", ENV {major} = "253", ENV {minor} = "11 ", run + = "/bin/raw/dev/raw/raw8% m"
Action = "add", ENV {major} = "253", ENV {minor} = "12 ", run + = "/bin/raw/dev/raw/raw9% m"
Action = "add", ENV {major} = "253", ENV {minor} = "13 ", run + = "/bin/raw/dev/raw/raw10% m"
Action = "add", ENV {major} = "253", ENV {minor} = "14 ", run + = "/bin/raw/dev/raw/raw11% m"
# Start_udev
Starting udev: [OK]
Check and find that the bare device has already appeared, but the permission is still root. You need to add the authorization statement in 60-raw.rules.
# Ls-L/dev/raw
Total 0
CrW-RW ---- 1 root disk 162, 1 Jul 6 raw1
CrW-RW ---- 1 root disk 162, 10 Jul 6 raw10
CrW-RW ---- 1 root disk 162, 11 Jul 6 raw11
CrW-RW ---- 1 root disk 162, 2 Jul 6 raw2
CrW-RW ---- 1 root disk 162, 3 Jul 6 raw3
CrW-RW ---- 1 root disk 162, 4 Jul 6 raw4
CrW-RW ---- 1 root disk 162, 5 Jul 6 raw5
CrW-RW ---- 1 root disk 162, 6 Jul 6 raw6
CrW-RW ---- 1 root disk 162, 7 Jul 6 raw7
CrW-RW ---- 1 root disk 162, 8 Jul 6 raw8
CrW-RW ---- 1 root disk 162, 9 Jul 6 raw9
CrW-RW ---- 1 root disk 162, 0 Jul 6 rawctl
Add authorization statement
Kernel = "Raw [0-9] *", name = "raw/% K" owner = "oracle" group = "dba", mode = "0660"
# Star_udev
# Ll/dev/raw
Total 0
CrW-RW ---- 1 Oracle DBA 162, 1 Jul 6 raw1
CrW-RW ---- 1 Oracle DBA 162, 10 Jul 6 raw10
CrW-RW ---- 1 Oracle DBA 162, 11 Jul 6 raw11
CrW-RW ---- 1 Oracle DBA 162, 2 Jul 6 raw2
CrW-RW ---- 1 Oracle DBA 162, 3 Jul 6 raw3
CrW-RW ---- 1 Oracle DBA 162, 4 Jul 6 raw4
CrW-RW ---- 1 Oracle DBA 162, 5 Jul 6 raw5
CrW-RW ---- 1 Oracle DBA 162, 6 Jul 6 raw6
CrW-RW ---- 1 Oracle DBA 162, 7 Jul 6 raw7
CrW-RW ---- 1 Oracle DBA 162, 8 Jul 6 raw8
CrW-RW ---- 1 Oracle DBA 162, 9 Jul 6 raw9
CrW-RW ---- 1 root disk 162, 0 Jul 6 rawctl
#
# Raw-Qa
/Dev/raw/raw1: boundto major 253, minor 4
/Dev/raw/raw2: boundto major 253, minor 5
/Dev/raw/raw3: bound to major 253, minor 6
/Dev/raw/raw4: bound to major 253, minor 7
/Dev/raw/raw5: bound to major 253, minor 8
/Dev/raw/raw6: bound to major 253, minor 9
/Dev/raw/raw7: boundto major 253, minor 10
/Dev/raw/raw8: bound to major 253, minor 11
/Dev/raw/raw9: boundto major 253, minor 12
/Dev/raw/raw10: bound to major 253, minor 13
/Dev/raw/raw11: bound to major 253, minor 14
Http://blog.itpub.net/23135684/viewspace-696799/
Http://www.dswcomputersystems.co.uk/howtos-2/informix-howtos/configuring-raw-disks-on-rhel-6/