• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How To Create Device Alias For ASM Disks Using mknod On Linux/Unix

by admin

The post provides an example of how to define and associated meaningful device names for Candidate or Member ASM Disks on Linux/Unix using mknod. The example shown below is of a 2 node RAC setup with +ASM1 and +ASM2 instances.

1. We have below mounted on both +ASM1 & +ASM2 instances:

GROUP_NUMBER NAME STATE TYPE TOTAL_MB FREE_MB
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 CRSDG MOUNTED EXTERN 20480 20052
2 DATADG1 MOUNTED EXTERN 102400 77005
3 DATADG2 MOUNTED EXTERN 102400 85268

2. On the +ASM1 instance the diskgroups are mapped to the disks as follow:

GROUP_NUMBER NAME Logical Disk on +ASM1 Physical Disk on +ASM1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 CRSDG CRSDG_0001       /dev/rdisk/disk78
2 DATADG1 DATADG1_0001   /dev/rdisk/disk79
3 DATADG2 DATADG2_0001   /dev/rdisk/disk80

3. On the +ASM2 instance the diskgroups are mapped to the disks as follow:

GROUP_NUMBER NAME Logical Disk on +ASM1 Physical Disk on +ASM1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 CRSDG CRSDG_0001        /dev/rdisk/disk85
2 DATADG1 DATADG1_0001    /dev/rdisk/disk86
3 DATADG2 DATADG2_0001    /dev/rdisk/disk87

4. So the disks mapping on each node is different. This is normal since each node/OS could provide a different disk name (e.g. /dev/rdsk## to access the same physical disk).

5. If you want to have same disks name on all the nodes & ASM instances to access the same physical disks, then you need to create an alias, either mknod devices or symbolic links on the physical disks (e.g. /dev/rdsk##) one each node. For example. assuming you have the next devices on:

Node #1:

crw-rw-€“ 1 root sys 118, 40 Apr 2 15:00 /dev/rdsk/disk78
crw-rw-€“ 1 root sys 118, 0 Apr 2 15:00 /dev/rdsk/disk79
crw-rw-€“ 1 root sys 118, 42 Apr 2 15:00 /dev/rdsk/disk80

Create the alias:

# mkdir /asmdisks
# chown oracle:dba  /asmdisks
# cd /asmdisks
# mknod asmdisk1 c 118 40
# mknod asmdisk2 c 118 0
# mknod asmdisk3 c 118 42

Then you will have the next alias devices:

/asmdisks/asmdisk1 
/asmdisks/asmdisk2 
/asmdisks/asmdisk3

You will need to set the correct ownership:

# chown oracle:dba /asmdisks/asmdisk1
# chown oracle:dba /asmdisks/asmdisk2
# chown oracle:dba /asmdisks/asmdisk3

Node #2:

crw-rw-€“ 1 root sys 118, 40 Apr 2 15:00 /dev/rdsk/disk78
crw-rw-€“ 1 root sys 118, 0 Apr 2 15:00 /dev/rdsk/disk79
crw-rw-€“ 1 root sys 118, 42 Apr 2 15:00 /dev/rdsk/disk80

Create the alias:

# mkdir /asmdisks
# chown oracle:dba /asmdisks
# cd /asmdisks
# mknod asmdisk1 c 118 46
# mknod asmdisk2 c 118 49
# mknod asmdisk3 c 118 15

Then you will have the next alias devices:

/asmdisks/asmdisk1 
/asmdisks/asmdisk2 
/asmdisks/asmdisk3

You will need to set the correct ownership:

# chown oracle:dba /asmdisks/asmdisk1
# chown oracle:dba /asmdisks/asmdisk2
# chown oracle:dba /asmdisks/asmdisk3

6. Then update the asm_diskstring pointing to the new alias devices one both ASM instances:

+ASM1 instance:

SQL> alter system set asm_diskstring = '/asmdisks/asmdisk*' scope=spfile;

+ASM2 instance:

SQL> alter system set asm_diskstring = '/asmdisks/asmdisk*' scope=spfile;

7. Then the next time you restart the ASM instances, they will access the physical disks using the alias located at ‘/asmdisks/asmdisk*’ on each node.

NOTE: “mknod” alignments will not be persistent across the reboots, either use udev rules or add the list of “mknod” commands used to create the aliases as a startup script in the init, also it should get loaded before the CRS starts.

Filed Under: ASM, oracle

Some more articles you might also be interested in …

  1. Oracle sql script to report the list of files stored in ASM and CURRENTLY NOT OPENED
  2. Understanding the Global Resource Management Concepts in Oracle RAC
  3. CRSCTL Command Examples in ASM Standalone Configurations
  4. Oracle Database: Redo log operations (Add/Drop/Change Location)
  5. ORA-30012 Database Does Not Start With UNDO_MANAGEMENT=AUTO – Oracle Database 11gr2
  6. Oracle Golden gate GGSCI commands quick reference (Cheat Sheet)
  7. Basic SELECT Statement in PL/SQL
  8. Access Control List(ACL) in Oracle 11G
  9. How to Offline a PDB Datafile in NOARCHIVELOG mode CDB which is not Open in Read Write
  10. Oracle RMAN 12c – New Features

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright