Friday, June 29, 2012

Mounting the Partitions in the Oracle Linux


Mounting Oracle Data Partitions on Linux

To prepare the system for Oracle installation, we need to mount the necessary partitions on the Linux server. This includes creating the required directory structure, mounting the devices, and ensuring persistence across reboots.


To mount the partitions, we have created the labels to mounted the volumes

Step 1: Create Directory Structure

[root@fahtestdb ~]# mkdir /u01/app/oracle
mkdir: cannot create directory `/u01/app/oracle': No such file or directory


To create the full directory structure, use -p .. option it is user to make the directory with the parent.  


[root@fah ~]# mkdir -p /u01/app/oracle
[root@fah ~]# mkdir -p /u02/app/oracle
[root@fah ~]# mkdir -p /u03/app/oracle

To mount the partition, use the mount command  with the device name and label.

Step 2: Mount the Partitions

[root@fah ~]# mount /dev/sda1 /u01/app
[root@fah ~]# mount /dev/sdb1 /u02/app
[root@fah ~]# mount /dev/sdc1 /u03/app

If you have not formatted the device, then you will get the message that the file system must be specified. 
 
[root@fahtestdb ~]# mount /dev/sdc1 /u03/app

Mount: You must specify the filesystem type

Make sure the devices are formatted (e.g., ext3, ext4, etc.) before mounting.

Step 3: Verify Mounts

We can use the df -h or mount command to check if the file system is mounted.  

[root@fahtestdb ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p5      24G  3.0G   20G  14% /
/dev/cciss/c0d0p6     9.7G  232M  9.0G   3% /var
/dev/cciss/c0d0p3      24G  173M   22G   1% /home
/dev/cciss/c0d0p1      99M   16M   79M  17% /boot
tmpfs                  79G     0   79G   0% /dev/shm
/dev/sda1             413G  199M  392G   1% /u01/app
/dev/sdb1             150G  188M  142G   1% /u02/app
/dev/sdc1             150G  188M  142G   1% /u03/app


[root@fahtestdb ~]# mount
/dev/cciss/c0d0p5 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/cciss/c0d0p6 on /var type ext3 (rw)
/dev/cciss/c0d0p3 on /home type ext3 (rw)
/dev/cciss/c0d0p1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/sda1 on /u01/app type ext3 (rw)
/dev/sdb1 on /u02/app type ext3 (rw)
/dev/sdc1 on /u03/app type ext3 (rw)

Step 4: Make Mounts Persistent After Reboot


We have to add these newly created Partitions to the /etc/fstab to keep them mounted even after restarting the server. If you do not add them to the fstab, the partitions will not be mounted automatically when you restart the server.

LABEL=/                      /                            ext3    defaults        1 1
LABEL=/var                 /var                       ext3    defaults        1 2
LABEL=/home             /home                   ext3    defaults        1 2
LABEL=/boot              /boot                      ext3    defaults        1 2
tmpfs                            /dev/shm                tmpfs   defaults       0 0
devpts                           /dev/pts                 devpts  gid=5,mode=620  0 0
sysfs                             /sys                        sysfs   defaults        0 0
proc                              /proc                      proc    defaults        0 0
LABEL=SW-cciss/c0d0p2   swap             swap    defaults       0 0
/dev/sda1               /u01/app/oracle         ext3    _netdev         0 0
/dev/sdb1               /u02/app/oracle         ext3    _netdev         0 0
/dev/sdc1               /u03/app/oracle         ext3    _netdev         0 0

Here we have added the last three lines in the fstab to mount the partitions automatically when the server is  restarted

When you are mounting the file system from the shared storage, then we have to specify _netdev
if the partition is in the local hard disk, we have to specify the default


[root@fahtestdb ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p5      24G  3.0G   20G  14% /
/dev/cciss/c0d0p6     9.7G  232M  9.0G   3% /var
/dev/cciss/c0d0p3      24G  173M   22G   1% /home
/dev/cciss/c0d0p1      99M   16M   79M  17% /boot
tmpfs                  79G     0   79G   0% /dev/shm
/dev/sda1             413G  199M  392G   1% /u01/app
/dev/sdb1             150G  188M  142G   1% /u02/app
/dev/sdc1             150G  188M  142G   1% /u03/app

Step 5: Reboot and Confirm


[root@fahtestdb ~]# reboot

Broadcast message from root (pts/1) (Fri Jun 29 20:05:43 2012):

The system is going down for reboot NOW!
[root@fahtestdb ~]#
login as: root
root@192.168.5.48's password:
Last login: Fri Jun 29 17:43:33 2012 from 172.31.2.1
[root@fahtestdb ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p5      24G  3.0G   20G  14% /
/dev/cciss/c0d0p6     9.7G  232M  9.0G   3% /var
/dev/cciss/c0d0p3      24G  173M   22G   1% /home
/dev/cciss/c0d0p1      99M   16M   79M  17% /boot
tmpfs                  79G     0   79G   0% /dev/shm
/dev/sda1             413G  199M  392G   1% /u01/app/oracle
/dev/sdb1             150G  188M  142G   1% /u02/app/oracle
/dev/sdc1             150G  188M  142G   1% /u03/app/oracle
[root@fahtestdb ~]#

Summary

Mounting and configuring persistent storage is a critical step in preparing your Linux environment for Oracle installation. Ensuring the directories exist, the devices are formatted and mounted correctly, and the /etc/fstab is updated will help avoid issues during Oracle setup and future restarts.

Let me know if you'd like to include mkfs examples or tips on using labels and UUIDs in fstab for better disk management!

 


















No comments:

Post a Comment