CentOS 6 Logical Volume Management
Transcript of CentOS 6 Logical Volume Management
-
7/28/2019 CentOS 6 Logical Volume Management
1/4
Logical Volume Management:-
The below is the simple process to process while working with logical volume
management.
1. Initialize a disk or partition for use by LVM (pvcreate)
2. Create volume group with disk partitions (vgcreate)
3. Create logical volume from volume group (lvcreate)
4. Some useful commands working with logical volume.
a. pvs
b. vgs
c. lvs
1. Create a logical volume with 300M:
a. Specification three partitions of 500MB
b. Create volume group named vg01 with three partitions from above
c. Create volume group named lv01
I am using /dev/sdb which has the capacity of 20GB
The below is the example shown to create a partition of type logical with
the 500MB of size and write changes to partition tables
Once you have created the partitions you can find the devices as below
Eg : /dev/sdb1, /dev/sdb2,
-
7/28/2019 CentOS 6 Logical Volume Management
2/4
-
7/28/2019 CentOS 6 Logical Volume Management
3/4
Create volume group
Create logical volume lv01
Load the logical with file system (ext4)
Create a mount point to mount the logical volume
Create a directory to mount the logical volume # mkdir /mnt/lv01
Mount the logical volume as below
Add the logical volume to /etc/fstab file to make logical volume mount
automatically after boot.
-
7/28/2019 CentOS 6 Logical Volume Management
4/4
# vim /etc/fstab
Write the changes to the file and boot the system.
# df h (to view the disk space)