How to Mount and Format Additional Disks on a Linux VPS

Many VPS plans support attaching additional block storage volumes beyond the primary disk. This guide covers formatting and mounting an additional disk on Linux.

Step 1 — Identify the New Disk

lsblk

Lists all block devices — identify the new, unformatted disk (typically shown with no filesystem type and no mount point), commonly something like /dev/sdb or /dev/vdb.

Step 2 — Verify It's Genuinely Unused (Important)

sudo fdisk -l /dev/sdb

Double-check you've identified the correct, new disk before proceeding — formatting the wrong disk destroys its existing data irreversibly.

Step 3 — Create a Partition (Optional but Common)

sudo fdisk /dev/sdb
n    # new partition
p    # primary
1    # partition number
     # accept default first/last sector
w    # write changes

You can also format the raw disk directly without partitioning for simpler single-purpose volumes — partitioning offers more flexibility if you might later divide the disk further.

Step 4 — Format the Partition with a Filesystem

sudo mkfs.ext4 /dev/sdb1

ext4 is a solid, widely-used default; XFS is another common choice, sometimes preferred for very large filesystems or specific performance characteristics.

Step 5 — Create a Mount Point

sudo mkdir /mnt/data

Step 6 — Mount the Disk

sudo mount /dev/sdb1 /mnt/data

Step 7 — Verify the Mount

df -h /mnt/data

Step 8 — Make the Mount Persistent Across Reboots

A mount performed manually doesn't survive a reboot unless added to /etc/fstab:

sudo blkid /dev/sdb1
sudo nano /etc/fstab
UUID=your-disk-uuid-here /mnt/data ext4 defaults 0 2

Using the UUID (rather than the device name like /dev/sdb1) is more reliable, since device naming can occasionally shift between boots depending on detection order.

Step 9 — Test the fstab Entry

sudo umount /mnt/data
sudo mount -a

mount -a mounts everything listed in fstab — if this succeeds without errors, your entry is correctly configured and will work on the next actual reboot.

Setting Correct Ownership and Permissions

sudo chown -R youruser:yourgroup /mnt/data

Resizing an Existing Disk (After a Provider-Side Expansion)

sudo growpart /dev/sdb 1
sudo resize2fs /dev/sdb1

If your VPS provider expanded the underlying disk size, the partition and filesystem need to be separately resized to actually use the additional space.

Common Errors

"wrong fs type, bad option, bad superblock" on mount — verify the disk was actually formatted successfully in Step 4, and that the filesystem type specified in the mount command matches what was actually created.

System fails to boot after editing fstab — a malformed fstab entry can prevent boot; always test with mount -a before rebooting, and keep console/rescue access available as a fallback.

Continue Reading

Browse more articles in Linux Server Administration.

  • mount disk linux, format additional storage, fstab configuration, add volume vps
  • 0 Benutzer fanden dies hilfreich
War diese Antwort hilfreich?

Verwandte Artikel

How to Update and Upgrade Your Ubuntu or Debian VPS

Keeping your VPS updated is one of the most important and simplest maintenance tasks — it...

How to Enable and Configure Swap on a Linux VPS (Ubuntu & Debian)

Swap is disk space Linux can use as overflow memory when physical RAM is exhausted. It won't make...

How to Manage Services with systemd and systemctl

systemd is the service manager used by Ubuntu, Debian, and most modern Linux distributions to...

How to Read and Analyze Linux Logs with journalctl

On modern Ubuntu and Debian systems, journalctl is the central tool for viewing system and...

How to Schedule Tasks with Cron on a Linux VPS

Cron is the standard Linux job scheduler, used to automate recurring tasks like backups, log...