Tuesday, 3 March 2020

STEP BY STEP PRACTICALS - LINUX - HOW TO EXTEND A LVM IN LINUX

Prerequisists:- Please refer to my earlier blog:- How to create a LVM in Linux

 

 1) Add a disk on the server. In my example, I have added a 2 GB disk on the server.

 

 2) After adding the hard drive on the server, I ran  the below command:-

 echo "- - -" > /sys/class/scsi_host/host0/scan

echo "- - -" > /sys/class/scsi_host/host1/scan

echo "- - -" > /sys/class/scsi_host/host2/scan 

 Then I was able to see the drive on the server:-  

 

3) Now we will create the physical volume.

pvcreate /dev/sdd 


4) We can check the status by running the below command:-

pvs



5) Now we will extend the volume group.

 

6) Now we will extend the logical volume.

 lvextend -L +1.98GB volume1/logicalvolume1 /dev/sdd


7) The last step is to re-size the volume group.

resize2fs /dev/mapper/volume1-logicalvolume1

8) We can check the new size by running the command:-

df -h


No comments:

Post a Comment