LATEST TOPICS

Create Disk with ASM Filter Driver (ASMFD)

In my last article, I have demonstrated the steps involved in migrating ASM Disks from ASMLIB to ASMFD (ASM Filter Driver).
Today, I would be discussing the steps involved in creating and adding a new ASM Disk with ASM Filter Driver.

Demonstration:

Lets take a note of the existing ASM disks.

[oracle@labserver ~]$ asmcmd afd_lsdsk
--------------------------------------------------------------------------------
Label                     Filtering   Path
================================================================================
DATA01                      ENABLED   /dev/sdd1
DATA02                      ENABLED   /dev/sde1
FLASH01                     ENABLED   /dev/sdf1
FLASH02                     ENABLED   /dev/sdg1

Now, lets create a new block device using the fdisk command.

[root@labserver ~]$fdisk /dev/sdl
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 1305.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/sdl: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1305, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305):
Using default value 1305

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

Now, we have a physical disk ready to be mapped with ASM.
Lets create the ASM disk with afd_label command of ASM Filter Driver (ASMFD) module. This command is the replacement of create disk command that we were using with Oracle ASM Library Driver (ASMLIB).

The afd_label command needs be executed as root user.

[root@labserver ~]$ $ORACLE_HOME/bin/asmcmd afd_label FLASH03 /dev/sdl1
Connected to an idle instance.

I was bit worried, as the command did not display any meaningful output. So, here what I got from the logs.

14-Oct-14 09:00 ASMCMD (PID = 6801) Given command - afd_label FLASH03 '/dev/sdl1'
14-Oct-14 09:00 NOTE: Verifying AFD driver state : loaded
14-Oct-14 09:00 NOTE: afdtool -add '/dev/sdl1' 'FLASH03'
14-Oct-14 09:00 NOTE: Device /dev/sdl1 labeled with FLASH03

As we can see afd_label command is internally converted to add and label a new ASM Disk.

Lets, validate if we can see the new ASM Disk.

[oracle@labserver ~]$ asmcmd afd_lsdsk
--------------------------------------------------------------------------------
Label                     Filtering   Path
================================================================================
DATA01                      ENABLED   /dev/sdd1
DATA02                      ENABLED   /dev/sde1
FLASH01                     ENABLED   /dev/sdf1
FLASH02                     ENABLED   /dev/sdg1
###
### FLASH03 is the new ASM Disk being added
###
FLASH03                     ENABLED   /dev/sdl1

Lets verify the new ASM disk within the ASM instance

SQL> select DISK_NUMBER,NAME,LABEL,PATH,MOUNT_STATUS,HEADER_STATUS,OS_MB from v$asm_disk;

DISK_NUMBER NAME            LABEL           PATH                 MOUNT_S HEADER_STATU      OS_MB
----------- --------------- --------------- -------------------- ------- ------------ ----------
          0                 FLASH03         AFD:FLASH03          CLOSED  PROVISIONED       10236
          0 DATA_0000       DATA01          AFD:DATA01           CACHED  MEMBER            15358
          1 DATA_0001       DATA02          AFD:DATA02           CACHED  MEMBER            15358
          0 FRA_0000        FLASH01         AFD:FLASH01          CACHED  MEMBER            10236
          1 FRA_0001        FLASH02         AFD:FLASH02          CACHED  MEMBER            10236

Now, adding the new ASM disk to an existing diskgroup involves the same old process.

SQL> alter diskgroup FRA add disk 'AFD:FLASH03';

Diskgroup altered.

SQL> select DISK_NUMBER,NAME,LABEL,PATH,MOUNT_STATUS,HEADER_STATUS,OS_MB from v$asm_disk;

DISK_NUMBER NAME            LABEL           PATH                 MOUNT_S HEADER_STATU      OS_MB
----------- --------------- --------------- -------------------- ------- ------------ ----------
          0 DATA_0000       DATA01          AFD:DATA01           CACHED  MEMBER            15358
          1 DATA_0001       DATA02          AFD:DATA02           CACHED  MEMBER            15358
          0 FRA_0000        FLASH01         AFD:FLASH01          CACHED  MEMBER            10236
          1 FRA_0001        FLASH02         AFD:FLASH02          CACHED  MEMBER            10236
          2 FLASH03         FLASH03         AFD:FLASH03          CACHED  MEMBER            10236

Observation:

afd_label is the single command that can be used to add a new ASM Disk for ASMFD module, migrate a disk from ASMLIB to ASMFD as well as to rename an existing disk configured with ASMFD.

%d bloggers like this:
Visit Us On LinkedinVisit Us On TwitterVisit Us On Google PlusCheck Our Feed