This discussion is archived
7 Replies Latest reply: Dec 10, 2013 10:42 AM by Dude! RSS

Create an ASM disk: a *single* way, right ?

1007321 Newbie
Currently Being Moderated

Hello,

I'm on 11gR2 on RedHat 6.

To create an ASM disk, there is *only one* way of proceeding right ? And it is:

machine $ > /etc/init.d/oracleasm createdisk ASMDSK1 /dev/<path to your device>

 

Or am I mistaken ?, and there is a hidden way of doing this thru the asmcmd utility ?

 

Thanks.

Seb

  • 1. Re: Create an ASM disk: a *single* way, right ?
    gottikere Explorer
    Currently Being Moderated

    we dont have ASMLIB rpm avaliable for RHEL 6.

     

    Best possiable option will be use OEL 6 or RHEL 5 for the same. Fallow below steps for insalling ASMLIB and create the asm disk:

     

    ASMLIB INSTALLATION AND CREATING ASM DISKS USING ASMLIB &amp;laquo; ON CALL DBA SUPPORT

     

    Thanks,

    gssdba.wordpress.com

  • 2. Re: Create an ASM disk: a *single* way, right ?
    Dude! Guru
    Currently Being Moderated

    You do not necessarily need Linux ASMLib to setup and use storage devices for ASM. The main point of ASMLib is device name persistence and ease of administration. You can also do this with Linux UDEV and DM multipath, depending on your requirements and environment.

     

    Unlike the previous poster replied, the situation for ASMLib and RHEL 6 changed last summer. It is also available for RHEL 6, but requires a paid RHEL subscription to install the kernel driver package. (Oracle Linux UEK ships with the kernel driver installed).

    http://www.oracle.com/technetwork/server-storage/linux/asmlib/rhel6-1940776.html

     

    You can find a lot of useful info at:

    http://www.oracle.com/technetwork/server-storage/linux/asmlib/index-101839.html

  • 3. Re: Create an ASM disk: a *single* way, right ?
    BillyVerreynne Oracle ACE
    Currently Being Moderated

    1007321 wrote:

     

    I'm on 11gR2 on RedHat 6.

    To create an ASM disk, there is *only one* way of proceeding right ? And it is:

    machine $ > /etc/init.d/oracleasm createdisk ASMDSK1 /dev/<path to your device>

     

    Or am I mistaken ?, and there is a hidden way of doing this thru the asmcmd utility ?

     

    What do you mean by "creating an ASM" disk?

     

    Writing the disk label? That is done by ASM when a candidate disk is added to the diskgroup.

     

    Which means you can directly use device /dev/sdb as ASM disk in a CREATE DISKGROUP command. It does not need to be "stamped" using oracleasm (ASMLib).

     

    Removing a disk label from a former disk? That can also (very easily) be done by using dd to overwrite the 1st 128 bytes of the disk.

     

    ASMLib is a nice-to-have-for-some. It is optional. And I would argue it is an unnecessary moving part in the storage management s/w stack - as Linux Multipath does all that ASMLib does, and loads more. In fact, if you are using a SAN and you are not using Multipath, you are making a serious mistake relying on ASMLib and  kernel defaults regarding I/O access and failover using multiple I/O paths to the storage device.

  • 4. Re: Create an ASM disk: a *single* way, right ?
    Dude! Guru
    Currently Being Moderated

    Well, ASMLib does not provide device fail-over for which DM Multipath or EMC Powerpath is required. In fact, additional configuration of ASMLib is necessary as it cannot handle seeing multiple paths to one and the same storage device. ASMLib has advantages in regard to optimized device handles and I/O, especially for older Linux kernels used in RHEL4 and below, but whether or not it actually affects performance under recent Linux kernels is questionable. I think ASMLib gets more reasonable the more storage devices there are to be managed. If you use the Oracle Linux UEK kernel, getting the right ASMLib kernel drivers is not an issue anymore.

  • 5. Re: Create an ASM disk: a *single* way, right ?
    1007321 Newbie
    Currently Being Moderated

    Hi Billy,

    > What do you mean by "creating an ASM" disk?

    Er... I mean running the command "oracleasm createdisk" on a device to have your ASM disk newly created/labeled pop up in /dev/oracleasm/disks (or in the list that you get with "oracleasm listdisks"). And therefore make sure you can then use this 'ASM disk' to create a diskgroup upon it (or add it to a dskgrp).

     

    I noticed that the 'lsdsk' cmd of ASMCMD does not return everything you see with "/etc/init.d/oracleasm listdisks" (candidates are not listed): you know why ?

     

    > Writing the disk label?

    Yes, as it seems that the cmd "oracleasm createdisk ASMNAME /dev/..." writes this label indeed.

     

    Thanks a lot.

    Seb

  • 6. Re: Create an ASM disk: a *single* way, right ?
    BillyVerreynne Oracle ACE
    Currently Being Moderated

    1007321 wrote:

     

    Er... I mean running the command "oracleasm createdisk" on a device to have your ASM disk newly created/labeled pop up in /dev/oracleasm/disks (or in the list that you get with "oracleasm listdisks").

    Not necessary.

     

    The I/O layer is fairly static. It's not like one adds and removes disks on a daily basis, or even yearly basis (h/w is written off over a period of 3 to 5 years).

     

    It is also a very important layer to configure correctly. Which is why I do not use ASMLib in any of the RAC clusters we build. A change in the storage layer means:

    a) identifying the WWID of the device

    b) configuring the WWID in /etc/multipath.conf

     

    And therefore make sure you can then use this 'ASM disk' to create a diskgroup upon it (or add it to a dskgrp).

    Devices are seen by ASM via the disk discovery string. So if you set that to /dev, then your local disks will be seen by ASM - provided these disks have the correct permissions. No need for ASMLib.

     

    If you use LUNs from a SAN, then you typically will have multiple I/O channels to the LUN. With each I/O channel seen as a separate scsi device in the /dev tree. In which case ASM will be confused as it will read the same disk label from multiple scsi devices. Thus the reason for Multipath.

     

    It enables you to configure a single logical device for that LUN. And then you simply point ASM's discovery string to it (typically /dev/mpath/*). And ASM sees your SAN LUNs.

     

    ASM does not identify a disk by its name. You can rename a disk (in the /dev tree for example), or create a bunch of symbolic links (with random names) to the ASM disks - and then point ASM to these. It gets the disk name (only uses it to open the device) and then reads the label from the device. This tells ASM the ASM disk name and failgroup/diskgroup the disk belongs too.

     

    There is thus no reason for naming disks at o/s level - simply to have the ASM disk discovery string set so that it can access the disks (whatever the device name is at o/s level).

     

    I noticed that the 'lsdsk' cmd of ASMCMD does not return everything you see with "/etc/init.d/oracleasm listdisks" (candidates are not listed): you know why ?

     

    Seldom use asmcmd - I do most of my ASM admin using SQL*Plus. What version are you using? 10g lacks features and commands supported in 11g for example.

     

    Yes, as it seems that the cmd "oracleasm createdisk ASMNAME /dev/..." writes this label indeed.

    Only the name. The rest of the disk header is written when you add it to a diskgroup - and if it is not yet labeled with a disk name,  ASM will add it too. Use the od command to dump the labels - have a look at Re: find disk name while asm down

  • 7. Re: Create an ASM disk: a *single* way, right ?
    Dude! Guru
    Currently Being Moderated

    If you use ASMLIb you do not need to customize the ASM diskstring init parameter. ASMLib automatically queries all devices and provides ASM disks under /dev/oracleasm, so the ASM instance can see them using the default ORCL:* diskstring. Once a disk is configured as an ASM disk, it can be identified by a special data header. If the oracleasm script or ASM configuration assistant does not see ASM disks you are most likely missing the oracleasmlib software package, which provides the /usr/sbin/oracleasm-discover tool and others, or configured oracleasm with an invalid user and group, so the oracle or asm user does have permission to access the disks.

Legend

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