{"id":4291,"date":"2026-09-12T15:40:49","date_gmt":"2026-09-12T10:10:49","guid":{"rendered":"https:\/\/cpanelfree.com\/blog\/how-to-resize-expand-lvm-disk-partitions-linux-vps\/"},"modified":"2026-09-12T15:40:49","modified_gmt":"2026-09-12T10:10:49","slug":"how-to-resize-expand-lvm-disk-partitions-linux-vps","status":"publish","type":"post","link":"https:\/\/cpanelfree.com\/blog\/how-to-resize-expand-lvm-disk-partitions-linux-vps\/","title":{"rendered":"How to Resize and Expand LVM Disk Partitions on Linux VPS Without Rebooting"},"content":{"rendered":"<div style=\"background-color: #0f172a;border-left: 4px solid #818cf8;padding: 18px 22px;margin-bottom: 25px;border-radius: 6px\">\n  <strong style=\"color: #818cf8;font-size: 16px\">Quick Technical Answer:<\/strong><\/p>\n<p style=\"color: #cbd5e1;margin: 8px 0 0 0;font-size: 15px;line-height: 1.6\">\n    To expand an LVM partition on a running Linux VPS without rebooting: First, rescanning the SCSI block device using <code>echo 1 | sudo tee \/sys\/class\/block\/sdX\/device\/rescan<\/code>. If using a partition table, expand it with <code>sudo growpart \/dev\/sdX 3<\/code>. Then, expand the Physical Volume with <code>sudo pvresize \/dev\/sdX3<\/code>. Next, extend the Logical Volume to fill all available space using <code>sudo lvextend -l +100%FREE \/dev\/ubuntu-vg\/ubuntu-lv<\/code>. Finally, expand the filesystem live: <code>sudo resize2fs \/dev\/ubuntu-vg\/ubuntu-lv<\/code> (for ext4) or <code>sudo xfs_growfs \/<\/code> (for XFS).\n  <\/p>\n<\/div>\n<h2>The Power of Logical Volume Manager (LVM) for Cloud Infrastructure<\/h2>\n<p>When upgrading cloud VPS hosting plans to acquire more disk space, traditional standard partition schemes (such as MBR or raw GPT tables) historically required booting into a live rescue ISO, unmounting the root partition, running <code>gparted<\/code>, and hoping file system structures remained intact.<\/p>\n<p><strong>Logical Volume Management (LVM)<\/strong> abstracts physical hard drives into a dynamic, pooled storage architecture. In LVM:<\/p>\n<ul>\n<li><strong>Physical Volumes (PV)<\/strong> represent raw storage devices or partitions (e.g. <code>\/dev\/sda3<\/code>).<\/li>\n<li><strong>Volume Groups (VG)<\/strong> pool physical volumes into a shared storage allocation pool (e.g. <code>ubuntu-vg<\/code>).<\/li>\n<li><strong>Logical Volumes (LV)<\/strong> carve out virtual block slices from the pool and host your actual formatted file systems (e.g. <code>\/dev\/ubuntu-vg\/ubuntu-lv<\/code> mounted on <code>\/<\/code>).<\/li>\n<\/ul>\n<p>With LVM, expanding your server&#8217;s root storage after purchasing additional disk capacity takes less than 60 seconds from the command line\u2014with <strong>100% live uptime and zero reboot required<\/strong>.<\/p>\n<h2>Step 1: Inspecting Current Disk &amp; LVM Architecture<\/h2>\n<p>Begin by verifying your current disk hierarchy and identifying whether your filesystem is formatted as <strong>ext4<\/strong> or <strong>XFS<\/strong>:<\/p>\n<pre><code style=\"color: #38bdf8\"># Inspect block device hierarchy and mount points\nlsblk\n\n# Check filesystem type on root partition\ndf -Th \/\n\n# Display current LVM allocations\nsudo pvs\nsudo vgs\nsudo lvs<\/code><\/pre>\n<h2>Step 2: Rescanning the Virtual SCSI Controller<\/h2>\n<p>After resizing your disk in the cloud hosting provider&#8217;s dashboard (e.g. expanding from 25GB to 50GB), the Linux kernel must be signaled to re-read the SCSI hardware geometry without rebooting:<\/p>\n<pre><code style=\"color: #38bdf8\"># Rescan the primary SCSI drive (replace sda with your drive name)\necho 1 | sudo tee \/sys\/class\/block\/sda\/device\/rescan\n\n# Verify the kernel detected the new physical capacity\nsudo dmesg | tail -n 10\nlsblk \/dev\/sda<\/code><\/pre>\n<h2>Step 3: Expanding the Partition Table with growpart<\/h2>\n<p>If your Physical Volume resides inside a partitioned disk slice (e.g. <code>\/dev\/sda3<\/code>), the partition boundary must be updated to encompass the newly appended disk blocks:<\/p>\n<pre><code style=\"color: #38bdf8\"># Install cloud-guest-utils to acquire growpart utility\nsudo apt update &amp;&amp; sudo apt install -y cloud-guest-utils\n\n# Expand partition 3 on device \/dev\/sda (note the space between device and partition number)\nsudo growpart \/dev\/sda 3\n\n# Verify the partition grew\nlsblk \/dev\/sda<\/code><\/pre>\n<h2>Step 4: Resizing Physical Volume &amp; Extending Logical Volume<\/h2>\n<p>Now instruct LVM to acknowledge the expanded partition and allocate the newly available extents directly to your logical volume:<\/p>\n<pre><code style=\"color: #38bdf8\"># 1. Resize Physical Volume to consume full partition space\nsudo pvresize \/dev\/sda3\n\n# 2. Verify free space inside the Volume Group\nsudo vgs\n\n# 3. Extend the Logical Volume to allocate 100% of unassigned space\nsudo lvextend -l +100%FREE \/dev\/ubuntu-vg\/ubuntu-lv<\/code><\/pre>\n<h2>Step 5: Expanding the Filesystem Online (Zero Downtime)<\/h2>\n<p>Extending the logical volume provides raw block capacity, but your operating system&#8217;s filesystem must expand its inode and block allocation tables. Choose the command corresponding to your filesystem format:<\/p>\n<h3>For ext4 Filesystems:<\/h3>\n<pre><code style=\"color: #38bdf8\"># Expand ext4 filesystem live while mounted\nsudo resize2fs \/dev\/ubuntu-vg\/ubuntu-lv<\/code><\/pre>\n<h3>For XFS Filesystems:<\/h3>\n<pre><code style=\"color: #38bdf8\"># Expand XFS filesystem live (target must be the MOUNT POINT, not device)\nsudo xfs_growfs \/<\/code><\/pre>\n<h2>Step 6: Verification of Successful Online Expansion<\/h2>\n<p>Verify that your root partition reflects the expanded capacity immediately:<\/p>\n<pre><code style=\"color: #38bdf8\">df -h \/<\/code><\/pre>\n<p>You will observe your available space increased instantly without dropping a single active HTTP connection, database query, or background process.<\/p>\n<h2>Pro Sysadmin Tip: Never Shrink XFS Filesystems<\/h2>\n<p>While <strong>ext4<\/strong> filesystems support both expansion and offline shrinking, <strong>XFS<\/strong> is an append-only allocation filesystem that fundamentally does not support shrinking. Attempting to reduce an XFS partition will cause unrecoverable data loss. Always allocate space incrementally.<\/p>\n<h2>Frequently Asked Questions (FAQ)<\/h2>\n<div style=\"margin: 20px 0\">\n<h3 style=\"color: #818cf8;margin-bottom: 5px\">Does expanding an LVM partition cause data loss?<\/h3>\n<p style=\"color: #cbd5e1;font-size: 15px\">No. <code>pvresize<\/code>, <code>lvextend<\/code>, and online filesystem tools like <code>resize2fs<\/code> are non-destructive operations engineered specifically for live cloud servers. However, taking a snapshot backup before altering partitions is always recommended best practice.<\/p>\n<h3 style=\"color: #818cf8;margin-bottom: 5px\">Why does growpart give &#8220;NOCHANGE: partition 3 is size&#8230; cannot be grown&#8221;?<\/h3>\n<p style=\"color: #cbd5e1;font-size: 15px\">This means the Linux kernel has not yet acknowledged the new physical disk capacity from the hypervisor. Ensure you executed the SCSI rescan command: <code>echo 1 | sudo tee \/sys\/class\/block\/sda\/device\/rescan<\/code> first.<\/p>\n<\/div>\n<div style=\"background-color: #0f172a;border-left: 4px solid #818cf8;padding: 18px 24px;margin: 30px 0;border-radius: 8px\">\n<h3 style=\"color: #818cf8;margin-top: 0\">\ud83d\udd17 Recommended Related Technical Guides<\/h3>\n<ul style=\"margin-bottom: 0;color: #cbd5e1\">\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-migrate-large-wordpress-sites-without-timeouts\/\" style=\"color: #38bdf8;text-decoration: underline\">Migrating Large Websites Without Server Timeouts<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-automatically-backup-linux-vps-s3\/\" style=\"color: #38bdf8;text-decoration: underline\">Automating Encrypted Linux VPS Backups to S3 Storage<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-clean-wp-options-table-transients\/\" style=\"color: #38bdf8;text-decoration: underline\">Cleaning Database Bloat &amp; Optimizing Table Queries<\/a><\/li>\n<\/ul>\n<\/div>\n<div style=\"background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);color: #ffffff;padding: 28px;border-radius: 12px;margin: 35px 0;text-align: center\">\n<h3 style=\"color: #ffffff;margin-top: 0;font-size: 22px\">Scale Storage Effortlessly on CpanelFree Cloud VPS<\/h3>\n<p style=\"color: #e0f2fe;font-size: 15px;max-width: 650px;margin: 0 auto 18px auto\">Instantly expand disk partitions, RAM, and compute cores on the fly with zero migration downtime on CpanelFree infrastructure.<\/p>\n<p>  <a href=\"https:\/\/cpanelfree.com\/\" style=\"background-color: #ffffff;color: #0284c7;font-weight: 700;padding: 12px 28px;border-radius: 8px;text-decoration: none;display: inline-block\">Get Scalable Cloud Hosting &rarr;<\/a>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Quick Technical Answer: To expand an LVM partition on a running Linux VPS without rebooting: First, rescanning the SCSI block device using echo 1 | sudo tee \/sys\/class\/block\/sdX\/device\/rescan. If using a partition table, expand it with sudo growpart \/dev\/sdX 3. Then, expand the Physical Volume with sudo pvresize \/dev\/sdX3. Next, extend the Logical Volume to &#8230; <a title=\"How to Resize and Expand LVM Disk Partitions on Linux VPS Without Rebooting\" class=\"read-more\" href=\"https:\/\/cpanelfree.com\/blog\/how-to-resize-expand-lvm-disk-partitions-linux-vps\/\" aria-label=\"Read more about How to Resize and Expand LVM Disk Partitions on Linux VPS Without Rebooting\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":4290,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88,51],"tags":[],"class_list":["post-4291","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud-vps","category-tutorials"],"_links":{"self":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/4291","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/comments?post=4291"}],"version-history":[{"count":0,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/4291\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/media\/4290"}],"wp:attachment":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/media?parent=4291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/categories?post=4291"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/tags?post=4291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}