Re: udev rules error

From: Justin Mungal <justin_at_n0de.ws>
Date: Fri, 1 Aug 2014 01:56:07 -0500
Message-ID: <CAO9=aUwypw8B=+-PrAXGAD6Ru0yDNMyij+9tNGQOK+HTBaVtnA_at_mail.gmail.com>



Oh, and like the script mentions, we've only ever used it on RHEL6 because ASMlib wasn't supported at the time. It looks like that has changed though: http://www.oracle.com/technetwork/server-storage/linux/asmlib/rhel6-1940776.html

I haven't tried it. Actually udev rules have been working nicely on RHEL6 because kernel upgrades no longer require asmlib driver upgrades (and indeed, verifying that one even exists). But I'm not trying to start a debate.

On Fri, Aug 1, 2014 at 1:48 AM, Justin Mungal <justin_at_n0de.ws> wrote:

> Here is an example of working udev rules on a RAC cluster:
>
> KERNEL=="emcpower[a-z]?", SUBSYSTEM=="block", PROGRAM="/sbin/scsi_id
> --whitelisted --replace-whitespace /dev/$parent", RESULT=="
> 360000970000192605034533034443344", OWNER="grid", GROUP="asmadmin",
> MODE="0660", NAME="ora/ORA-DATA01p%n"
>
> KERNEL=="emcpower[a-z]?", SUBSYSTEM=="block", PROGRAM="/sbin/scsi_id
> --whitelisted --replace-whitespace /dev/$parent", RESULT=="
> 360000970000192605034533034443342", OWNER="grid", GROUP="asmadmin",
> MODE="0660", NAME="ora/ORA-DATA02p%n"
>
> KERNEL=="emcpower[a-z]?", SUBSYSTEM=="block", PROGRAM="/sbin/scsi_id
> --whitelisted --replace-whitespace /dev/$parent", RESULT=="
> 360000970000192605034533034443339", OWNER="grid", GROUP="asmadmin",
> MODE="0660", NAME="ora/ORA-DATA03p%n"
>
> KERNEL=="emcpower[a-z]?", SUBSYSTEM=="block", PROGRAM="/sbin/scsi_id
> --whitelisted --replace-whitespace /dev/$parent", RESULT=="
> 360000970000192605034533034443337", OWNER="grid", GROUP="asmadmin",
> MODE="0660", NAME="ora/ORA-DATA04p%n"
>
> KERNEL=="emcpower[a-z]?", SUBSYSTEM=="block", PROGRAM="/sbin/scsi_id
> --whitelisted --replace-whitespace /dev/$parent", RESULT=="
> 360000970000192605034533034443335", OWNER="grid", GROUP="asmadmin",
> MODE="0660", NAME="ora/ORA-ARCH01p%n"
>
> KERNEL=="emcpower[a-z]?", SUBSYSTEM=="block", PROGRAM="/sbin/scsi_id
> --whitelisted --replace-whitespace /dev/$parent", RESULT=="
> 360000970000192605034533034443334", OWNER="grid", GROUP="asmadmin",
> MODE="0660", NAME="ora/ORA-GRID01p%n"
>
> KERNEL=="emcpower[a-z]?", SUBSYSTEM=="block", PROGRAM="/sbin/scsi_id
> --whitelisted --replace-whitespace /dev/$parent", RESULT=="
> 360000970000192605034533034443333", OWNER="grid", GROUP="asmadmin",
> MODE="0660", NAME="ora/ORA-GRID02p%n"
>
> KERNEL=="emcpower[a-z]?", SUBSYSTEM=="block", PROGRAM="/sbin/scsi_id
> --whitelisted --replace-whitespace /dev/$parent", RESULT=="
> 360000970000192605034533034443332", OWNER="grid", GROUP="asmadmin",
> MODE="0660", NAME="ora/ORA-GRID03p%n"
>
> KERNEL=="emcpower[a-z]?", SUBSYSTEM=="block", PROGRAM="/sbin/scsi_id
> --whitelisted --replace-whitespace /dev/$parent", RESULT=="
> 360000970000192605034533034443331", OWNER="grid", GROUP="asmadmin",
> MODE="0660", NAME="ora/ORA-GRID04p%n"
>
> KERNEL=="emcpower[a-z]?", SUBSYSTEM=="block", PROGRAM="/sbin/scsi_id
> --whitelisted --replace-whitespace /dev/$parent", RESULT=="
> 360000970000192605034533034443330", OWNER="grid", GROUP="asmadmin",
> MODE="0660", NAME="ora/ORA-GRID05p%n"
>
>
>
> Here is the script we use to generate new udev rules when new LUNs are
> added:
>
> #!/bin/bash
> # Script is to generate the new udev rules for PowerPath in a existing
> system
>
>
> dev=$1
> outdev=$2
>
> if [ -z $dev ] || [ -z $outdev ] ; then
> echo "Script accepts two argument"
> echo "First argument is for the input device such as /dev/emcpowerj"
> echo "Second argument is for the output device such as ORA-DATA0. Make
> sure to use unused device name"
> echo "No script generated"
> exit 0
> fi
>
>
> RULE_OUTPUT=/tmp/99-oracle-grid.rules.append
>
> echo -e "# EMC block devices \n " > $RULE_OUTPUT
> echo -e "# By Oracle Database Team,Rackspace" >> $RULE_OUTPUT
> echo -e "# Since ASMLIB is not supported on RHEL6. We need to initialize
> the disks.\n\n" >> $RULE_OUTPUT
>
>
> uid=`/sbin/scsi_id --whitelisted --replace-whitespace --device=$dev`
>
> echo "KERNEL==\"emcpower[a-z]?\", SUBSYSTEM==\"block\",
> PROGRAM=\"/sbin/scsi_id --whitelisted --replace-whitespace /dev/\$parent\",
> RESULT==\"$uid\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\",
> NAME=\"ora\${outdev}p%n\"" >> $RULE_OUTPUT
> echo "" >> $RULE_OUTPUT
>
>
> echo "Output has been generated in $RULE_OUTPUT. Customize the file
> accordingly."
> echo "Append the output file to /etc/udev/rules.d/99-oracle-grid.rules"
> echo "Make sure to copy file from the first node to other nodes. Do not
> generate the file in the other nodes."
> echo "Command to reload the name are"
> echo "udevadm control --reload-rules"
> echo "udevadm trigger"
>
>
> HTH!
>
>
> On Thu, Jul 31, 2014 at 9:48 PM, Andrew Kerber <andrew.kerber_at_gmail.com>
> wrote:
>
>> So, I have managed to get OEL 7 installed, but now for an additional
>> complication I have decided to teach myself something about udev rules
>> instead of using ASMLIB. I know it is a bit of religious war betwen udev
>> and asmlib, but anyway, here is my line from 99-oracle-asmdevices.rules:
>>
>> KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d
>> /dev/$parent", RESULT=="14f504e46494c45524856447a376e2d7871364a2d654b4272",
>> NAME="asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660"
>>
>> The error message out of 'udevadm test /block/sdb/sdb1'
>>
>> is 'unknown key 'BUS' in /etc/udev/rules.d/99-oracle-asmdevices.rules:1
>> invalid rule '/etc/udev/rules.d/99-oracle-asmdevices.rules:1'
>>
>> Any ideas from the linux gurus?
>>
>> --
>> Andrew W. Kerber
>>
>> 'If at first you dont succeed, dont take up skydiving.'
>>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Aug 01 2014 - 08:56:07 CEST

Original text of this message