Creating Logical Volume On Existing Volume Group In Linux

Create logical volume on existing VG (Volume group)

First make sure you have proper space to create new lv. From the below output, you can see there is enough space to have a new lv:

#vgdisplay /dev/vg01
--- Volume group ---
VG Name vg01
VG Access read/write
VG Status available/resizable
VG # 0
MAX LV 256
Cur LV 6
Open LV 6
MAX LV Size 2 TB
Max PV 256
Cur PV 1
Act PV 1
VG Size 278.81 GB
PE Size 32 MB
Total PE 8922
Alloc PE / Size 1825 / 57.03 GB
Free PE / Size 7097 / 221.78 GB

Create Logical volume:

#lvcreate -L 40G -n dbdir vg01

Format the new volume with a file system:

#mkfs.ext3 /dev/vg01/dbdir

Create a mount point on your system:

#mkdir /oracle10

Mount the new drive:

#mount /dev/vg01/dbdir /oracle10

Create a fstab entry to mount it properly after reboots:

vim /etc/fstab

put the following entry:

/dev/vg01/dbdir /oracle10 ext3 defaults 0 0

save the file and exit.

Note: Please backup your /etc/fstab before doing this.

Run below command to update kernel:

#mount -a

Now, you should get back to the prompt with no errors.

Bobbin Zachariah 11:22 am

About Bobbin Zachariah

Founder of LinOxide, passionate lover of Linux and technology writer. Started his career in Linux / Opensource from 2000. Love traveling, blogging and listening music. Reach Bobbin Zachariah about me page and google plus page.

Author Archive Page

Have anything to say?

Your email address will not be published. Required fields are marked *

All comments are subject to moderation.