Guenadi N Jilevski's Oracle BLOG

Oracle RAC, DG, EBS, DR and HA DBA BLOG

UDEV rules for device persistency and permissions/ownerships in OEL6/REDHAT 6 for ASM

UDEV rules for device persistency and permissions/ownerships in OEL6/REDHAT 6 for ASM

ASMlib is used to ensure device persistency after a reboot and makes sure that devices retain their access permissions and ownership that are established during ASMib configuration. UDEV is another alternative to ASMlib to achieve device persistency and to set permissions/ownership (OS chown user:group / chmod ) on devices. The article outlines the steps that are required to establish device persistency and setup new device names with desired permissions and ownership in OEL6/REDHAT6 using udev.

  1. Add the following line to /etc/scsi_id.config file.

    [root@oel1 dev]# cat /etc/scsi_id.config

    options=–whitelisted –replace-whitespace

    [root@oel1 dev]#

This sets the default options for scsi_id, making sure that returned UUIDs contains no spaces. The target otherwise returns spaces in UUIDs, which can cause problems.

  1. To display the UUID for a given device run the scsi_id –whitelisted –replace-whitespace –device=/dev/sd* command. For example:

    [root@oel1 dev]# scsi_id –whitelisted –replace-whitespace –device=/dev/sdb1

    1ATA_VBOX_HARDDISK_VB86a7d306-686f04a8

    [root@oel1 dev]# scsi_id –whitelisted –replace-whitespace –device=/dev/sdc1

    1ATA_VBOX_HARDDISK_VB021b64b5-d0167900

    [root@oel1 dev]# scsi_id –whitelisted –replace-whitespace –device=/dev/sdd1

    1ATA_VBOX_HARDDISK_VBfa5180c4-766a235a

    [root@oel1 dev]# scsi_id –whitelisted –replace-whitespace –device=/dev/sde1

    1ATA_VBOX_HARDDISK_VB57da3b54-56bfbb23

    [root@oel1 dev]# scsi_id –whitelisted –replace-whitespace –device=/dev/sdf1

    1ATA_VBOX_HARDDISK_VB006b6d5b-4cc25a0e

    [root@oel1 dev]#

The output in these examples displays the UUID of the device /dev/sdb1. /dev/sdc1, /dev/sdd1, /dev/sde1 and /dev/sdf1.
Check if the output is correct and as expected.

  1. Create a rule to set the permissions and ownership for the device. This rule will also set a name for the device. For each of the devices we will create one rule. For OEL6/REDHAT6 create a file /etc/udev/rules.d/99-oracle-asmdevices.rules containing the rules for each device. The rule will be as follows:

    KERNEL==”sd*1″ SUBSYSTEM==”block”, PROGRAM=”/sbin/scsi_id –whitelisted –replace-whitespace /dev/$name”, RESULT==””, NAME=””, OWNER=””, GROUP=”,OS group>”, MODE=”0660″

    1. Here I substitute the UUID with the value returned from step 1.
    2. NAME points to a new name that the device will be known. That is the. device will be accessed using the name specified with NAME parameter.
    3. OWNER is used to set the OS user.
    4. GROUP is used to set the OS group.
    5. MODE set the permissions.

    For /dev/sdb1 the rule will be as follows where NAME is asmsdb1, owner is OS grid user, group is OS asmadmin group and permission is 0660. UUID is ==”1ATA_VBOX_HARDDISK_VB86a7d306-686f04a8″ as extracted from step 1.

    KERNEL==”sd*1″ SUBSYSTEM==”block”, PROGRAM=”/sbin/scsi_id –whitelisted –replace-whitespace /dev/$name”, RESULT==”1ATA_VBOX_HARDDISK_VB86a7d306-686f04a8″, NAME=”asmsdb1″, OWNER=”grid”, GROUP=”asmadmin”, MODE=”0660″

    The content of/etc/udev/rules.d/99-oracle-asmdevices.rules file is as follows.

    [root@oel2 rules.d]# cat 99-oracle-asmdevices.rules

    KERNEL==”sd*1″ SUBSYSTEM==”block”, PROGRAM=”/sbin/scsi_id –whitelisted –replace-whitespace /dev/$name”, RESULT==”1ATA_VBOX_HARDDISK_VB86a7d306-686f04a8″, NAME=”asmsdb1″, OWNER=”grid”, GROUP=”asmadmin”, MODE=”0660″

    KERNEL==”sd*1″ SUBSYSTEM==”block”, PROGRAM=”/sbin/scsi_id –whitelisted –replace-whitespace /dev/$name”, RESULT==”1ATA_VBOX_HARDDISK_VB021b64b5-d0167900″, NAME=”asmsdc1″, OWNER=”grid”, GROUP=”asmadmin”, MODE=”0660″

    KERNEL==”sd*1″ SUBSYSTEM==”block”, PROGRAM=”/sbin/scsi_id –whitelisted –replace-whitespace /dev/$name”, RESULT==”1ATA_VBOX_HARDDISK_VBfa5180c4-766a235a”, NAME=”asmsdd1″, OWNER=”grid”, GROUP=”asmadmin”, MODE=”0660″

    KERNEL==”sd*1″ SUBSYSTEM==”block”, PROGRAM=”/sbin/scsi_id –whitelisted –replace-whitespace /dev/$name”, RESULT==”1ATA_VBOX_HARDDISK_VB57da3b54-56bfbb23″, NAME=”asmsde1″, OWNER=”grid”, GROUP=”asmadmin”, MODE=”0660″

    KERNEL==”sd*1″ SUBSYSTEM==”block”, PROGRAM=”/sbin/scsi_id –whitelisted –replace-whitespace /dev/$name”, RESULT==”1ATA_VBOX_HARDDISK_VB006b6d5b-4cc25a0e”, NAME=”asmsdf1″, OWNER=”grid”, GROUP=”asmadmin”, MODE=”0660″

    [root@oel2 rules.d]#

  1. Load the device partition tables

    /sbin/partprobe /dev/sdb1

    /sbin/partprobe /dev/sdc1

    /sbin/partprobe /dev/sdd1

    /sbin/partprobe /dev/sde1

    /sbin/partprobe /dev/sde1

  2. Test that the rules are correct

    udevadm test /dev/sdb1

    udevadm test /dev/sdc1

    udevadm test /dev/sdd1

    udevadm test /dev/sde1

    udevadm test /dev/sdf1

  1. The output will be similar the output I got

[root@oel1 dev]# udevadm test /block/sdc

run_command: calling: test

udevadm_test: version 147

This program is for debugging only, it does not run any program,

specified by a RUN key. It may show incorrect results, because

some values may be different, or not available at a simulation run.

parse_file: reading ‘/lib/udev/rules.d/10-console.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/10-dm.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/11-dm-lvm.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/13-dm-disk.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/20-names.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/40-hplip.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/40-isdn.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/40-libgphoto2.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/40-multipath.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/40-redhat.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/40-usb-media-players.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/50-firmware.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/50-udev-default.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/51-dlm.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/56-hpmud_support.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/60-cdrom_id.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/60-fprint-autosuspend.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/60-libmtp.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/60-net.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/60-pcmcia.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/60-persistent-alsa.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/60-persistent-input.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/60-persistent-serial.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/60-persistent-storage-tape.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/60-persistent-storage.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/60-persistent-v4l.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/60-raw.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/60-vboxadd.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/61-gnome-bluetooth-rfkill.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/61-mobile-action.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/61-option-modem-modeswitch.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/61-persistent-storage-edd.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/64-device-mapper.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/64-md-raid.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/65-libsane.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/65-md-incremental.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/69-pilot-link.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/70-acl.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/70-anaconda.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/70-cups-libusb.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/70-hid2hci.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/70-persistent-cd.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/70-persistent-net.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/70-printers.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/75-cd-aliases-generator.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/75-net-description.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/75-persistent-net-generator.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/75-tty-description.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/77-mm-ericsson-mbm.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/77-mm-longcheer-port-types.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/77-mm-pcmcia-device-blacklist.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/77-mm-platform-serial-whitelist.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/77-mm-simtech-port-types.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/77-mm-usb-device-blacklist.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/77-mm-zte-port-types.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/77-nm-olpc-mesh.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/78-sound-card.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/79-fstab_import.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/80-drivers.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/80-kvm.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/80-udisks.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/85-pcscd_ccid.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/85-regulatory.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/85-usbmuxd.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/88-clock.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/90-alsa.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/90-hal.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/90-pulseaudio.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/90-rdma.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/91-drm-modeset.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/95-devkit-power-battery-recall-dell.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/95-devkit-power-battery-recall-fujitsu.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/95-devkit-power-battery-recall-gateway.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/95-devkit-power-battery-recall-ibm.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/95-devkit-power-battery-recall-lenovo.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/95-devkit-power-battery-recall-toshiba.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/95-devkit-power-csr.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/95-devkit-power-hid.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/95-devkit-power-wup.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/95-dm-notify.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/95-keymap.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/95-udev-late.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/97-bluetooth-serial.rules’ as rules file

parse_file: reading ‘/lib/udev/rules.d/97-bluetooth.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/98-kexec.rules’ as rules file

parse_file: reading ‘/etc/udev/rules.d/99-fuse.rules’ as rules file

parse_file: reading ‘/dev/.udev/rules.d/99-root.rules’ as rules file

udev_rules_new: rules use 183972 bytes tokens (15331 * 12 bytes), 34902 bytes buffer

udev_rules_new: temporary index used 57900 bytes (2895 * 20 bytes)

udev_device_new_from_syspath: device 0x13c9140 has devpath ‘/devices/pci0000:00/0000:00:0d.0/host4/target4:0:0/4:0:0:0/block/sdc’

udev_device_new_from_syspath: device 0x13d8bd0 has devpath ‘/devices/pci0000:00/0000:00:0d.0/host4/target4:0:0/4:0:0:0/block/sdc’

udev_device_read_db: device 0x13d8bd0 filled with db file data

udev_rules_apply_to_event: PROGRAM ‘/sbin/scsi_id –whitelisted –replace-whitespace /dev/sdc’ /etc/udev/rules.d/20-names.rules:3

util_run_program: ‘/sbin/scsi_id –whitelisted –replace-whitespace /dev/sdc’ started

util_run_program: ‘/sbin/scsi_id’ (stdout) ’1ATA_VBOX_HARDDISK_VB021b64b5-d0167900′

util_run_program: ‘/sbin/scsi_id –whitelisted –replace-whitespace /dev/sdc’ returned with exitcode 0

udev_rules_apply_to_event: OWNER 1100 /etc/udev/rules.d/20-names.rules:3

udev_rules_apply_to_event: GROUP 1020 /etc/udev/rules.d/20-names.rules:3

udev_rules_apply_to_event: MODE 0660 /etc/udev/rules.d/20-names.rules:3

udev_rules_apply_to_event: NAME ‘asmsdc1′ /etc/udev/rules.d/20-names.rules:3

udev_rules_apply_to_event: PROGRAM ‘/sbin/multipath -c /dev/sdc’ /lib/udev/rules.d/40-multipath.rules:11

util_run_program: ‘/sbin/multipath -c /dev/sdc’ started

util_run_program: ‘/sbin/multipath’ (stdout) ‘May 08 10:45:22 | /etc/multipath.conf does not exist, blacklisting all devices.’

util_run_program: ‘/sbin/multipath’ (stdout) ‘May 08 10:45:22 | A sample multipath.conf file is located at’

util_run_program: ‘/sbin/multipath’ (stdout) ‘May 08 10:45:22 | /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf’

util_run_program: ‘/sbin/multipath’ (stdout) ‘May 08 10:45:22 | You can run /sbin/mpathconf to create or modify /etc/multipath.conf’

util_run_program: ‘/sbin/multipath’ (stdout) ‘May 08 10:45:22 | DM multipath kernel driver not loaded’

util_run_program: ‘/sbin/multipath -c /dev/sdc’ returned with exitcode 1

udev_rules_apply_to_event: RUN ‘socket:/org/kernel/dm/multipath_event’ /lib/udev/rules.d/40-multipath.rules:16

udev_device_new_from_syspath: device 0x13db6d0 has devpath ‘/devices/pci0000:00/0000:00:0d.0/host4/target4:0:0/4:0:0:0′

udev_device_new_from_syspath: device 0x13dba00 has devpath ‘/devices/pci0000:00/0000:00:0d.0/host4/target4:0:0′

udev_device_new_from_syspath: device 0x13dbd10 has devpath ‘/devices/pci0000:00/0000:00:0d.0/host4′

udev_device_new_from_syspath: device 0x13dc010 has devpath ‘/devices/pci0000:00/0000:00:0d.0′

udev_device_new_from_syspath: device 0x13dc300 has devpath ‘/devices/pci0000:00′

udev_rules_apply_to_event: LINK ‘block/8:32′ /lib/udev/rules.d/50-udev-default.rules:3

udev_rules_apply_to_event: GROUP 6 /lib/udev/rules.d/50-udev-default.rules:76

udev_rules_apply_to_event: IMPORT ‘ata_id –export /dev/sdc’ /lib/udev/rules.d/60-persistent-storage.rules:39

util_run_program: ‘ata_id –export /dev/sdc’ started

util_run_program: ‘/lib/udev/ata_id’ (stdout) ‘ID_ATA=1′

util_run_program: ‘/lib/udev/ata_id’ (stdout) ‘ID_TYPE=disk’

util_run_program: ‘/lib/udev/ata_id’ (stdout) ‘ID_BUS=ata’

util_run_program: ‘/lib/udev/ata_id’ (stdout) ‘ID_MODEL=VBOX_HARDDISK’

util_run_program: ‘/lib/udev/ata_id’ (stdout) ‘ID_MODEL_ENC=VBOX\x20HARDDISK\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20′

util_run_program: ‘/lib/udev/ata_id’ (stdout) ‘ID_REVISION=1.0′

util_run_program: ‘/lib/udev/ata_id’ (stdout) ‘ID_SERIAL=VBOX_HARDDISK_VB021b64b5-d0167900′

util_run_program: ‘/lib/udev/ata_id’ (stdout) ‘ID_SERIAL_SHORT=VB021b64b5-d0167900′

util_run_program: ‘/lib/udev/ata_id’ (stdout) ‘ID_ATA_WRITE_CACHE=1′

util_run_program: ‘/lib/udev/ata_id’ (stdout) ‘ID_ATA_WRITE_CACHE_ENABLED=1′

util_run_program: ‘/lib/udev/ata_id’ (stdout) ‘ID_ATA_FEATURE_SET_PM=1′

util_run_program: ‘/lib/udev/ata_id’ (stdout) ‘ID_ATA_FEATURE_SET_PM_ENABLED=1′

util_run_program: ‘/lib/udev/ata_id’ (stdout) ‘ID_ATA_SATA=1′

util_run_program: ‘/lib/udev/ata_id’ (stdout) ‘ID_ATA_SATA_SIGNAL_RATE_GEN2=1′

util_run_program: ‘ata_id –export /dev/sdc’ returned with exitcode 0

udev_rules_apply_to_event: LINK ‘disk/by-id/ata-VBOX_HARDDISK_VB021b64b5-d0167900′ /lib/udev/rules.d/60-persistent-storage.rules:43

udev_rules_apply_to_event: PROGRAM ‘scsi_id –whitelisted –replace-whitespace -p0x80 -d/dev/sdc’ /lib/udev/rules.d/60-persistent-storage.rules:51

util_run_program: ‘scsi_id –whitelisted –replace-whitespace -p0x80 -d/dev/sdc’ started

util_run_program: ‘/lib/udev/scsi_id’ (stdout) ‘SATA_VBOX_HARDDISK_VB021b64b5-d0167900′

util_run_program: ‘scsi_id –whitelisted –replace-whitespace -p0x80 -d/dev/sdc’ returned with exitcode 0

udev_rules_apply_to_event: LINK ‘disk/by-id/scsi-SATA_VBOX_HARDDISK_VB021b64b5-d0167900′ /lib/udev/rules.d/60-persistent-storage.rules:51

udev_rules_apply_to_event: IMPORT ‘path_id /devices/pci0000:00/0000:00:0d.0/host4/target4:0:0/4:0:0:0/block/sdc’ /lib/udev/rules.d/60-persistent-storage.rules:60

util_run_program: ‘path_id /devices/pci0000:00/0000:00:0d.0/host4/target4:0:0/4:0:0:0/block/sdc’ started

util_run_program: ‘/lib/udev/path_id’ (stdout) ‘ID_PATH=pci-0000:00:0d.0-scsi-2:0:0:0′

util_run_program: ‘path_id /devices/pci0000:00/0000:00:0d.0/host4/target4:0:0/4:0:0:0/block/sdc’ returned with exitcode 0

udev_rules_apply_to_event: LINK ‘disk/by-path/pci-0000:00:0d.0-scsi-2:0:0:0′ /lib/udev/rules.d/60-persistent-storage.rules:61

udev_rules_apply_to_event: IMPORT ‘/sbin/blkid -o udev -p /dev/sdc’ /lib/udev/rules.d/60-persistent-storage.rules:73

util_run_program: ‘/sbin/blkid -o udev -p /dev/sdc’ started

util_run_program: ‘/sbin/blkid’ (stdout) ‘ID_PART_TABLE_TYPE=dos’

util_run_program: ‘/sbin/blkid -o udev -p /dev/sdc’ returned with exitcode 0

udev_rules_apply_to_event: IMPORT ‘edd_id –export /dev/sdc’ /lib/udev/rules.d/61-persistent-storage-edd.rules:8

util_run_program: ‘edd_id –export /dev/sdc’ started

util_run_program: ‘/lib/udev/edd_id’ (stderr) ‘no kernel EDD support’

util_run_program: ‘edd_id –export /dev/sdc’ returned with exitcode 2

udev_rules_apply_to_event: IMPORT ‘udisks-part-id /dev/sdc’ /lib/udev/rules.d/80-udisks.rules:85

util_run_program: ‘udisks-part-id /dev/sdc’ started

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ‘libudev: udev_device_new_from_syspath: ‘

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ‘device 0xec1270 has devpath ‘/devices/pci0000:00/0000:00:0d.0/host4/target4:0:0/4:0:0:0/block/sdc”

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ‘libudev: udev_device_read_db: ‘

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ‘device 0xec1270 filled with db file data’

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ‘using device_file=/dev/sdc syspath=/sys/devices/pci0000:00/0000:00:0d.0/host4/target4:0:0/4:0:0:0/block/sdc, offset=0 ao=0 and number=0 for /dev/sdc’

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ‘Entering MS-DOS parser (offset=0, size=10737418240)’

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ”

util_run_program: ‘/lib/udev/udisks-part-id’ (stdout) ‘UDISKS_PARTITION_TABLE=1′

util_run_program: ‘/lib/udev/udisks-part-id’ (stdout) ‘UDISKS_PARTITION_TABLE_SCHEME=mbr’

util_run_program: ‘/lib/udev/udisks-part-id’ (stdout) ‘UDISKS_PARTITION_TABLE_COUNT=1′

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ‘MSDOS_MAGIC found’

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ‘looking at part 0 (offset 32256, size 10733958144, type 0×83)’

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ‘new part entry’

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ‘looking at part 1 (offset 0, size 0, type 0×00)’

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ‘new part entry’

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ‘looking at part 2 (offset 0, size 0, type 0×00)’

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ‘new part entry’

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ‘looking at part 3 (offset 0, size 0, type 0×00)’

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ‘new part entry’

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ‘Exiting MS-DOS parser’

util_run_program: ‘/lib/udev/udisks-part-id’ (stderr) ‘MSDOS partition table detected’

util_run_program: ‘udisks-part-id /dev/sdc’ returned with exitcode 0

udev_rules_apply_to_event: IMPORT ‘udisks-probe-ata-smart /dev/sdc’ /lib/udev/rules.d/80-udisks.rules:129

util_run_program: ‘udisks-probe-ata-smart /dev/sdc’ started

util_run_program: ‘/lib/udev/udisks-probe-ata-smart’ (stderr) ‘libudev: udev_device_new_from_syspath: ‘

util_run_program: ‘/lib/udev/udisks-probe-ata-smart’ (stderr) ‘device 0x149a770 has devpath ‘/devices/pci0000:00/0000:00:0d.0/host4/target4:0:0/4:0:0:0/block/sdc”

util_run_program: ‘/lib/udev/udisks-probe-ata-smart’ (stderr) ‘libudev: udev_device_read_db: ‘

util_run_program: ‘/lib/udev/udisks-probe-ata-smart’ (stderr) ‘device 0x149a770 filled with db file data’

util_run_program: ‘/lib/udev/udisks-probe-ata-smart’ (stderr) ‘libudev: udev_device_new_from_syspath: ‘

util_run_program: ‘/lib/udev/udisks-probe-ata-smart’ (stderr) ‘device 0x149b020 has devpath ‘/devices/pci0000:00/0000:00:0d.0/host4/target4:0:0/4:0:0:0”

util_run_program: ‘/lib/udev/udisks-probe-ata-smart’ (stderr) ‘libudev: udev_device_new_from_syspath: ‘

util_run_program: ‘/lib/udev/udisks-probe-ata-smart’ (stderr) ‘device 0x149c070 has devpath ‘/devices/pci0000:00/0000:00:0d.0/host4/target4:0:0”

util_run_program: ‘/lib/udev/udisks-probe-ata-smart’ (stderr) ‘libudev: udev_device_new_from_syspath: ‘

util_run_program: ‘/lib/udev/udisks-probe-ata-smart’ (stderr) ‘device 0x149c380 has devpath ‘/devices/pci0000:00/0000:00:0d.0/host4”

util_run_program: ‘/lib/udev/udisks-probe-ata-smart’ (stderr) ‘libudev: udev_device_new_from_syspath: ‘

util_run_program: ‘/lib/udev/udisks-probe-ata-smart’ (stderr) ‘device 0x149c680 has devpath ‘/devices/pci0000:00/0000:00:0d.0”

util_run_program: ‘/lib/udev/udisks-probe-ata-smart’ (stderr) ‘libudev: udev_device_new_from_syspath: ‘

util_run_program: ‘/lib/udev/udisks-probe-ata-smart’ (stderr) ‘device 0x149c970 has devpath ‘/devices/pci0000:00”

util_run_program: ‘/lib/udev/udisks-probe-ata-smart’ (stdout) ‘UDISKS_ATA_SMART_IS_AVAILABLE=0′

util_run_program: ‘udisks-probe-ata-smart /dev/sdc’ returned with exitcode 0

udev_rules_apply_to_event: RUN ‘socket:@/org/freedesktop/hal/udev_event’ /etc/udev/rules.d/90-hal.rules:2

udev_device_update_db: created db file for ‘/devices/pci0000:00/0000:00:0d.0/host4/target4:0:0/4:0:0:0/block/sdc’ in ‘/dev/.udev/db/block:sdc’

udev_node_add: creating device node ‘/dev/asmsdc1′, devnum=8:32, mode=0660, uid=1100, gid=6

udev_node_mknod: mknod(/dev/asmsdc1, 060660, (8,32))

udev_node_mknod: set permissions /dev/asmsdc1, 060660, uid=1100, gid=6

node_symlink: atomically replace ‘/dev/block/8:32′

link_find_prioritized: found ‘/sys/devices/pci0000:00/0000:00:0d.0/host4/target4:0:0/4:0:0:0/block/sdc’ claiming ‘/dev/.udev/links/disk\x2fby-id\x2fata-VBOX_HARDDISK_VB021b64b5-d0167900′

link_update: creating link ‘/dev/disk/by-id/ata-VBOX_HARDDISK_VB021b64b5-d0167900′ to ‘/dev/asmsdc1′

node_symlink: atomically replace ‘/dev/disk/by-id/ata-VBOX_HARDDISK_VB021b64b5-d0167900′

link_find_prioritized: found ‘/sys/devices/pci0000:00/0000:00:0d.0/host4/target4:0:0/4:0:0:0/block/sdc’ claiming ‘/dev/.udev/links/disk\x2fby-id\x2fscsi-SATA_VBOX_HARDDISK_VB021b64b5-d0167900′

link_update: creating link ‘/dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VB021b64b5-d0167900′ to ‘/dev/asmsdc1′

node_symlink: atomically replace ‘/dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VB021b64b5-d0167900′

link_find_prioritized: found ‘/sys/devices/pci0000:00/0000:00:0d.0/host4/target4:0:0/4:0:0:0/block/sdc’ claiming ‘/dev/.udev/links/disk\x2fby-path\x2fpci-0000:00:0d.0-scsi-2:0:0:0′

link_update: creating link ‘/dev/disk/by-path/pci-0000:00:0d.0-scsi-2:0:0:0′ to ‘/dev/asmsdc1′

node_symlink: atomically replace ‘/dev/disk/by-path/pci-0000:00:0d.0-scsi-2:0:0:0′

udev_event_execute_rules: removed kernel created node ‘/dev/sdc’

udevadm_test: UDEV_LOG=6

udevadm_test: DEVPATH=/devices/pci0000:00/0000:00:0d.0/host4/target4:0:0/4:0:0:0/block/sdc

udevadm_test: MAJOR=8

udevadm_test: MINOR=32

udevadm_test: DEVNAME=/dev/asmsdc1

udevadm_test: DEVTYPE=disk

udevadm_test: ACTION=add

udevadm_test: SUBSYSTEM=block

udevadm_test: MPATH_SBIN_PATH=/sbin

udevadm_test: DEVLINKS=/dev/block/8:32 /dev/disk/by-id/ata-VBOX_HARDDISK_VB021b64b5-d0167900 /dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VB021b64b5-d0167900 /dev/disk/by-path/pci-0000:00:0d.0-scsi-2:0:0:0

udevadm_test: ID_ATA=1

udevadm_test: ID_TYPE=disk

udevadm_test: ID_BUS=ata

udevadm_test: ID_MODEL=VBOX_HARDDISK

udevadm_test: ID_MODEL_ENC=VBOX\x20HARDDISK\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20

udevadm_test: ID_REVISION=1.0

udevadm_test: ID_SERIAL=VBOX_HARDDISK_VB021b64b5-d0167900

udevadm_test: ID_SERIAL_SHORT=VB021b64b5-d0167900

udevadm_test: ID_ATA_WRITE_CACHE=1

udevadm_test: ID_ATA_WRITE_CACHE_ENABLED=1

udevadm_test: ID_ATA_FEATURE_SET_PM=1

udevadm_test: ID_ATA_FEATURE_SET_PM_ENABLED=1

udevadm_test: ID_ATA_SATA=1

udevadm_test: ID_ATA_SATA_SIGNAL_RATE_GEN2=1

udevadm_test: ID_SCSI_COMPAT=SATA_VBOX_HARDDISK_VB021b64b5-d0167900

udevadm_test: ID_PATH=pci-0000:00:0d.0-scsi-2:0:0:0

udevadm_test: ID_PART_TABLE_TYPE=dos

udevadm_test: UDISKS_PRESENTATION_NOPOLICY=0

udevadm_test: UDISKS_PARTITION_TABLE=1

udevadm_test: UDISKS_PARTITION_TABLE_SCHEME=mbr

udevadm_test: UDISKS_PARTITION_TABLE_COUNT=1

udevadm_test: UDISKS_ATA_SMART_IS_AVAILABLE=0

udevadm_test: run: ‘socket:/org/kernel/dm/multipath_event’

udevadm_test: run: ‘socket:@/org/freedesktop/hal/udev_event’

[root@oel1 dev]#

  1. Reload the rules and restart udev.

[root@oel1 dev]# udevadm control –reload-rules

[root@oel1 dev]# start_udev

Starting udev: [ OK ]

[root@oel1 dev]#

  1. Check the names, ownerships and permissions of the devices.

[root@oel1 ~]# ls -la /dev/asm*

brw-rw—- 1 grid asmadmin 8, 16 May 8 11:01 /dev/asmsdb1

brw-rw—- 1 grid asmadmin 8, 32 May 8 11:01 /dev/asmsdc1

brw-rw—- 1 grid asmadmin 8, 48 May 8 11:01 /dev/asmsdd1

brw-rw—- 1 grid asmadmin 8, 64 May 8 11:01 /dev/asmsde1

brw-rw—- 1 grid asmadmin 8, 80 May 8 11:01 /dev/asmsdf1

[root@oel1 ~]#

  1. Thos new devices are referring to old /dev/sd* devices and have appropriate ownership and permissions and can be used for Oracle installations

Additional info

  1. Device Persistence and Oracle Linux ASMLib [ID 394959.1]
  2. NOTE:465001.1 – Configuring raw devices (singlepath) for Oracle Clusterware 10g Release 2 (10.2.0) on RHEL5/OEL5
  3. NOTE:564580.1 – Configuring raw devices (multipath) for Oracle Clusterware 10g Release 2 (10.2.0) on RHEL5/OEL5
  4. NOTE:605828.1 – Configuring non-raw multipath devices for Oracle Clusterware 11g (11.1.0) on RHEL5/OEL5
  5. UDEV SCSI Rules Configuration for ASM in Oracle Linux 5

May 10, 2011 - Posted by | oracle

16 Comments »

  1. Hello there, You have done a great job. I’ll definitely digg it and in my opinion suggest to my friends. I am sure they’ll be benefited from this site.

    Comment by Gwen Hatton | December 27, 2011 | Reply

  2. Just two words to jot…

    THANK YOU!!!!

    Comment by Mon Ty | January 6, 2012 | Reply

  3. This has been a HUGE help–much better than Oracle install manual(probably because they want you to buy Oracle Linux)

    Comment by Eric | April 2, 2012 | Reply

    • Hi,

      Most likely Oracle does not want to size and position across the following options and lets the customer decide on his own.

      1. UDEV
      2. ASMLib
      3. Dev mapper

      Regards,

      Comment by gjilevski | April 3, 2012 | Reply

  4. Hi Guenadi,

    Thanks for the great
    Could you tell me where do you get the value for the SUBSYSTEM?
    How do you know that the SUBSYSTEM you were trying to match is the block not something else?

    I was using the same thing as you which is the virtualBox shared disks.
    I saw in Tim Hall’s website, he was using BUS==”scsi” instead of SUBSYSTEM==”block”. what difference does it make?

    Are there any other possible value for the SUBSYSTEM?

    In OEL 6.2 I use, I don’t have the scsi_id.config file in the /etc folder.
    Is it happening to your OEL6 also?

    Comment by Adhika | August 16, 2012 | Reply

  5. Hi,

    great tutorial, but there seems to be a much simpler solution, if ownership and permissions are all you’re concerned about. Cost me a good few hours of searching about, especially with scsi_id not reporting anything, /dev/disk/by-uuid not having anything on my device (/dev/sdc, which is in /dev/disk/by-path, shows up as sdc, but thats about it).

    The shortcut is /etc/udev/udev.permissions:

    [root@test ~]# cat /etc/udev/udev.permissions
    #name:user:group:mode
    sdc:oracle:oinstall:660
    sdc*:oracle:oinstall:660

    Now some other udev-rule is still messing with me because /dev/sdc still belongs to root:disk, but /dev/sdc1, the device my client is concerned with, is now being owned by oracle:oinstall…

    Interestingly enough “udevadm test /dev/sdc” (as well as for all other disk devices) shows “unable to open device ‘/sys/dev/sdc’”. I suppose if I start digging into that I will find the root cause of the problem.

    Comment by Ronald | September 20, 2012 | Reply

    • Hi,

      Thank you for sharing. My objective was to present UDEV as an alternative way to implement persistence for

      1. Ownership
      2. Permissions
      3. Path persistence

      I need to look further at using /etc/udev/udev.permissions but I doubt I can get device path persistence from it. It is a convenient as you said ONLY for setting ownership and permissions.

      Is a /etc/udev/udev.permissions file a REDHAT 6.X syntax that you need for permissions? It used to be in /etc/udev/permissions.d directory.
      I agree that, /etc/udev/udev.permissions is much simpler and very neat, less error prone, way to configure it. I will need to look at it further.

      Regards,

      Comment by gjilevski | September 20, 2012 | Reply

      • Hi,

        Seems that REDHAT 6.X have changed the way UDEV works. See what I have. The /etc/udev/permissions.d directory is not there.

        [root@oel61 ~]# cd /etc/udev
        [root@oel61 udev]# ls
        makedev.d rules.d udev.conf
        [root@oel61 udev]# cat udev.conf
        # The initial syslog(3) priority: “err”, “info”, “debug” or its
        # numerical equivalent. For runtime debugging, the daemons internal
        # state can be changed with: “udevadm control –log-priority=”.
        udev_log=”err”
        [root@oel61 udev]#

        Regards.

        Comment by gjilevski | September 20, 2012

  6. [...] UDEV rules for device persistency and permissions/ownerships in OEL6/REDHAT 6 for ASM [...]

    Pingback by Instalação Oracle | MÓDOLO | January 14, 2013 | Reply

  7. hi Can anyone help here?
    I have OEL 6.4 installed as VBox Guest.
    I have modified the /etc/scsi_id.config file to whats given in the first step. But when I execute
    scsi_id –whitelisted –replace-whitespace -device=/dev/sd*
    I am getting the following error
    “-whitelisted: invalid option == ‘w’”

    I appreciate any help

    Senthil Kumar

    Comment by senthil | May 6, 2013 | Reply

    • /sbin/scsi_id –whitelisted –replace-whitespace /dev/sd*

      pay attention it’s 2 “-” before whitelisted !

      Comment by salma | June 18, 2013 | Reply

      • Hi,

        I am aware of it. Thank you. The formating of the theme might create a misunderstanding. However, the output of the scsi_id -h will display the syntax.

        Best Regards,

        Comment by gjilevski | July 2, 2013

  8. I got over the first step but the scsi_id is not returning any ids.. echo $? gives 1

    Comment by senthil | May 6, 2013 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 614 other followers

%d bloggers like this: