This short tutorial shows how to resize an LVM logical volume.

WARNING: Do not reduce the size of an active logical volume. It is the easiest way to lose you data. Recovery is possible, but it can be an involved process. Use this just as a guide on how to grow an LVM logical volume.

The screenshots you see in this tutorial where actually taken from my main desktop computer, which is running Fedora 20 KDE. And I had to perform the operation on it after an attempt to install a software failed with the error message shown in the first screenshot below.

This was the same operation I had to preform on the same computer about six months ago while also attempting to install an application. I documented that on the forum at How to resize an LVM logical volume. The error message just means that the root logical volume does not have enough disk space left for the installation to take place.
root file system Linux

Related Post:  Cinnamon 1.6 review

Recall that on a default installation of Fedora, where LVM is used as the partitioning scheme, three LVM logical volumes are created – root, home and Swap. On my desktop, which has a 2 TB hard drive, I allocated 15 GB to the /root logical volume, 2 GB to the Swap logical volume and the rest to the /home logical volume. The output of df -h showed that just 228 MB of free disk space was left on the /root logical volume, and that the /home logical volume still has lots of space left. Since I do not have another disk attached to the computer, and the Swap logical volume is down to just 1 GB of disk space, the only place to grab disk space from is the /home logical volume.
Linux df -h

Resizing an LVM volume is a simple, 2-step operation – 1. Free up space from an existing logical volume or any where on the computer where you have free disk space. 2. Use the freed space to extend or grow the target logical volume. This screenshot shows the output of lvdisplay for the logical volumes that will be involved in the operation. For both logical volumes, note the LV Size line. Consider this screenshot the before screenshot.
Linux LVM display

Related Post:  Apply the nuke patch to LUKS cryptsetup in Linux Mint 16 and Ubuntu 13.10

This screenshot shows the two commands used for the operation. The first command was used to reduce the /home logical volume by 30 GB, while the second command used that 30 GB to extend or grow the /root logical volume by the same amount, all while the file system was online.
Linux LVM lvresize

This is the after output of lvdisplay. See the new sizes in the LV Size lines?
Linux LVM resize logical volume

And this is the after shot of the output of df -h.
Linux display disk usage

Share:

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn

Hola! Did you notice that LinuxBSDos.com no longer runs network ads?  Yep, no more ads from the usual suspects that track you across the Internet.  But since  I still need to pay to keep the site running, feel free to make a small donation by PayPal.

Subscribe for updates. Trust me, no spam!

Mailchimp Signup Form

Sponsored links

1. Attend Algorithm Conference, a top AI and ML event for 2020.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.

Leave a Reply

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

Get the latest

On social media
Via my newsletter
Mailchimp Signup Form

Sponsored links

1. Attend Algorithm Conference, a top AI and ML event for 2020.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.
Hacking, pentesting distributions

Linux Distributions for Hacking

Experts use these Linux distributions for hacking, digital forensics, and pentesting.

Categories
Archives

The authors of these books are confirmed to speak during

Algorithm Conference

T-minus AI

Author was the first chairperson of AI for the U.S. Air Force.

The case for killer robots

Author is the Director of the Center for Natural and Artificial Intelligence.

Why greatness cannot be planned

Author works on AI safety as a Senior Research Scientist at Uber AI Labs.

Anastasia Marchenkova

An invitation from Anastasia Marchenkova

Hya, after stints as a quantum researcher at Georgia Tech Quantum Optics & Quantum Telecom Lab, and the University of Maryland Joint Quantum Institute, I’m now working on superconducting qubit quantum processors at Bleximo. I’ll be speaking during Algorithm Conference in Austin, Texas, July 16 – 18, 2020. Meet me there and let’s chat about progress and hype in quantum computing.