©2015 -
HOW TO CREATE RAW DISK FOR ASM IN SOLARIS
Note: For demonstration purposes, the Solaris I am using is running on Vmware. Therefore, to attach a device such as a hard drive, it has to be done through the Vmware and be presented as a virtual disk. The equivalent reality of this on your physical server is the addition of a controller card (if one is needed) and the addition of hard disks onto your controller. Upon bootup, Solaris will automatically recognize the newly added devices given that the devices are compatible with Solaris.
PREPARE VIRTUAL HARD DRIVES FOR SOLARIS IN VMWARE FUSION 6
Add a new Hard Disk to your Solaris VM for use with the creation of ASM diskgroups for RECO and DATA.
1. From vmWare Fusion Menu, select:
Window -
2. From Virtual Machine Library, select:
Select your Solaris VM -
Then,create additional hard drives according to your spec.
For example:
Bus Type: SCSI, Pre-
CONFIGURE SOLARIS RAW DISK
ASM uses the entire partition of the raw disk for use with the ASM disk group. As a precaution, we need to avoid the possibility of having s0 being overwritten since that holds the partition label. With that said, we need to use s6 which usually is tagged as usr for our raw partition of the entire disk. Note that, just like s2 (tagged as backup), it starts at cylinder 0.
We need to modify the partition s6 to start with cylinder 1 to protect the label.
List all available drive for slice 6:
-
-
lrwxrwxrwx 1 root root 52 Jan 16 22:12 c0t0d0s6 -
lrwxrwxrwx 1 root root 50 Jan 16 22:12 c1t0d0s6 -
lrwxrwxrwx 1 root root 50 Mar 24 13:26 c1t1d0s6 -
lrwxrwxrwx 1 root root 50 Mar 24 13:26 c1t2d0s6 -
lrwxrwxrwx 1 root root 50 Mar 24 13:26 c1t3d0s6 -
lrwxrwxrwx 1 root root 50 Mar 24 13:26 c1t4d0s6 -
lrwxrwxrwx 1 root root 50 Mar 24 13:26 c1t5d0s6 -
lrwxrwxrwx 1 root root 50 Mar 24 13:26 c1t6d0s6 -
-
Note that the disks on controller c0t0 and c1t0 are our main hard drives for the operating environment. So, moving forward on configuring the raw disks for ASM, WE WILL NOT TOUCH THESE TWO DRIVES. Also, notice that the newly added drives are on the same controller c1. This is okay since we are on virtual environment doing a demo. But in real world, you should have separate controllers (i.e. c1, c2) for your disk pairs. In that way, you will be protected from not only hard drive failure but also against controller failure.
For each drive in controller c1 starting at drive t1, modify/create the partition s6 to start at cylinder 1.
# id
uid=0(root) gid=0(root)
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0 <VMware,-
/pci@0,0/pci15ad,1976@10/sd@0,0
1. c1t1d0 <VMware,-
/pci@0,0/pci15ad,1976@10/sd@1,0
2. c1t2d0 <VMware,-
/pci@0,0/pci15ad,1976@10/sd@2,0
3. c1t3d0 <VMware,-
/pci@0,0/pci15ad,1976@10/sd@3,0
4. c1t4d0 <VMware,-
/pci@0,0/pci15ad,1976@10/sd@4,0
5. c1t5d0 <VMware,-
/pci@0,0/pci15ad,1976@10/sd@5,0
6. c1t6d0 <VMware,-
/pci@0,0/pci15ad,1976@10/sd@6,0
Specify disk (enter its number): 1
selecting c1t1d0
[disk formatted]
FORMAT MENU:
disk -
type -
partition -
current -
format -
fdisk -
repair -
label -
analyze -
defect -
backup -
verify -
save -
inquiry -
volname -
!<cmd> -
quit
format> current
Current Disk = c1t1d0
<VMware,-
/pci@0,0/pci15ad,1976@10/sd@1,0
format> partition
WARNING -
modified the fdisk table. Ensure that this disk is
not currently in use before proceeding to use fdisk.
format> fdisk
No fdisk table exists. The default partition for the disk is:
a 100% "SOLARIS System" partition
Type "y" to accept the default partition, otherwise type "n" to edit the
partition table.
y
format> partition
PARTITION MENU:
0 -
1 -
2 -
3 -
4 -
5 -
6 -
7 -
select -
modify -
name -
print -
label -
!<cmd> -
quit
partition> print
Current partition table (original):
Total disk cylinders available: 1020 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 -
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 -
9 unassigned wm 0 0 (0/0/0) 0
partition>
partition> 6
Part Tag Flag Cylinders Size Blocks
6 unassigned wm 0 0 (0/0/0) 0
Enter partition id tag[unassigned]: usr
Enter partition permission flags[wm]:
Enter new starting cyl[1]:
Enter partition size[0b, 0c, 1e, 0.00mb, 0.00gb]: 1019c
partition> label
Ready to label disk, continue? y
partition> print
Current partition table (unnamed):
Total disk cylinders available: 1020 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 -
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 1 -
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 -
9 unassigned wm 0 0 (0/0/0) 0
partition> quit
FORMAT MENU:
disk -
type -
partition -
current -
format -
fdisk -
repair -
label -
analyze -
defect -
backup -
verify -
save -
inquiry -
volname -
!<cmd> -
quit
format> quit
Do the partitioning for the rest of the drives.
Note that the maximum partition size is minus 2 reserve cyclinders of the total cylinders described in "current".
The disks listed in /dev/rdsk are pointers to the physical devices. By looking at the list, it doesn't seem to be descriptive for anyone to know which was the raw partion used for the ASM.
We need to create aliases for each of the logical devices we had partitioned as raw with a more descriptive name.
One may already have a naming convention, but for demonstration purposes I'll be using the following:
/dev/rdsk/asmdata[0-
/dev/rdsk/asmreco[0-
We will not be creating symbolic links but rather, we'll have a special file with an inode pointing to a device type (b for block device, c for character device). In our case, we have a character device, but we need to know the major and minor device numbers essential for creating a logical device name. We use "ls -
# cd /dev/rdsk
# ls -
crw-
crw-
crw-
crw-
crw-
crw-
crw-
#
From the above list, here's a matrix for the device aliases that we plan to create.
FILE NAME |
DISK SIZE |
COMMENT |
Virtual Disk 2.vmdk |
1 GB |
Primary ASM RECO disk |
Virtual Disk 3.vmdk |
1 GB |
Mirror ASM RECO disk |
Virtual Disk 4.vmdk |
6 GB |
Primary ASM DATA disK |
Virtual Disk 5.vmdk |
6 GB |
Primary ASM DATA disk |
Virtual Disk 6.vmdk |
6 GB |
Mirror ASM DATA disk |
Virtual Disk 7.vmdk |
6 GB |
Mirror ASM DATA disk |
Use mknod to create a logical device name:
mknod <name> c <major> <minor>
where name = name for the device
c = character type
major = the major device number
minor = the minor device number
example:
# mknod asmreco01_c1t1d0s6 c 33 134
Do this for the rest of the device as listed in the matrix above.
List all the asm raw devices:
# ls -
crw-
crw-
crw-
crw-
crw-
crw-
#
Next step is to make this asm devices readable and writable by the ASM user by changing their ownership.
# chown oragrid:orainst asm*
DEVICE ALIAS |
DEVICE TYPE |
MAJOR |
MINOR |
DEVICE |
asmreco01_c1t1d0s6 |
C |
33 |
134 |
c1t1d0s6 |
asmreco02_c1t2d0s6 |
C |
33 |
198 |
c1t2d0s6 |
asmdata01_c1t3d0s6 |
C |
33 |
262 |
c1t3d0s6 |
asmdata02_c1t4d0s6 |
C |
33 |
326 |
c1t4d0s6 |
asmdata03_c1t5d0s6 |
C |
33 |
390 |
c1t5d0s6 |
asmdata04_c1t6d0s6 |
C |
33 |
454 |
c1t6d0s6 |