LVM: How to increase SWAP size with Lvextend command

LVM: How to increase SWAP size with Lvextend command post thumbnail image

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.

Leave a Reply

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

Related Post

Enable SSL on your website in UbuntuEnable SSL on your website in Ubuntu

To enable SSL on your website first you need to install SSL on your server. Install SSL Certificates 1. First edit ssl file in apache2 directory. Add these lines: Change your SSL file location on these lines SSLCertificateFile /etc/letsencrypt/live/linoide.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/linoide.com/privkey.pem 2. Now link default ssl file as shown below