Solved

How to add new disk partition for Oracle Linux

Posted on 2013-05-13
3
715 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 76

Assisted Solution

by:arnold
arnold earned 167 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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.

763 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

7 Experts available now in Live!

Get 1:1 Help Now