How to Identify the ASM Device from ASMLib

In Linux, ASMLib provides the wrapper for managing the ASM disk. Here’s an example run on a virtual server hosting ASM and an Oracle database.

Identify the ASM Device from ASMLib

image_pdfimage_print

In Linux, ASMLib provides the wrapper for managing the ASM disks. To identify the underlying physical device that the ASM disk point to, you can use the oracleasm querydisk command. In this blog, we will teach you how to identify the ASM device from ASMLib.

The querydisk option will list the major and minor numbers that can be used to match the physical device.

The following example was run on a virtual server hosting ASM and an Oracle database.

[root@oraclevm ~]# oracleasm listdisks
DATA1
[root@oraclevm ~]# oracleasm querydisk -d DATA1
Disk "DATA1" is a valid ASM disk on device [8,17]
[root@oraclevm ~]# ls -ltr /dev/sd*
brw-rw----. 1 root disk 8, 0 Dec 14 18:18 /dev/sda
brw-rw----. 1 root disk 8, 2 Dec 14 18:18 /dev/sda2
brw-rw----. 1 root disk 8, 1 Dec 14 18:18 /dev/sda1
brw-rw----. 1 root disk 8, 16 Dec 14 18:18 /dev/sdb
brw-rw----. 1 root disk 8, 17 Dec 14 18:18 /dev/sdb1
[root@oraclevm ~]#

In the above example, DATA1 disk is pointing to the /dev/sdb1.  The major 8 is block based and refers to SCSI disk devices type.

Uncomplicate Your Oracle Data

Uncomplicating your Oracle data is a pivotal endeavor in today’s tech landscape, as it addresses a multitude of challenges that organizations often face. Firstly, simplifying the data structure and architecture within an Oracle database is essential for enhancing data accessibility and usability. The complexity of Oracle databases, especially in large enterprises, can lead to a maze of intertwined tables, stored procedures, and triggers, making it difficult for data professionals to extract meaningful insights efficiently. By streamlining this complexity, organizations can empower their data analysts and engineers to work more effectively, ultimately leading to better decision-making and competitive advantage.

Furthermore, simplifying Oracle data is paramount for data security and compliance. Complex data structures can inadvertently introduce vulnerabilities and risks into the system, making it challenging to identify and mitigate potential security breaches. Ensuring that Oracle data is straightforward and well-organized not only reduces the risk of data breaches but also simplifies the process of adhering to data governance and regulatory requirements, such as GDPR and HIPAA.

Identifying the Underlying Physical Device for an ASMLib ASM Disk

When Oracle ASM uses ASMLib for disk management on Linux, ASMLib maintains labels for ASM devices and provides utilities to work with them. You may find it useful to determine which physical block device corresponds to an ASM disk that is managed through ASMLib.

Oracle’s oracleasm utility includes commands that let you inspect the mapping between ASM labels and the underlying device nodes:

  1. List ASM disks managed by ASMLib.
    Run oracleasm listdisks to show the names of ASM disks that ASMLib knows about. This gives you the labels assigned to each ASM disk.
  2. Query a specific ASM disk.
    Use oracleasm querydisk -d <ASM_LABEL> to retrieve information about the ASM disk named <ASM_LABEL>. The output includes major and minor device numbers for the device associated with that ASM label.
  3. Match the major/minor numbers to a physical device.
    Once you have the major and minor numbers, list block devices on the host with a command such as ls -l /dev/sd*. The major and minor numbers shown in the ls output help you identify which /dev/<name> node corresponds to the ASM device. 

Using these steps lets you trace an ASMLib-managed ASM disk label to the actual storage device path on the host operating system. This approach works whether ASM devices are partitioned or use whole disks, and it relies on standard ASMLib utilities that are included when ASMLib is installed and configured.

Get started today and check out our Solutions Brief on how to uncomplicate your Oracle data!

FAQ

 An ASM device is a Linux block device that’s been labeled for use by Oracle Automatic Storage Management (ASM) through ASMLib. ASMLib abstracts the underlying device path, so ASM sees a consistent, logical disk name (for example, DATA01) even if the underlying /dev path changes after reboots or hardware reconfiguration.

 Use the oracleasm listdisks command as root (or with sudo). It returns the labels of all disks that have been prepared for ASM by ASMLib. This is the quickest way to confirm which ASM disks exist on a host and that ASMLib is seeing them correctly.

First, identify the ASM disk label (for example, DATA01) using oracleasm listdisks. Then run oracleasm querydisk -d DATA01 (or just oracleasm querydisk DATA01) to see the backing block device. On newer ASMLib versions, you can also check /dev/disk/by-label/ and follow the symbolic link from the label (such as /dev/disk/by-label/DATA01) back to the actual multipath or device-mapper path.

With ASMLib v3.x on newer Oracle Linux releases, ASM disks are no longer exposed under /dev/oracleasm. Instead, they’re surfaced via standard /dev/disk/by-label/ entries and managed through the oracleasm utilities (listdisksquerydiskdiscover, etc.). If /dev/oracleasm is missing but oracleasm listdisks works, that behavior is expected.

oracleasm listdisks shows _all* ASM disks known to ASMLib.  
        ■    oracleasm querydisk lets you inspect one or more specific disks and see details like the backing device, disk group membership, size, and capabilities.  
        ■    oracleasm discover validates ASM discovery strings (for example, ORCL:DATA*) and is useful when you’re setting up or troubleshooting ASM disk discovery across multiple disks.

Yes.    Use clear, consistent labels that reflect the disk’s role and disk group—for example, DATA01DATA02FRA01REDO01, etc. Keeping labels aligned across all RAC nodes and documenting which underlying LUN or volume each label maps to simplifies troubleshooting, storage migrations, and audits.