Skip to content

Learn how to fix low disk space issues by extending logical volumes and resizing ext4 filesystems using LVM.

Notifications You must be signed in to change notification settings

khalidit23/resize-lvm-partition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

🛠️ Fix LVM Disk Space Issue on Ubuntu

Ubuntu

When you run lsblk and see a large disk (e.g., 3.2TB), but df -h shows only a few GB (e.g., 2.7GB), you might be using LVM and not utilizing the full disk space.

This guide shows how to extend the logical volume and filesystem to use all available space.


🧠 Problem Summary

  • lsblk shows full disk size:

img alt

  • But df -h shows:

img alt


✅ Solution: Extend LVM Logical Volume and Filesystem

️Step 1: Confirm the correct LV name using:

Run:

lvdisplay

Step 2: Let's extend it to use all the free space using volume group and LV names:

lvextend -l +100%FREE /dev/datastore/LOG

Step 3: After resizing the logical volume, resize the filesystem:

resize2fs /dev/mapper/datastore-LOG

Now run df -h again to check if the disk space has been extended..

❤️ Support

If this guide helped you, feel free to star ⭐ this repository and share it with others!

About

Learn how to fix low disk space issues by extending logical volumes and resizing ext4 filesystems using LVM.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published