Step‑by‑Step Guide to Expanding a Mounted Linux Disk with XFS
This article explains how to identify a full disk, prepare the environment, partition and format a new disk, update fstab, copy data, and verify the expansion using Linux commands such as fdisk, mkfs.xfs, mount, and du.
When a mounted disk (e.g., /dev/sdb mounted at /apps) reaches high usage (over 85%), you can expand storage by adding a new disk (e.g., /dev/sdc).
Initial disk list (output of lsblk) shows existing disks sda, sdb, and sdc.
Environment preparation :
Create the mount point: mkdir /apps Partition the existing disk: fdisk /dev/sdb Format the new partition with XFS: mkfs.xfs /dev/sdb1 Verify the filesystem: blkid /dev/sdb1 Edit /etc/fstab to add an entry for automatic mounting.
Disk expansion :
Create a new mount point: mkdir /data Partition the added disk: fdisk /dev/sdc Format the new partition: mkfs.xfs /dev/sdc1 Verify the new filesystem: blkid /dev/sdc1 Edit /etc/fstab to mount /dev/sdc1 at /data on boot.
Copy existing data: cp -a /apps/. /data/ Compare sizes to confirm successful copy: du -sh /apps and du -sh /data Unmount the original mount point: umount /apps After these steps, the new disk provides additional space (e.g., 30 GB with only 1 % used) and the system continues to operate with the expanded storage.
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.
Practical DevOps Architecture
Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.
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.
