Ubuntu

Logical Volume Manager LVM on Ubuntu Server

Logical Volume Manger, or LVM, allows administrators to create logical volumes out of one or multiple physical hard disks. LVM volumes can be created on both software RAID partitions and standard partitions residing on a single disk. Volumes can also be extended, giving greater flexibility to systems as requirements change. 5.2.1.

 Overview

A side effect of LVM’s power and flexibility is a greater degree of complication. Before diving into the LVM installation process, it is best to get familiar with some terms. • Physical Volume (PV): physical hard disk, disk partition or software RAID partition formatted as LVM PV. • Volume Group (VG): is made from one or more physical volumes. A VG can be extended by adding more PVs. A VG is like a virtual disk drive, from which one or more logical volumes are carved. • Logical Volume (LV): is like a partition in a non-LVM system. A LV is formatted with the desired file system (EXT3, XFS, JFS, etc), it is then available for mounting and data storage

On Our Example I add new 10 GM Disk Drive on my Virtual machine

A screenshot of a cell phone

Description automatically generated

We can see this The original one as 30 GB and Also the New drive 10 GM if we run command

Sudo fdisk -l

A screenshot of a cell phone

Description automatically generated
  1. First, create the physical volume, in a terminal execute:

 sudo pvcreate /dev/sdb

A screenshot of a cell phone

Description automatically generated

Create Volume group first by command

Vgcreate VG0 /dev/sdb

Format your new Volume using command

Mkfs.ext4  /dev/sdb

A screenshot of a cell phone

Description automatically generated

Then we can create directory were we want to mounted our new disk using command:

Mkdir desk

Then we will mount our new desk to this directory by using command

Mount  /dev/sdb desk

A close up of a logo

Description automatically generated

Now we can see our new desk showing under command DF

A close up of text on a black background

Description automatically generated

Then we can also un mounted it by using command

Umount  /dev/sdb

And running df again we can not see it

A close up of text on a black background

Description automatically generated

Related Articles

Leave a Reply

Back to top button