LVM: How to increase SWAP size with Lvextend command

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

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

VG ‘ol’ space is availble

Step:3 Run ‘swapoff’ command

Step:4 Now check swap space by ‘free’ command

Swap is ‘0’ as we ran the command ‘swapoff’

Step:5 Now extend the swap partion by 500MB with ‘lvextend’ command

LV extended successfully.

Step:6 Type ‘mkswap’ for file system update

Step: 7 Now ON the swap partition by using ‘swapon’ command

Step:8 Now run ‘lsblk’ command to check swap update

Now you can see the swap updated in to 8.5G to 9G.

Similar Posts