Sharing Ilmu

Sharing for useful things

How to extending LVM partition in linux

In preceding tutorial I has to discuss about Creating LVM (Logical Volume Management) in Linux  and In this tutorial I’ll discuss about the way of extending LVM partition storage if we has been created vlm storages.  You can following the preceding tutorials for create lvm parititon storages.

Before that I’m has been add new partition named as sdc partition.

Create gpt label for /dev/sdc partition

# parted /dev/sdc mklabel gpt

 

Create new partition with 2GB size on /dev/sdc partition.

# parted /dev/sdc mkpart primary 1M 2000M

Activate lvm for /dev/sdc1

# parted /dev/sdc set 1 lvm on

 

Create new physical volume (PV) for /dev/sdc1

# pvcreate /dev/sdc1

Show pv list with pvdisplay command

 

Show VG list with vgdisplay, and then we will to extend volume group for test-vg  volume group.

 

Use /dev/sdc1 PV for extend test-vg volume group with vgextend command

# vgextend test-vg /dev/sdc1

Check volume group list for make sure the vg has been extend the volume

 

Show Logical Volume (LV) list in test-vg with lvdisplay command. as shown image bellow for test-vg has a storage named as mystorage with 2GB size.

 

Extend logical volume to 3,5 GB size with lvextend command

# lvextend -L 3500M /dev/test-vg/mystorage

 

Then check /mydata storage which is mounting in /dev/mapper/test–vg-mystorage.  as the following image, the storage size haven’t update.  for update ext4 filesystem, use resize2fs command.

# resize2fs /dev/mapper/test–vg-mystorage

Now check again /mydata storage

 

Leave a Reply

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

*
*
You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>