How to Expand a Linux Disk with LVM Without Rebooting
Learn step-by-step how to attach an unmounted 160 GB disk to a Linux server and expand its LVM logical volume without rebooting, covering disk inspection, partitioning, PV creation, VG extension, LV resizing, and filesystem growth using df, fdisk, pvcreate, vgextend, lvextend, and xfs_growfs.
A server was provisioned as a virtual machine showing only about 30 GB of usable space with df -h, while fdisk -l revealed an unmounted 160 GB disk that needed to be added without rebooting.
Below is a brief overview of Logical Volume Management (LVM), a flexible Linux storage subsystem that allows administrators to create, resize, and delete logical volumes (LV) on top of physical volumes (PV) without affecting existing data or requiring a reboot.
The LVM hierarchy consists of physical disks/partitions → physical volumes (PV) → volume groups (VG) → logical volumes (LV) → file systems, which can be mounted and accessed by the OS.
Case Study: Disk Expansion
1. Check current disk usage
df -h
2. List all disks to find the 160 GB device
fdisk -l
3. Create a new partition of type 8e for LVM
fdisk /dev/sdb
4. Initialize the partition as a physical volume
pvcreate /dev/sdb Physical volume "/dev/sdb" successfully created
5. Verify the physical volume
pvdisplay
6. Extend the volume group with the new PV
vgextend centos /dev/sdb Volume group "centos" successfully extended
7. Inspect the volume group
vgdisplay
8. Resize the logical volume to use all free space
lvextend -l +100%FREE /dev/mapper/centos-root Size of logical volume centos/root changed from 35.47 GiB (9080 extents) to 185.50 GiB (47489 extents). Logical volume root successfully resized.
9. Grow the XFS filesystem
xfs_growfs /dev/mapper/centos-root
10. Verify the expanded space
References:
https://linux.cn/article-3218-1.html
https://www.cnblogs.com/kevingrace/p/5825963.html
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
