Solved

How to add new disk partition for Oracle Linux

Posted on 2013-05-13
3
720 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
3 Comments
 
LVL 77

Assisted Solution

by:arnold
arnold earned 167 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 166 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 167 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Xymon customize http timeout 2 65
Linux as a middle box 7 63
How to find Linux Server's last patch date 9 37
how to rebuild XFS volume from LV 19 38
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now