How to extend, grow or resize an LVM logical volume

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:  How to install the latest OpenSSH on Windows 7 and Windows 8

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:  What will 'rm -rf /' actually do to your Linux/BSD machine?

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 run network ads?  Yep, no more ads from the usual suspects that track and annoy 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 or your favorite cryptocurrency.

  • Bitcoin
  • Ethereum
  • Xrp
  • Bitcoin cash
  • Bitcoin sv
  • Litecoin
  • Binance coin
  • Cardano
  • Ethereum classic
Scan to Donate Bitcoin to bc1qzvlte2m224zkayhdc7fdfjkp2rsgt0l5a496ua

Donate Bitcoin to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin

Scan to Donate Ethereum to 0x0F4362DFF77F3Ba0Dc637F5f3Eba35D09a2fA60C

Donate Ethereum to this address

Scan the QR code or copy the address below into your wallet to send some Ethereum

Scan to Donate Xrp to r4ggjvL36njsMCYTkJ3S7cTHscPsMsSGQv

Donate Xrp to this address

Scan the QR code or copy the address below into your wallet to send some Xrp

Scan to Donate Bitcoin cash to qrs0dedzp9t55af3nfwypydghp29r0xguy9s20fz2k

Donate Bitcoin cash to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin cash

Scan to Donate Bitcoin sv to 15K9TLyVDBtLuG9cYvXCX9SSkq9C9oUKHK

Donate Bitcoin sv to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin sv

Scan to Donate Litecoin to LetJ9QQMb7u2LMZ9Tu6rtHwcBcQFW98fbG

Donate Litecoin to this address

Scan the QR code or copy the address below into your wallet to send some Litecoin

Scan to Donate Binance coin to bnb1ga8trq08ssqepd90v6225nzfgy448pu5pw8gxp

Donate Binance coin to this address

Scan the QR code or copy the address below into your wallet to send some Binance coin

Scan to Donate Cardano to addr1qx2354yw49etstfljpdhwja3ajjlt487lg95vu9ngy2q6vu4rf2ga2tjhqknlyzmwa9mrm997h20a7stgectxsg5p5esq5l7d9

Donate Cardano to this address

Scan the QR code or copy the address below into your wallet to send some Cardano

Scan to Donate Ethereum classic to 0xcD6CC972a2297FcafACDcfE042C55C69516a9264

Donate Ethereum classic to this address

Scan the QR code or copy the address below into your wallet to send some Ethereum classic

Subscribe for updates. Trust me, no spam!

Sponsored links

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

Upcoming events

Leave a Reply

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

Get the latest

On social media
Via my newsletter

Partner links

1. Attend Algorithm Conference, a top AI and ML event for 2021.
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.