The post provides an example of how to configure partitioned Linux block devices using udev (non-ASMLIB) and assign them to ASM as candidate member disks.
1. This example was performed on an CentOS 6.6 configuration (ASM release 11.2.0.4 – 64-bit):
$ uname -a Linux geeklab 2.6.32-504.el6.x86_64 #1 SMP Tue Sep 16 01:56:35 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.6 (Santiago)
2. Identify the new disk in your Linux configuration:
$ ls -l /dev/xvdv brw-rw---- 1 root disk 202, 5376 Feb 11 21:31 /dev/xvdv
3. Create a new disk partition on it:
# fdisk /dev/xvdv Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel with disk identifier 0xba335ded. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u'). Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-261, default 1): Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-261, default 261): Using default value 261 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
# partprobe
4. Set the new UDEV rules on the new partition (/dev/xvdv1) as follows:
# vi /etc/udev/rules.d/99-oracle-asmdevices.rules KERNEL=="xv*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="360a98000375331796a3f434a55354474", NAME="asmdisk1_udev_p1", ACTION=="add|change", OWNER="grid", GROUP="asmadmin", MODE="0660"
5. Reload and Restart the udev rules:
# udevadm control --reload-rules
# start_udev Starting udev: [ OK ]
NOTE: Running a “start_udev” will cause the network hotplug action to be applied to every interface configuration file on the host which does not have HOTPLUG=no set. This will activate any interface which does not have HOTPLUG=no set, regardless of the ONBOOT setting. If you would like to avoid this then please ensure that each ifcfg file has HOTPLUG=no set.
6. Make sure the new udev partition device is created with the correct ownership (grid & asmadmin) and permissions (brw-rw—-):
# ls -ltr /dev/asm* brw-rw---- 1 grid asmadmin 202, 5377 Feb 11 21:47 /dev/asmdisk1_udev_p1
7. Now you can use it to create a new diskgroup or add it to an existing diskgroup as follows:
# su - grid $ . oraenv ORACLE_SID = [grid] ? +ASM The Oracle base has been set to /u01/app/grid
$ sqlplus "/as sysasm" SQL> show parameter asm_diskstring NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ asm_diskstring string
SQL> alter system set asm_diskstring = '/dev/asmdisk1_udev_p1' scope=both; System altered.
SQL> show parameter asm_diskstring NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ asm_diskstring string /dev/asmdisk1_udev_p1
SQL> select path from v$asm_disk where path like '%udev%'; PATH -------------------------------------------------------------------------------- /dev/asmdisk1_udev_p1
SQL> create diskgroup UDEVDG external redundancy disk '/dev/asmdisk1_udev_p1' ; Diskgroup created.