©2015, 2016, 2017, 2018 Chad’s Technoworks. Disclaimer and Terms of Use

Chad’s TechnoWorks My Journal On Technology

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 -> Virtual Machine Library


2. From Virtual Machine Library, select:

   Select your Solaris VM -> Settings -> Hard Disk -> [Add Device]

   

   Then,create additional hard drives according to your spec.


   For example:


Bus Type: SCSI, Pre-allocate disk space



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:


-bash-3.2$ cd /dev/rdsk

-bash-3.2$ ls -la c*t*d0s6

lrwxrwxrwx   1 root     root          52 Jan 16 22:12 c0t0d0s6 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:g,raw

lrwxrwxrwx   1 root     root          50 Jan 16 22:12 c1t0d0s6 -> ../../devices/pci@0,0/pci15ad,1976@10/sd@0,0:g,raw

lrwxrwxrwx   1 root     root          50 Mar 24 13:26 c1t1d0s6 -> ../../devices/pci@0,0/pci15ad,1976@10/sd@1,0:g,raw

lrwxrwxrwx   1 root     root          50 Mar 24 13:26 c1t2d0s6 -> ../../devices/pci@0,0/pci15ad,1976@10/sd@2,0:g,raw

lrwxrwxrwx   1 root     root          50 Mar 24 13:26 c1t3d0s6 -> ../../devices/pci@0,0/pci15ad,1976@10/sd@3,0:g,raw

lrwxrwxrwx   1 root     root          50 Mar 24 13:26 c1t4d0s6 -> ../../devices/pci@0,0/pci15ad,1976@10/sd@4,0:g,raw

lrwxrwxrwx   1 root     root          50 Mar 24 13:26 c1t5d0s6 -> ../../devices/pci@0,0/pci15ad,1976@10/sd@5,0:g,raw

lrwxrwxrwx   1 root     root          50 Mar 24 13:26 c1t6d0s6 -> ../../devices/pci@0,0/pci15ad,1976@10/sd@6,0:g,raw

-bash-3.2$


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,-VMware Virtual -1.0  cyl 11223 alt 2 hd 255 sec 63>

          /pci@0,0/pci15ad,1976@10/sd@0,0

       1. c1t1d0 <VMware,-VMware Virtual -1.0  cyl 1021 alt 2 hd 64 sec 32>

          /pci@0,0/pci15ad,1976@10/sd@1,0

       2. c1t2d0 <VMware,-VMware Virtual -1.0  cyl 1021 alt 2 hd 64 sec 32>

          /pci@0,0/pci15ad,1976@10/sd@2,0

       3. c1t3d0 <VMware,-VMware Virtual -1.0  cyl 3069 alt 2 hd 128 sec 32>

          /pci@0,0/pci15ad,1976@10/sd@3,0

       4. c1t4d0 <VMware,-VMware Virtual -1.0  cyl 3069 alt 2 hd 128 sec 32>

          /pci@0,0/pci15ad,1976@10/sd@4,0

       5. c1t5d0 <VMware,-VMware Virtual -1.0  cyl 3069 alt 2 hd 128 sec 32>

          /pci@0,0/pci15ad,1976@10/sd@5,0

       6. c1t6d0 <VMware,-VMware Virtual -1.0  cyl 3069 alt 2 hd 128 sec 32>

          /pci@0,0/pci15ad,1976@10/sd@6,0

Specify disk (enter its number): 1

selecting c1t1d0

[disk formatted]



FORMAT MENU:

        disk       - select a disk

        type       - select (define) a disk type

        partition  - select (define) a partition table

        current    - describe the current disk

        format     - format and analyze the disk

        fdisk      - run the fdisk program

        repair     - repair a defective sector

        label      - write label to the disk

        analyze    - surface analysis

        defect     - defect list management

        backup     - search for backup labels

        verify     - read and display labels

        save       - save new disk/partition definitions

        inquiry    - show vendor, product and revision

        volname    - set 8-character volume name

        !<cmd>     - execute <cmd>, then return

        quit

format> current

Current Disk = c1t1d0

<VMware,-VMware Virtual -1.0  cyl 1021 alt 2 hd 64 sec 32>

/pci@0,0/pci15ad,1976@10/sd@1,0


format> partition

WARNING - This disk may be in use by an application that has

          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      - change `0' partition

        1      - change `1' partition

        2      - change `2' partition

        3      - change `3' partition

        4      - change `4' partition

        5      - change `5' partition

        6      - change `6' partition

        7      - change `7' partition

        select - select a predefined table

        modify - modify a predefined partition table

        name   - name the current table

        print  - display the current table

        label  - write partition map and label to the disk

        !<cmd> - execute <cmd>, then return

        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 - 1019     1020.00MB    (1020/0/0) 2088960

  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 -    0        1.00MB    (1/0/0)       2048

  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 - 1019     1020.00MB    (1020/0/0) 2088960

  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 - 1019     1019.00MB    (1019/0/0) 2086912

  7 unassigned    wm       0               0         (0/0/0)          0

  8       boot    wu       0 -    0        1.00MB    (1/0/0)       2048

  9 unassigned    wm       0               0         (0/0/0)          0


partition> quit



FORMAT MENU:

        disk       - select a disk

        type       - select (define) a disk type

        partition  - select (define) a partition table

        current    - describe the current disk

        format     - format and analyze the disk

        fdisk      - run the fdisk program

        repair     - repair a defective sector

        label      - write label to the disk

        analyze    - surface analysis

        defect     - defect list management

        backup     - search for backup labels

        verify     - read and display labels

        save       - save new disk/partition definitions

        inquiry    - show vendor, product and revision

        volname    - set 8-character volume name

        !<cmd>     - execute <cmd>, then return

        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-99]_c[0-9]t[0-9]d[0-9]s[0-9]

/dev/rdsk/asmreco[0-99]_c[0-9]t[0-9]d[0-9]s[0-9]


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 -lL" to get those numbers:


# cd /dev/rdsk

# ls -lL c1t*s6

crw-r-----   1 root     sys       33,  6 Mar 26 12:00 c1t0d0s6

crw-r-----   1 root     sys       33, 134 Mar 26 12:00 c1t1d0s6

crw-r-----   1 root     sys       33, 198 Mar 26 12:00 c1t2d0s6

crw-r-----   1 root     sys       33, 262 Mar 26 12:00 c1t3d0s6

crw-r-----   1 root     sys       33, 326 Mar 26 12:00 c1t4d0s6

crw-r-----   1 root     sys       33, 390 Mar 26 12:00 c1t5d0s6

crw-r-----   1 root     sys       33, 454 Mar 26 12:00 c1t6d0s6

#


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 -lL asm*

crw-r--r--   1 root     root      33, 262 Mar 26 14:34 asmdata01_c1t3d0s6

crw-r--r--   1 root     root      33, 326 Mar 26 14:36 asmdata02_c1t4d0s6

crw-r--r--   1 root     root      33, 390 Mar 26 14:37 asmdata03_c1t5d0s6

crw-r--r--   1 root     root      33, 454 Mar 26 14:37 asmdata04_c1t6d0s6

crw-r--r--   1 root     root      33, 134 Mar 26 14:28 asmreco01_c1t1d0s6

crw-r--r--   1 root     root      33, 198 Mar 26 14:33 asmreco02_c1t2d0s6

#

   

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

Information Technology