How to prepare disks for oracle ASM?


At this post, I write step by step how to configure and prepare disks for Oracle ASM. Before start operation, I added some information and product that we used while defining ASM disk for oracle.

  • Operating  System: RHEL6
  • Disk  Multipath Solution: RHEL Native Multipath Solution
  • Disk  Type:Vmware(It's  optional. You can change  it to your storage type)

Let's start to create an  scenario. First, you should get a LUN from your storage admin. Please don't forget to get LUN ID and also the serial  number of the disk.

Disk  Name:/dev/sdc

Disk Serial:36000c29a0e7ed8ea2494f72fc72ccd35

Step 1: Check multipathd service  is running and  configured

You should check multipath.conf  file .

Define Storage Device;

devices {
device {
vendor "VMware"
product "VV"
no_path_retry 18
features "0"
hardware_handler "0"
path_grouping_policy multibus
getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
path_selector "round-robin 0"
rr_weight uniform
rr_min_io_rq 100
path_checker tur
failback immediate
}
}

Define Disk Names;

multipaths {
multipath {
wwid 36000c29a0e7ed8ea2494f72fc72ccd35
alias casesupdisk
}

Start Multipath Service;

[root@casesupsrv01 ~]# /etc/init.d/multipathd start
multipathd (pid 1715) is running...
[root@casesupsrv01 ~]# cat /etc/multipath.conf |grep -v '#'
defaults {
user_friendly_names yes
}

blacklist {
}

devices {
device {
vendor "VMware"
product "VV"
no_path_retry 18
features "0"
hardware_handler "0"
path_grouping_policy multibus
getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
path_selector "round-robin 0"
rr_weight uniform
rr_min_io_rq 100
path_checker tur
failback immediate
}
}
multipaths {
multipath {
wwid 36000c29a0e7ed8ea2494f72fc72ccd35
alias casesup
}
}
[root@casesupsrv01 ~]#

Step 2: Create a partition for the disk

# fdisk /dev/mapper/casesupdiskp1
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): [ENTER]
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305): [ENTER]
Using default value 1305

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

Calling ioctl() to re-read partition table.
Syncing disks.

Step 3: Get  Partition UUID

All disk  partitions UUID start  with "part1-mpath-<Serial>".

#udevadm info --query=all --name=/dev/mapper/casesupdiskp1 |grep -i dm_uuid
E: DM_UUID=part1-mpath-36000c29a0e7ed8ea2494f72fc72ccd35

Step 4: Create  Udev Rules

You can change ownership of disk to oracle. Check oracle primary group and run "chown", "chmod"  commands. Also, create Udev rules. When you restart the server all permission will change. We create Udev rules to restore permissions after the server restarts.

# ls -ld /dev/mapper/casesupdiskp1
lrwxrwxrwx 1 root root 8 May 21 15:52 /dev/mapper/ocrvote1p1 -> ../dm-10
#chown  oracle:oinstall  /dev/dm-10
#chmod  660  /dev/dm-10

#vi /etc/udev/rules.d/90-ora.rules
#############################################MIRROR DISKS##############################################################
KERNEL=="dm-*",ENV{DM_UUID}=="part1-mpath-36000c29a0e7ed8ea2494f72fc72ccd35",OWNER="oracle",GROUP="oinstall",MODE="0660"

Step 5: Udev Reload  - Optional

Please do not perform this task on the Production server. I strongly recommend changing permission with  chmod and chown command. Create udev rules for the server restart. 

# /sbin/udevadm control --reload-rules
# /sbin/udevadm trigger --type=devices --action=change

 

I'm a IT Infrastructure and Operations Architect with extensive experience and administration skills and works for Turk Telekom. I provide hardware and software support for the IT Infrastructure and Operations tasks.

205 Total Posts
Follow Me