LVM: Logical Volume Group, It helps to extend the existing filesystem. To extend the filesystem, free space should available in the Volume group. If free space is not available then you need to add a new PV(physical volume) and then create a new Volume Group (VG).
Now let’s see how to extend using ‘lvextend’
Step:1 Type ‘lsblk’ to list the file system
![](https://www.tecoide.com/wp-content/uploads/2023/11/Screenshot-2023-11-29-at-14.20.42-1024x307.png)
Here we can observe the swap partition size is 8.5G. Now we are going extend this swap from root VG which is ‘ol’
Step:2 Check VG space is available or not
![](https://www.tecoide.com/wp-content/uploads/2023/11/Screenshot-2023-11-29-at-14.21.02-1024x87.png)
VG ‘ol’ space is availble
Step:3 Run ‘swapoff’ command
![](https://www.tecoide.com/wp-content/uploads/2023/11/Screenshot-2023-11-29-at-14.21.38-1024x26.png)
Step:4 Now check swap space by ‘free’ command
![](https://www.tecoide.com/wp-content/uploads/2023/11/Screenshot-2023-11-29-at-14.21.58-1024x89.png)
Swap is ‘0’ as we ran the command ‘swapoff’
Step:5 Now extend the swap partion by 500MB with ‘lvextend’ command
![](https://www.tecoide.com/wp-content/uploads/2023/11/Screenshot-2023-11-29-at-14.22.18-1024x87.png)
LV extended successfully.
Step:6 Type ‘mkswap’ for file system update
![](https://www.tecoide.com/wp-content/uploads/2023/11/Screenshot-2023-11-29-at-14.22.36-1024x99.png)
Step: 7 Now ON the swap partition by using ‘swapon’ command
![](https://www.tecoide.com/wp-content/uploads/2023/11/Screenshot-2023-11-29-at-14.22.52-1024x98.png)
Step:8 Now run ‘lsblk’ command to check swap update
![](https://www.tecoide.com/wp-content/uploads/2023/11/Screenshot-2023-11-29-at-14.23.11-1024x325.png)
Now you can see the swap updated in to 8.5G to 9G.