Operations 9 min read

How to Expand and Remount a Linux Disk from 500GB to 2TB Without Data Loss

This guide walks you through expanding a Linux block device from 500 GB to 2 TB, adjusting the partition table with fdisk, resizing ext4 filesystems, remounting the volume, and configuring persistent or on‑demand mounts via fstab, rc.local, systemd, and autofs.

Liangxu Linux
Liangxu Linux
Liangxu Linux
How to Expand and Remount a Linux Disk from 500GB to 2TB Without Data Loss

1. Prepare and Inspect the Disk

Use fdisk -l to list current disks and note the start sector of the target partition (e.g., /dev/vdc1 starts at 2048 and ends at 1048575999). Record the start value because it must remain unchanged when recreating the partition.

2. Unmount the Filesystem

Before modifying the partition, unmount it:

umount /data

3. Resize the Partition with fdisk

Launch fdisk on the disk: fdisk /dev/vdc Press p to print the current table.

Press d and select the partition number to delete it (do not save yet).

Press n to create a new primary partition, reuse the original partition number (1).

Set the start sector to the previously recorded value (e.g., 2048).

Set the last sector to the end of the disk (e.g., 4194303999) or to the desired size.

Press w to write the table and exit.

4. Check and Resize the Filesystem

For ext4 filesystems, run:

e2fsck -f /dev/vdc1
resize2fs /dev/vdc1

The partition should now report the larger size (e.g., from 453 GB to ~1.8 TB).

5. Remount and Verify

Confirm the new size with:

lsblk
mount
df -h

The filesystem should be mounted on /data with the expanded capacity.

6. Persistent Mount Options

/etc/fstab

Add an entry to /etc/fstab so the mount survives reboots:

/dev/vdc1  /data  ext4  defaults,nofail  0 0

/etc/rc.local

Alternatively, place the mount command in /etc/rc.local:

mount /dev/vdc1 /data/

systemd Mount Unit

Create a unit file (e.g., /etc/systemd/system/mnt-volume.mount) with the following content:

[Unit]
Description=Mount DO Volume volume

[Mount]
What=/dev/disk/by-uuid/d946870c-ef31-48ee-a9f1-446acaa56f46
Where=/mnt/volume
Options=defaults,nofail,discard,noatime
Type=ext4

[Install]
WantedBy=multi-user.target

Manage it with standard systemd commands:

systemctl status mnt-volume.mount
systemctl enable mnt-volume.mount
systemctl start mnt-volume.mount
systemctl stop mnt-volume.mount

autofs

For on‑demand mounting, install autofs: yum install autofs -y Configure /etc/auto.master and related maps to mount the device only when accessed, with automatic unmount after inactivity.

7. Common Errors and Fixes

Read‑only (write‑protected) mount

If the filesystem is mounted read‑only, reformat it (e.g., mkfs.ext4 /dev/sdb1) and remount.

Superblock cannot be read

Run a low‑level check: fsck.ext3 -B 1024 /dev/vdb Then remount the filesystem.

8. Summary of Steps

Unmount the target mount point.

Record the start sector of the existing partition.

Delete the partition with fdisk (do not save yet).

Create a new partition using the same number and start sector, extending the end sector to the desired size.

Write the changes and exit fdisk.

Run e2fsck -f and resize2fs for ext2/3/4, or xfs_growfs for XFS.

Remount the filesystem and verify with df -h.

Configure persistent or on‑demand mounts via fstab, rc.local, systemd, or autofs as needed.

These procedures apply to standard block devices; logical volume management requires a different approach.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxMountfdiskSystemdautofs
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.