Guides ยท Oct 15, 2026
How to Format and Mount an Extra Disk on an Ubuntu VPS
Step-by-step: find a new data disk with lsblk, create a filesystem, mount it, make the mount permanent in fstab with the UUID.
If you add a separate data disk to a server, Linux sees it as another block device. On TidalVPS add-on storage the disk is mounted for you automatically. This guide is for any time you need to do it by hand, check that it was done correctly, or understand what is happening on a server where a disk shows up unformatted.
Read this first: formatting a disk erases everything on it. Only format a disk that is new and empty, and double-check the device name before every destructive command.
1. See which disks the server has
lsblk -f
The system disk usually has partitions mounted at / and /boot. A new, unused data disk appears with no partitions, no filesystem and no mount point, for example vdb or sdb. Device names differ between servers, so use the name you actually see. This guide uses /dev/sdb as an example.
If the disk already shows a filesystem and a mount point, it is already set up and you can stop here.
2. Create a filesystem
For a whole-disk data volume, ext4 is a safe default:
sudo mkfs.ext4 -L data /dev/sdb
The -L data part gives the filesystem a label. If you would rather have a partition table first, create one with sudo parted /dev/sdb mklabel gpt mkpart primary ext4 0% 100% and format /dev/sdb1 instead.
3. Mount it
sudo mkdir -p /mnt/data
sudo mount /dev/sdb /mnt/data
df -h /mnt/data
df -h should show the full size of the new disk.
4. Make the mount permanent
A mount made with the command above disappears on reboot. Find the filesystem UUID, which stays the same even if the device name changes:
sudo blkid /dev/sdb
Add a line to /etc/fstab using that UUID:
sudo cp /etc/fstab /etc/fstab.bak
echo 'UUID=PASTE-YOUR-UUID-HERE /mnt/data ext4 defaults,nofail 0 2' | sudo tee -a /etc/fstab
sudo mount -a
The nofail option lets the server still boot if the disk is ever missing, so a storage problem does not lock you out. If mount -a prints an error, fix the line right away: restore the backup with sudo cp /etc/fstab.bak /etc/fstab and try again.
5. Set ownership and use it
sudo chown -R alex:alex /mnt/data
Replace alex with your user. Point your application at the new path: for example a game server world folder, a media library, database dumps or backup archives. If a database should use the disk, stop it, move its data directory, update its configuration and start it again.
6. Keep an eye on space
df -h
sudo du -xh /mnt/data --max-depth=1 | sort -h | tail
Disks fill up silently. Set a reminder to check them, or use a monitoring tool such as Uptime Kuma. A bigger disk is not a backup, so keep copies elsewhere too: see restic backups for a VPS.
Troubleshooting
- wrong fs type or bad superblock: the disk has no filesystem yet. Run the
mkfsstep (on an empty disk only). - The disk is not in lsblk: add-on disks may take a moment, and some changes need a reboot. Check your service page or contact support.
- The mount is gone after reboot: the fstab line is missing or has a wrong UUID. Compare it with
blkid.
Frequently asked questions
How do I mount a new disk on Ubuntu?
Find it with lsblk, create a filesystem with mkfs.ext4, mount it to a folder with mount, and add its UUID to /etc/fstab so it mounts at every boot.
Will formatting delete my data?
Yes. mkfs erases the disk. Only format a new, empty disk and confirm the device name first.
Why use the UUID in fstab instead of /dev/sdb?
Device names such as sdb can change between boots. The UUID identifies the filesystem itself and stays the same.
What does nofail do in fstab?
It lets the server finish booting even if that disk is not available, so you can still log in and fix the problem.
Related guides
- Automated Encrypted VPS Backups with restic (Step by Step)
- How to Secure a New Ubuntu VPS (First 10 Minutes)
- UFW Firewall on an Ubuntu VPS: Rules, Rate Limiting and Docker Caveats
Need a server for this?
Every TidalVPS VPS comes with full root access, unmetered traffic, daily backups and DDoS protection.