Adding a volume to a VPS — for uploads, backups or a database that outgrew the root disk — takes four commands and one line in a file. The one line is where people get it wrong and end up with a server that will not boot. Here is the sequence, with the safe way to write the fstab entry.
1. Find the new disk
lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 80G 0 disk
└─vda1 253:1 0 80G 0 part /
vdb 253:16 0 200G 0 diskvdb with no partitions and no mountpoint is the new one. Names vary: sdb on some hypervisors, nvme1n1 on NVMe, xvdf on AWS. Confirm with sudo fdisk -l /dev/vdb — it should show no existing partition table. Formatting the wrong device destroys its data with no undo; check twice.
2. Partition (optional but conventional)
A single partition using the whole disk:
sudo parted /dev/vdb --script mklabel gpt mkpart primary ext4 0% 100%
lsblk /dev/vdbYou can format the raw device without a partition table and it works fine; a partition table just makes the disk's purpose obvious to the next admin and to tools.
3. Format
ext4 — the default Linux filesystem; reliable, well understood, can be shrunk. XFS — the default on AlmaLinux/Rocky; excellent for large files and parallel I/O, cannot be shrunk. For a web server's uploads or backups, either is right.
sudo mkfs.ext4 -L data /dev/vdb1
# or
sudo mkfs.xfs -L data /dev/vdb1-L data sets a label you can mount by.
4. Mount
sudo mkdir -p /mnt/data
sudo mount /dev/vdb1 /mnt/data
df -h /mnt/data5. Make it permanent — by UUID
Device names like /dev/vdb can change between boots when disks are added or removed. The UUID does not. Get it:
sudo blkid /dev/vdb1
# /dev/vdb1: LABEL="data" UUID="3f8a1c2e-...." TYPE="ext4"Add to /etc/fstab:
UUID=3f8a1c2e-.... /mnt/data ext4 defaults,nofail 0 2nofail is the important word: if the disk is missing at boot, the system boots anyway instead of dropping to an emergency shell. For XFS, the type is xfs and the last number 0.
Test the line before rebooting:
sudo umount /mnt/data
sudo mount -a
df -h /mnt/dataIf mount -a errors, fix the fstab line now, while you still have a running system. On systemd, also run sudo systemctl daemon-reload so the generated mount unit updates.
6. Move a directory onto the new disk
To move, say, a site's uploads without changing any application config, copy the data, then bind-mount or symlink:
sudo rsync -a /var/www/example.com/httpdocs/wp-content/uploads/ /mnt/data/uploads/
sudo mv /var/www/example.com/httpdocs/wp-content/uploads /var/www/example.com/httpdocs/wp-content/uploads.old
sudo ln -s /mnt/data/uploads /var/www/example.com/httpdocs/wp-content/uploadsCheck ownership on the new location matches (chown -R user:group), load the site, then delete uploads.old once you are sure. For MySQL's data directory, stop the service first, rsync -a with the directory ending in /, update datadir in the config (and the AppArmor/SELinux policy for the new path), then start — test on a copy first; it is the one move that can take a database down if the permissions are wrong.
Growing a disk later
If the provider enlarges the volume in place, the filesystem does not grow automatically:
sudo growpart /dev/vdb 1 # extend the partition (cloud-guest-utils)
sudo resize2fs /dev/vdb1 # ext4, online
sudo xfs_growfs /mnt/data # XFS, online, by mountpointBoth work while mounted.
Checking health
sudo smartctl -a /dev/vdb | grep -iE "health|reallocated|pending" # physical disks
sudo tune2fs -l /dev/vdb1 | grep -i "mount count\|last checked" # ext4 fsck historyOn a VPS, the disk is virtual and its health is the host's concern. On a VPSPioneer managed VPS, extra volumes are attached, formatted and mounted by us on request, with the fstab written the safe way above, and they are included in the nightly backups by default.