In linux Oracle's ASMLib is used to provide device persistence and ownership after a reboot. UDEV is an alternative to ASMlib to provide device persistence and ownership on devices. This article outlines the steps that are required to establish device persistence and setup new device names with desired permissions and ownership in REDHAT6.1 using udev.
Universally Unique Identifiers (UUIDs) are a standardized method for identifying computers and devices in distributed computing environments. This section uses UUIDs to identify iSCSI, SRP, or Fibre Channel LUNs. UUIDs persist after restarts, disconnection and device swaps. The UUID is similar to a label on the device.
<br data-mce-bogus="1"> [root@dbsl2001 etc]# cat redhat-release <strong>Red Hat Enterprise Linux Server release 6.1 (Santiago)</strong>
Single path configuration
/etc/scsi_id.config
file.
Verify the UUID output from the:
scsi_id –whitelisted –replace-whitespace –device=/dev/sd*
command is correct and as expected.
Create a rule to name the device.
Create a file named 20-names.rules in the:
/etc/udev/rules.d directory.
Add new rules to this file. All rules are added to the same file using the same format. Rules follow this format:
KERNEL==”sd*”, SUBSYSTEM==”block”, PROGRAM=”/sbin/scsi_id –whitelisted –replace-whitespace /dev/$name”, RESULT==”UUID”, NAME=”devicename”,OWNER=”<OS user>”, GROUP=”,OS group>”, MODE=”0660?
Replace UUID and devicename with the UUID retrieved above, and a name for the device. This is an example for the rule above for three example iSCSI luns:
KERNEL==”sd*”, SUBSYSTEM==”block”, PROGRAM=”/sbin/scsi_id –whitelisted –replace-whitespace /dev/$name”, RESULT==”14f504e46494c45525971777468462d5a3277382d42727976″, NAME=”asm1″,OWNER=”grid”,GROUP=”dba”,MODE=”0660″
[root@dbsl2001 rules.d]# udevadm test /block/sdd
[root@dbsl2001 rules.d]# start_udev
Starting udev: [ OK ]
Check the names, ownerships and permissions of the devices.
[root@dbsl2001 rules.d]# ls -la /dev/asm*
brw-rw—-. 1 grid disk 8, 49 Sep 5 00:20 /dev/asm1