Solved

How to add new disk partition for Oracle Linux

Posted on 2013-05-13
3
733 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 78

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

679 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