Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to add new disk partition for Oracle Linux

Posted on 2013-05-13
3
Medium Priority
?
749 Views
Last Modified: 2013-05-23
I'm just installing Oracle Linux on VMware. I need to know how do I create new disk partition for Linux ? any guideline here ?

LiuxDisk
0
Comment
Question by:motioneye
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 79

Assisted Solution

by:arnold
arnold earned 668 total points
ID: 39163716
use pvdisplay, vgdisplay, lvdisplay those will give you information on what your system currently has.
lvcreate is the command you will need to use provided the VolumeGroup you have which is returned/listed when you run vgdisplay has avaliable space

lvcreate -L <size_of_partition>G -n <name of LogicalVolume> <name of volume group  where this logical volume should be created. In your df -h it is VolGroup>
Once you do this you will have a /dev/mapper/VolGroup-<name of LogicalVolume>
you can then use mkfs.<file system type that you want> /dev/mapper/VolGroup-<name of LogicalVolume>
One the filesystem is creted on the newly created LogicalVolume, you can mount it where you want it
mount -t <file system type> /dev/mapper/VolGroup-<name of LogicalVolume> /<mount point>

not if you plan on overlaying an existing partition, you must first copy the data
mount <new logicalvolume> /mnt/test
cd /<location to be overlayed>
find . | cpio -pdvmu /mnt/test (this will clone the data including inodes)
...

if you provide more detail on what you actually want to achieve ..... response will be more precise to what you need/want to end up with.
0
 
LVL 19

Assisted Solution

by:jools
jools earned 664 total points
ID: 39164656
looks like you've used the default 20GB disk option in VMWare, if there is enough space on the root volume you could just put it in there under it's own directory (or whatever the doc say), you dont necessarily have to create another partition as such.

however, if you do then you may need to reduce the amount of space used on root which will be time consuming or just add another disk in VMWare and then use vgcreate et al to create your partition, for example. (you can change this to suit your own needs, I'm not saying this is exactly what you want/need, check the docs for Oracle for recommendations)

fdisk /dev/sdb1
# Create a single partition here for the whole disk, make sure the partition type is 8e.

pvcreate /dev/sdb1 (or whatever is the new disk)
vgcreate oracle /dev/sdb1
lvcreate -n oraapp -L <size>G /dev/oracle
lvcreate -n oradata -L <size>G /dev/oracle
mkfs.ext3 /dev/oracle/oraapp
mkfs.ext3 /dev/oracle/oradata
mkdir -p /opt/oracle
mount /dev/oracle/oraapp /opt/oracle
mkdir -p /oradata
mount /dev/oracle/oradata /oradata
0
 
LVL 21

Accepted Solution

by:
Mazdajai earned 668 total points
ID: 39165859
In my notes, I used to an if statement to check if the volume is present first. Add to fstab and mount it at the end.

mkdir /opt/oracle
mkdir /opt/orahome
disk2='/dev/sdb'
shortname=`uname -n`
fdisk -lu $disk2 | grep -P "^Disk\s+\/dev\/sdb:"
if [ $? -eq 0 ]
then
	echo "$disk2 found"
mkdir /opt/apps
pvcreate /dev/sdb
vgcreate vg_$shortname /dev/sdb
lvcreate -vL +5G -n LogVol01 vg_$shortname
lvcreate -vl 100%FREE -n LogVol02 vg_$shortname
mkfs -t ext4 /dev/vg_$shortname/LogVol01 && echo /dev/vg_$shortname/LogVol01 /opt/oracle ext4 defaults,acl 1 2 >> /etc/fstab
mkfs -t ext4 /dev/vg_$shortname/LogVol02 && echo /dev/vg_$shortname/LogVol02 /opt/orahome ext4 defaults,acl 1 2 >> /etc/fstab
mount -a

Open in new window

0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

671 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question