Adding a disk in LVM

Suppose you want to add a disk or partition in the Linux LVM handler and create a volume group named "quollvg" with a logical volume called "quolllv" of size 50GB.

Check the list of disks with the command:

fidisk -l

Suppose that /dev/sdb is the disk you want to add

We launch the command (lvm)

pvcreate /dev/sdb

If we are going to use a partition, such as disk 1, after creating and associating type 83 (LVM) we use the command:

pvcreate /dev/sdb1

At this point we create the volume group and the logical volume, format and mount the new disk:

vgcreate quollvg /dev/sdb
lvcreate -L 50G -n quolllv quollvg
mkdir /quolllv
mkfs.ext4dev -m 1 /dev/quolvg/quollv
mount /dev/mapper/quollvg-quolllv /quolllv

To see the status of logical volume and volume group:

lvdisplay
vgdisplay

Leave a Reply

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

99 − = 89