This discussion is archived
13 Replies Latest reply: Jun 7, 2012 5:14 PM by Dude! RSS

ASM disks owner ship

902332 Newbie
Currently Being Moderated
Hi all,

In oracle 11g r2 version on linux 5.5, when we install grid infrastructure does we need to change ownership of disks, even though we are not changing disk groups are available for the oracle user to use it. how it's possible.

we i reboot my machine asm (standalone) is not coming up, is there any special Regen for this.

please help me to clear this.

thank you!
  • 1. Re: ASM disks owner ship
    sb92075 Guru
    Currently Being Moderated
    899329 wrote:
    Hi all,

    In oracle 11g r2 version on linux 5.5, when we install grid infrastructure does we need to change ownership of disks, even though we are not changing disk groups are available for the oracle user to use it. how it's possible.

    we i reboot my machine asm (standalone) is not coming up, is there any special Regen for this.
    clues should exist within alert log file.
  • 2. Re: ASM disks owner ship
    BillyVerreynne Oracle ACE
    Currently Being Moderated
    899329 wrote:

    In oracle 11g r2 version on linux 5.5, when we install grid infrastructure does we need to change ownership of disks, even though we are not changing disk groups are available for the oracle user to use it. how it's possible.
    If you are using scsi devices, permissions can be set using +/etc/rc.local+ (e.g. for local devices) to udev rules (e.g. for SAN/NAS devices)

    Exactly what devices do you assign to ASM for use?
  • 3. Re: ASM disks owner ship
    Dude! Guru
    Currently Being Moderated
    The /dev directory in Linux resets at every system restart. You can define udev rules or use Oracle ASMLib to configure and setup disks for ASM.
  • 4. Re: ASM disks owner ship
    onedbguru Pro
    Currently Being Moderated
    or you can simply add an rc.d script that executes prior to ohasd starting up that sets the permissions. If you are using multipathd, they can be set in the multipathd.conf file.
  • 5. Re: ASM disks owner ship
    Dude! Guru
    Currently Being Moderated
    You can also add commands in /etc/rc.local, which is more appropriate than creating a startup service, however this is not how it's supposed to be done in Linux. It's just going to mess things up and make it very difficult later for troubleshooting since no one will expect a startup service to set device permissions instead of Udev or ASMLib.
  • 6. Re: ASM disks owner ship
    Talip Hakan Ozturk Oracle ACE
    Currently Being Moderated
    Change owner of partition to user “oracle” and group “oinstall”. Give write permission to disks.

    # chown oracle:oinstall /dev/sdb1
    # chown oracle:oinstall /dev/sdc1
    # chown oracle:oinstall /dev/sdd1
    # chmod 600 /dev/sdb1
    # chmod 600 /dev/sdc1
    # chmod 600 /dev/sdd1

    Also write these lines to rc.local file to apply on reboot process.

    # vi /etc/rc.local

    chown oracle:oinstall /dev/sdb1
    chown oracle:oinstall /dev/sdc1
    chown oracle:oinstall /dev/sdd1
    chmod 600 /dev/sdb1
    chmod 600 /dev/sdc1
    chmod 600 /dev/sdd1

    More info check this doc.

    http://taliphakanozturken.wordpress.com/2012/03/12/configuring-oracle-asm-disks/


    Talip Hakan Ozturk
    http://taliphakanozturken.wordpress.com/
  • 7. Re: ASM disks owner ship
    Dude! Guru
    Currently Being Moderated
    I recommend you read my previous reply regarding /etc/rc.local.

    Again, setting the device ownership and permission is not the real challenge. You have to take into consideration that device names under Linux can be dynamic and shift depending on whether you add or remove a device.

    You can write your own scripts to mount devices based on UUID, WWID, volume label, etc. and set ownership and permissions. However, the supported way to make ASM use the correct disk devices is to either use Udev, Multipath, or ASMLib which will be easier to use. There is no reason to come up with strange solutions and ideas.

    You may want to review your documentation, since "/etc/init.d/oracleasm configure" is run as root user there is no need to set ownership and permissions. It is also not necessary, redundant, and can lead to confusion and problems to set permissions in /etc/rc.local. ASMLib will take care of setting proper device permissions, provided you have installed ASMLib properly. If you use Oracle Linux with UEK kernel you must not install the oracleasm kernel driver since it is build-in, but still need oracleasm-support and oracleasmlib package.

    http://oss.oracle.com/projects/oracleasm/dist/documentation/asm-install.txt

    Edited by: Dude on Jun 5, 2012 8:22 AM
  • 8. Re: ASM disks owner ship
    onedbguru Pro
    Currently Being Moderated
    It would be nice if Oracle would find a way to have the oracle processes not dependent on any device permissions/ownership such that we don't need to kludge the system/startup processes for it to work.

    This is one of the reasons why we as RAC DBA's need to understand our respective OS oddities. We need to also be an SA so we can document our systems as well as make various suggestions on how to correct this issue. I actually prefer to name and change the ownership/permissions of the devices in multipath.conf. As well as making sure they are properly partitioned (skipping the first 1MB - for VTOC or Partition table etc).

    But, I never use ASMLib as my processes and procedures span many OS's that cannot use ASMLib (Linux only). Since it is unnecessary on the rest, it is also unnecessary on Linux.
  • 9. Re: ASM disks owner ship
    927114 Newbie
    Currently Being Moderated
    the best is use what a normal Sysadim should be using.

    when you are not using asmlib, you should create a file like /etc/udev/rules.d/61-asm.rules

    KERNEL=="xvd[b-f]1", OWNER="oracle", GROUP="oinstall", MODE="660", ACTION=="add|change"


    or

    KERNEL=="sd[b-f]1", OWNER="oracle", GROUP="oinstall", MODE="660", ACTION=="add|change"


    that will set the required permissions for xvd or sd disks, from b to f.. for partition 1

    feel free to tweak for your needs

    once is set, as root you can type start_udev and will apply the changes
  • 10. Re: ASM disks owner ship
    Dude! Guru
    Currently Being Moderated
    Please see my reply to this at Re: problem parsing udev rules?
  • 11. Re: ASM disks owner ship
    Dude! Guru
    Currently Being Moderated
    It would be nice if Oracle would find a way to have the oracle processes not dependent on any device permissions/ownership such that we don't need to kludge the system/startup processes for it to work.
    Oracle does, that's where ASMLib plugs in. The rest is up to the OS and not under control of Oracle.

    Device permissions/ownership isn't really the challenge. However, device name persistence is much more of an issue in order not to confuse ASM disk groups. There is otherwise no guarantee that, for instance, device /dev/sdb will be the same physical disk after a disk failure or when you remove a disk and restart the system. Device names are dynamic and the device tree gets rebuild after every system restart.
    Since it is unnecessary on the rest, it is also unnecessary on Linux.
    Well, why would you not want to take advantage of Linux, just because a Linux feature is not available on other Unix platforms?

    Anyway, there is also Udev and Multipath to take care of device permissions and name persistence.
  • 12. Re: ASM disks owner ship
    927114 Newbie
    Currently Being Moderated
    Hi there

    RedHAt 6, Ol6 hace deprecated the multipath trick for user, group and permission, so udev is the way to go.

    is not really hard to have some kind of persistency, as udev can create symlinks based on scsi_id, or any other trick to identify the disks.

    Without using Asmlib on linux, and only having ASM disks, there is not much trouble with the disks, as you will see 'candidate' or 'used', if you go with the keep it simple and just looking at oracle infrastructure end.

    with the jungle of hardware, virtual options, is upto each person what will be the best, off course, more the detail less the mistakes.

    Alvaro
  • 13. Re: ASM disks owner ship
    Dude! Guru
    Currently Being Moderated
    It is important to map the right disks or partitions to the appropriate ASM disk groups. The most reliable way is to use UUID or WWID, or use ASMLib, which installs a meta-data to identify disks, rather than using the physical path or device name. Device names and SCSI ID's can easily change if you remove or adds devices depending on your storage facility, or if devices break during a system restart, which is fairly common.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points