User Rating: 0 / 5

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

This article will show to use UDEV instead of ASMLib on Oracle Linux 7.

If for any reason you cannot or don't want to use ASMLib, then you can use UDEV instead. This is an alternative in order to present disks to ASM and this does not required to install an extra layer.

In this article, you'll need ...
... Oracle Linux 7 installed (see oel7 installation here)
... root access is needed

Good to know ...
Oracle recommends to use ASMlib for 11g (see install here) or ASMFD for 12g.
ASM features are licence free except snapshot feature (see licensing information here)

Create disk partitions

This is not mandatory but it is recommended to create at least one partition.

#Create disk partition
[root]$ for disk in sdc sdd sde sdh sdi sdj; do
fdisk /dev/$disk << _EOF_
n
p



w
_EOF_
done

Identify disks

SCSI_ID will be used to identify each disks consistently. On OEL7, SCSI_ID command can be found in /usr/lib/udev/scsi_id.

Two cmd, try the one which works for you  ...
... /usr/lib/udev/scsi_id -g -u -d /dev/sdX
... /usr/lib/udev/scsi_id --page=0x80 --whitelisted --replace-whitespace --device=/dev/sdX

As root, extract id of each disk you will use with asm:

[root]$ /usr/lib/udev/scsi_id -g -u -d /dev/sdc1
    SATA_VBOX_HARDDISK_VB9664741b-88c93566
[root]$ /usr/lib/udev/scsi_id -g -u -d /dev/sdd1
    SATA_VBOX_HARDDISK_VBa95baaba-7f6a13a3
[root]$ /usr/lib/udev/scsi_id -g -u -d /dev/sde1
    SATA_VBOX_HARDDISK_VB32f0066f-086c537d
[root]$ /usr/lib/udev/scsi_id -g -u -d /dev/sdh1
    SATA_VBOX_HARDDISK_VBbc5be7f4-4db0ad83
[root]$ /usr/lib/udev/scsi_id -g -u -d /dev/sdi1
    SATA_VBOX_HARDDISK_VBa7d8987e-e0655c1a
[root]$ /usr/lib/udev/scsi_id -g -u -d /dev/sdj1
    SATA_VBOX_HARDDISK_VB0146a8e5-af298e57

Create UDEV rules

Create or edit /etc/udev/rules.d/99-asm.rules file to add the following rules with the previously extracted id:

KERNEL=="sd?1", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/%k", \
RESULT=="SATA_VBOX_HARDDISK_VB9664741b-88c93566", \
SYMLINK+="oracleasm/disks/ORADATVOL1", OWNER="grid", GROUP="oinstall", MODE="0660"
KERNEL=="sd?1", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/%k", \
RESULT=="SATA_VBOX_HARDDISK_VBa95baaba-7f6a13a3", \
SYMLINK+="oracleasm/disks/ORADATVOL2", OWNER="grid", GROUP="oinstall", MODE="0660"
KERNEL=="sd?1", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/%k", \
RESULT=="SATA_VBOX_HARDDISK_VB32f0066f-086c537d", \
SYMLINK+="oracleasm/disks/ORADATVOL3", OWNER="grid", GROUP="oinstall", MODE="0660"
KERNEL=="sd?1", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/%k", \
RESULT=="SATA_VBOX_HARDDISK_VBbc5be7f4-4db0ad83", \
SYMLINK+="oracleasm/disks/ORAFRAVOL1", OWNER="grid", GROUP="oinstall", MODE="0660"
KERNEL=="sd?1", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/%k", \
RESULT=="SATA_VBOX_HARDDISK_VBa7d8987e-e0655c1a", \
SYMLINK+="oracleasm/disks/ORAFRAVOL2", OWNER="grid", GROUP="oinstall", MODE="0660"
KERNEL=="sd?1", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/%k", \
RESULT=="SATA_VBOX_HARDDISK_VB0146a8e5-af298e57", \
SYMLINK+="oracleasm/disks/ORAFRAVOL3", OWNER="grid", GROUP="oinstall", MODE="0660"

After a reboot, symbolic links should appear as follow:

# List ASM-UDEV disk
[root]$ ls -l /dev/oracleasm/disks/
total 0
lrwxrwxrwx 1 root root 10 Jun  9 00:41 ORADATVOL1 -> ../../sdc1
lrwxrwxrwx 1 root root 10 Jun  9 00:41 ORADATVOL2 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Jun  9 00:41 ORADATVOL3 -> ../../sde1
lrwxrwxrwx 1 root root 10 Jun  9 00:41 ORAFRAVOL1 -> ../../sdh1
lrwxrwxrwx 1 root root 10 Jun  9 00:41 ORAFRAVOL2 -> ../../sdi1
lrwxrwxrwx 1 root root 10 Jun  9 00:41 ORAFRAVOL3 -> ../../sdj1

Theses disks should be now visible by oracle installation when changing the "disk discovery path" to /dev/oracleasm/disks/*.

Please leave comments and suggestions,
Michel.

Reference
UDEV SCSI Rules Configuration for ASM (oracle-base)
Creating ASM disks using udev in RHEL 6.2 (spotdba)

Enjoyed this article? Please like it or share it.

Add comment

Please connect with one of social login below (or fill up name and email)

     


Security code
Refresh