3 Replies Latest reply: Dec 6, 2012 1:46 PM by Dude! RSS

    RHEL6: udev and ASM


      As I found out, Oracle does not provide the RPM for asmlib any more for RHEL6.

      The alternative is udev: you have to write some rules to get persistent names for your devices, i.e.:

      KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="3600c0ff000112a6d0b0ebf5001000000",NAME+="oracleasm/disks/OCR1", OWNER="grid" GROUP="asmadmin" MODE="0660"

      After the first tests I have some questions:

      * using udev rules with the "NAME+=" option, the device is renamed. For example, /dev/sdc is not available any more if there is a rule that applies for this device. A bit strange, because in /proc/partition it is still listed. Is there a way to have both? The original device (/dev/sdc) and the "newly created" device (for example /dev/oracleasm/disks/OCR1)? I know that you can use SYMLINK but is this supported/recommended?

      * is it recommended to use partitions here? If so, udev does not seem to map / rename partitions but devices only...

      Any feedback is appreciated,

        • 1. Re: RHEL6: udev and ASM
          If you do not have a RHEL subscription and support, why not using Oracle Linux 6 instead, which is free including updates and provides ASMLib support?

          Regarding udev, perhaps it is best to explain it by an example:

          Get the unique device name:
          # /sbin/scsi_id -g -u -d /dev/sdb
          Create 2 partitions /dev/sdb1 and /dev/sdb2 using fdisk or parted, e.g.:
          parted -s /dev/sdb mkpart primary 1MB 1000MB
          parted -s /dev/sdb mkpart primary 1000MB 100%
          # parted -s /dev/sdb print
          Model: ATA VBOX HARDDISK (scsi)
          Disk /dev/sdb: 8590MB
          Sector size (logical/physical): 512B/512B
          Partition Table: msdos
          Number  Start   End     Size    Type     File system  Flags
           1      1049kB  1000MB  999MB   primary
           2      1000MB  8590MB  7590MB  primary
          Create a rule file:
          # vi /etc/udev/rules.d/80-oracleasm.rules
          Enter the following data:
          KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB77dc9e66-e0db83a8", NAME="ORCLASM1", OWNER="oracle", GROUP="dba", MODE="0660"
          Restart UDEV:
          Check the ORACLEASM1 device (/dev/sdb1):
          # ls -l /dev/ORCLASM*
          brw-rw----. 1 oracle dba 8, 17 Dec  6 19:12 ORCLASM1
          Setup and mount /dev/sdb2:
          # mkfs.ext4 /dev/sdb2
          # mkdir /mnt/sdb2
          # mount /dev/sdb2 /mnt/sdb2
          # blkid | grep sdb2
          /dev/sdb2: UUID="c120fb64-02b4-46a0-944a-2ec1b7ab8c18" TYPE="ext4" 
          • 2. Re: RHEL6: udev and ASM

            Oracle Linux will not be an option due to company policy (RH only).

            Thanks for the hint with "$parent" - this way I can use partitioned disks as well (successfully tested).

            Is it recommended to use a partition or is it recommended to use the unpartitioned disk (or does is simply not matter at all)?

            btw, found a good page about this subject: http://www.oracle-base.com/articles/linux/udev-scsi-rules-configuration-in-oracle-linux-5-and-6.php

            Thanks a lot,

            • 3. Re: RHEL6: udev and ASM
              Is it recommended to use a partition or is it recommended to use the unpartitioned disk (or does is simply not matter at all)?
              Apparently it does not matter for ASM as long as the partition is a primary partition.

              As far as I'm aware, ASMLib requires the candidate disks to be partitioned. There is a separate OTN forum for Oracle ASM topics.