0% found this document useful (0 votes)
34 views

Creating Logical Volume

This document outlines the steps to create a logical volume using LVM2 on Linux. It involves first identifying unused disks and partitions, then creating physical volumes on those partitions, a volume group from the physical volumes, and finally a logical volume within that volume group. The logical volume is then formatted, mounted, and added to fstab to make it available for permanent use.

Uploaded by

Sudheesh Mp
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Creating Logical Volume

This document outlines the steps to create a logical volume using LVM2 on Linux. It involves first identifying unused disks and partitions, then creating physical volumes on those partitions, a volume group from the physical volumes, and finally a logical volume within that volume group. The logical volume is then formatted, mounted, and added to fstab to make it available for permanent use.

Uploaded by

Sudheesh Mp
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Create Logical volume (LVM2)

First we need to find out which disks and partitions are being used. So we could use the
following commands
#df -h [This  will display which partitions  are being used]
#fdisk -l [This will show which disks are being used and disks that are not mounted.]
Now we can start the lvm implementation,we have two unused partitions /dev/sda3 and /dev/s
da4
In logical volume creation,need to the following  sequence

1. create physical volume


2. create volume group
3. create logical volume

1.Create physical volume     


#pvcreate /dev/sda3
#pvcreate /dev/sda4
Verify the volumes with pvdisplay command
#pvdisplay
2.Create volume group
#vgcreate test_volume /dev/sda3 /dev/sda4
#vgchange -a y test_volume [To activate the volume]
Verify the group with vgdisplay

#vgdisplay
3.Now create logical volume
#lvcreate -L5G -n test_logical  test_volume
test_logical  --name of logical volume
test_volume--name of volume group

Verify the logical volumes with lvdisplay


#lvdisplay
Create filesystem  for this logical volume
#mkfs.ext3  /dev/test_volume/test_logical
To use this file system, we need to mount and add to /etc/fstab to use permanently.
#mount /dev/test_volume/test_logical    /mnt
add the following entry to /etc/fstab
/dev/test_volume/test_logical /mnt    ext3    defaults     0 0

1/2
Create Logical volume (LVM2)

Source : http://coretimer.com

2/2

You might also like