Skip to content
Menu
vernon.wenberg.net
vernon.wenberg.net
October 16, 2023October 16, 2023

Expand Logical volume in Linux LVM

LVM makes it easy to resize volumes in Linux. This can be done without unmounting drives or
requiring a restart. First determine the free space of the group volume.

First determine the partition where your OS is installed.

fdisk -l

Expand the partition. Here we will assume that the partition is sda3.

growpart /dev/sda 3
pvresize /dev/sda3

You can view the volume grow using the command …

vgdisplay

Determine the path to the volume group and extend it using vgextend ubuntu-vg /dev/sda3
where ubuntu-vg is the group name and /dev/sda3 is a partition created using fdisk.

lvdisplay

Expand the logical volume into the group volume. You can specify a size (M for Megabytes, G for
Gigabytes, T for Terabytes) …

lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv

… or you can expand the logical volume into the remaining free space.

lvextend -L+19G /dev/ubuntu-vg/ubuntu-lv

Resize the filesystem.

resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to print (Opens in new window) Print
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn

Like this:

Like Loading...

Related

Disclaimer

These posts are notes for me. These are not guides and you should not use these instructions as step-by-step instructions without knowing what they do.

Recent Posts

  • Docker Reference
  • Useful Commands for Windows Subsystem for Linux
  • FortiManager Local-In Policy
  • Mount Google Drive in Linux using rclone
  • Restore original Explorer context menus in Windows 11

Mastodon

  1. Loading Mastodon feed...

©2025 vernon.wenberg.net | Powered by WordPress and Superb Themes!
%d