Extend LVM Partition Without Downtime by Adding a New Disk (PV)

Problem Overview

  • In production systems, disk space can run out unexpectedly. Restarting servers to increase disk space is often not an option, especially for critical applications.

  • Linux LVM (Logical Volume Manager) allows you to extend storage online, without stopping services or rebooting the server.

  • In this guide, you’ll learn how to safely extend an LVM partition step by step while the system remains up and running.

  • This approach is widely used in enterprise environments and is a must-know skill for Linux administrators and DevOps engineers.

⚠️ Important Note: Do Not Shrink the Root Filesystem

  • Shrinking the root (/) filesystem is not recommended and is unsafe in real-world environments. The root volume is designed to be extended, not reduced. Once you increase the root filesystem, do not attempt to shrink it.
  • Attempting to shrink / can lead to filesystem corruption, and in many cases the system may fail to boot after a restart. Recovering such a system is extremely difficult and may even be impossible without a full rebuild.

Prerequisites

Before starting, make sure the following conditions are met:

  • The system is using LVM

  • A new disk has been attached to the server

  • You have root or sudo access

  • Filesystem is ext4 or xfs

  • You have verified current disk usage using the command df -h and lsblk

Solution

  • Confirm that the OS detects the newly added disk. You should see the new disk (for example /dev/sdb) without any partitions.
    • [root@pythonlinuxhub ~]# lsblk
      NAME             MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
      sda                8:0    0   20G  0 disk
      ├─sda1             8:1    0    1G  0 part /boot
      └─sda2             8:2    0   19G  0 part
        ├─rhel_10-root 253:0    0   17G  0 lvm  /
        └─rhel_10-swap 253:1    0    2G  0 lvm  [SWAP]
      sdb                8:16   0    4G  0 disk
      sr0               11:0    1 1024M  0 rom
  • Initialize the new disk as an LVM physical volume.

    • root@pythonlinuxhub ~]# pvcreate /dev/sdb
        Physical volume "/dev/sdb" successfully created.
      [root@pythonlinuxhub ~]# pvs
        PV         VG      Fmt  Attr PSize   PFree
        /dev/sda2  rhel_10 lvm2 a--  <19.00g    0
        /dev/sdb           lvm2 ---    4.00g 4.00g
  • Add the new physical volume to the existing volume group.
    • [root@pythonlinuxhub ~]# vgextend rhel_10 /dev/sdb
        Volume group "rhel_10" successfully extended
      [root@pythonlinuxhub ~]# vgs
        VG      #PV #LV #SN Attr   VSize  VFree
        rhel_10   2   2   0 wz--n- 22.99g <4.00g
      [root@pythonlinuxhub ~]#
  • You should now see additional free space available in the volume group.

  • Extend the logical volume using all available free space.

    • [root@pythonlinuxhub ~]# lvs
        LV   VG      Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
        root rhel_10 -wi-ao---- <17.00g
        swap rhel_10 -wi-ao----   2.00g
      [root@pythonlinuxhub ~]# lvextend -l +100%FREE /dev/rhel_10/root
        Size of logical volume rhel_10/root changed from <17.00 GiB (4351 extents) to 20.99 GiB (5374 extents).
        Logical volume rhel_10/root successfully resized.
      [root@pythonlinuxhub ~]# lvs
        LV   VG      Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
        root rhel_10 -wi-ao---- 20.99g
        swap rhel_10 -wi-ao----  2.00g
  • At this stage, the logical volume is extended, but the filesystem is not yet resized.

  • Resize the filesystem
    • For ext4 Filesystem
      • [root@pythonlinuxhub ~]# resize2fs /dev/rhel_10/root
    • For xfs Filesystem
      • [root@pythonlinuxhub ~]# xfs_growfs /
    • XFS requires the mount point, not the device path.
  • Verify the updated disk space. You should now see the increased space reflected on the mounted filesystem.
    • [root@pythonlinuxhub ~]# df -h
      Filesystem                Size  Used Avail Use% Mounted on
      devtmpfs                  4.0M     0  4.0M   0% /dev
      tmpfs                     1.8G     0  1.8G   0% /dev/shm
      tmpfs                     732M  9.3M  722M   2% /run
      /dev/mapper/rhel_10-root   21G  8.2G   13G  39% /
      /dev/sda1                 960M  372M  589M  39% /boot
      tmpfs                     366M   96K  366M   1% /run/user/1000
      [root@pythonlinuxhub ~]# lsblk
      NAME             MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
      sda                8:0    0   20G  0 disk
      ├─sda1             8:1    0    1G  0 part /boot
      └─sda2             8:2    0   19G  0 part
        ├─rhel_10-root 253:0    0   21G  0 lvm  /
        └─rhel_10-swap 253:1    0    2G  0 lvm  [SWAP]
      sdb                8:16   0    4G  0 disk
      └─rhel_10-root   253:0    0   21G  0 lvm  /
      sr0               11:0    1 1024M  0 rom

Note:

  • Always double-check device names before running LVM commands

  • Take a snapshot or backup before making storage changes

  • Avoid extending root volumes on production servers without proper validation

  • Monitor disk usage after extension to ensure stability

Shaik Mohammed Faruk

Software Engineer sharing practical tutorials and insights on Linux, Python, SQL, and modern technologies.

Read more About Me

0 0 votes
Article Rating
guest

14 Comments
Oldest
Newest Most Voted
trackback

[…] Extend LVM Partition Without Downtime by Adding a New Disk (PV) […]

f188game
1 month ago

The excitement on this site is next level! I had a great run last night and the customer support was super helpful. Give f188game a try for sure.

idasiabet
28 days ago

One of the best platforms I have used recently. Everything is straightforward and the graphics are top notch. Go for idasiabet

vnhitclubvin
28 days ago

The graphics are top-notch and the gameplay is very intuitive. I appreciate how straightforward the registration is. Definitely check out vnhitclubvin for some quality gaming.

jilionelogin
22 days ago

I’ve tried a few platforms recently but this one is surprisingly smooth. The login process is quick and I didn’t encounter any lags. Definitely a solid choice for local players. Check out jilionelogin for a great experience.

suksesjitulogin
20 days ago

Finally found a place that actually pays out without a headache. The interface is very user-friendly and the games are top notch. Check out suksesjitulogin if you want a reliable experience.

idjokerbola
18 days ago

The sports betting options are extensive and the odds are very competitive. I always use idjokerbola for my weekly picks.

betfalconsbet
16 days ago

The odds here are way better than the other sites I’ve used. Great for sports fans who actually know their stuff. Give betfalconsbet a try.

kv88
9 days ago

Solid platform with a very professional layout. I feel safe depositing my funds here because everything looks legit and secure. I trust kv88 for my daily plays.

bdnag88
8 days ago

Quick deposits and even quicker withdrawals. That is all I really care about and this site delivers every time. Big thanks to bdnag88.

krbetmgm
8 days ago

The bonuses here are insane! I managed to get a nice win on my first try today. Definitely spending more time on krbetmgm from now on.

vnofen88
7 days ago

Solid platform with a very secure feeling. I feel safe depositing and playing here without worrying about my data. Cheers to vnofen88

pkrs789
6 days ago

pkrs789 has a great community feel. The games are fair and the rewards are legit. I’ve spent a few hours here this week and I’m really enjoying the vibe.

bdq444
4 days ago

Solid performance and great variety of options. It is my go-to site whenever I want to relax and play. Cheers to bdq444.

Thanks for your interest!

Content for this is getting ready and will be published soon.

14
0
Would love your thoughts, please comment.x
()
x