How to format and mount ocfs2 file system for Oracle RAC

How to format and mount ocfs2 file system for Oracle RAC Database
 
We have one RAC server runing out of space for database and now I have got one new LUN /dev/sdk from storage, I have created partition of it like
[root@trdrp-c04-orac1 msctr]# fdisk /dev/sdk
follow the instruction to create new partition from /dev/sdk.
 
The new partition will display like /dev/sdk1 as below.
 [root@trdrp-c04-orac1 msctr]# fdisk -l 
sk /dev/sdk: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sdk1               1       26108   209712478+  83  Linux
 
Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes
255 heads, 63 sectors/track, 17844 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
 
Format that partition as ocfs2 filesystem
 
[root@trdrp-c04-orac1 msctr]# mkfs.ocfs2 -b 4k -C 32k -L oradata2 /dev/sdk1
mkfs.ocfs2 1.2.7
Filesystem label=oradata2
Block size=4096 (bits=12)
Cluster size=32768 (bits=15)
Volume size=214745546752 (6553514 clusters) (52428112 blocks)
204 cluster groups (tail covers 5546 clusters, rest cover 32256 clusters)
Journal size=268435456
Initial number of node slots: 4
Creating bitmaps: done
Initializing superblock: done
Writing system files: done
Writing superblock: done
Writing backup superblock: 4 block(s)
Formatting Journals: done
Writing lost+found: done
mkfs.ocfs2 successful
[root@trdrp-c04-orac1 msctr]#
 
Create mount point for /dev/sdk1
[root@trdrp-c04-orac1 msctr]#mkdir /oradata2
 
Add the below line to /etc/fstab to mount automatically when server gets reboot.
 
/dev/sdk1               /oradata2              ocfs2   _netdev,datavolume,nointr       0       0
 
 
Before Mounting the new LUN see ouput
[root@rac-node2~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p5      30G  3.6G   25G  13% /
/dev/cciss/c0d0p8     7.8G  421M  7.0G   6% /var
/dev/cciss/c0d0p7     7.8G  172M  7.2G   3% /opt
/dev/cciss/c0d0p6     7.8G  147M  7.3G   2% /tmp
/dev/cciss/c0d0p3      30G  4.2G   24G  15% /usr
/dev/cciss/c0d0p2      30G  518M   28G   2% /home
/dev/cciss/c0d0p1      99M   15M   80M  16% /boot
tmpfs                 5.9G     0  5.9G   0% /dev/shm
/dev/sda1              50G  5.0G   42G  11% /u01
/dev/sdb1             1.0G  141M  884M  14% /ocr_disk1
/dev/sdc1             1.0G  141M  884M  14% /ocr_disk2
/dev/sdd1             1.0G  147M  878M  15% /vote_disk1
/dev/sde1             1.0G  147M  878M  15% /vote_disk2
/dev/sdf1             1.0G  147M  878M  15% /vote_disk3
/dev/sdg1             300G  291G  9.3G  97% /oradata
/dev/sdh1             300G  283G   18G  95% /oraindex
/dev/sdi1             200G  170G   31G  85% /ora_archive_log
/dev/sdj1             100G   35G   66G  35% /ora_rman_backup
[root@rac-node2~]#
 
Mount all mount points what is there in fstab as
[root@rac-node2~]#mount -a
 
After mounting sdk1 see df -h output
[root@rac-node2~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p5      30G  3.6G   25G  13% /
/dev/cciss/c0d0p8     7.8G  421M  7.0G   6% /var
/dev/cciss/c0d0p7     7.8G  172M  7.2G   3% /opt
/dev/cciss/c0d0p6     7.8G  147M  7.3G   2% /tmp
/dev/cciss/c0d0p3      30G  4.2G   24G  15% /usr
/dev/cciss/c0d0p2      30G  518M   28G   2% /home
/dev/cciss/c0d0p1      99M   15M   80M  16% /boot
tmpfs                 5.9G     0  5.9G   0% /dev/shm
/dev/sda1              50G  5.0G   42G  11% /u01
/dev/sdb1             1.0G  141M  884M  14% /ocr_disk1
/dev/sdc1             1.0G  141M  884M  14% /ocr_disk2
/dev/sdd1             1.0G  147M  878M  15% /vote_disk1
/dev/sde1             1.0G  147M  878M  15% /vote_disk2
/dev/sdf1             1.0G  147M  878M  15% /vote_disk3
/dev/sdg1             300G  291G  9.3G  97% /oradata
/dev/sdh1             300G  283G   18G  95% /oraindex
/dev/sdi1             200G  170G   31G  85% /ora_archive_log
/dev/sdj1             100G   35G   66G  35% /ora_rman_backup
/dev/sdk1             200G   23G  178G  12% /oradata2
[root@rac-node2~]#
Give permission on /oradata2 to oracle user
[root@rac-node2~]#chown -R oracle:oinstall /oradata2
[root@rac-node2~]#chmod -R 775 /oradata2
Now oracle user can create database datafile inside the /ordata.
 
 
 
 
Advertisements

About Sher khan

Senior Oracle DBA, Oracle 10g , Oracle 11g OCE ,Oracle 12C and Oracle 11g OPN certified Specialist, OCP Certified in Oracle 9i,10g , 11g and 12C. I am working in Oracle technology since 2004. Currently working in U.A.E Email: sher487@hotmail.com
This entry was posted in Linux commands for DBA. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s