Skip to main content
To mount a new disk on Linux, find it with lsblk, create a partition with parted, format it with mkfs.ext4 (or mkfs.xfs), and mount it with sudo mount /dev/vdb1 /mnt/data. To mount it at every boot, add a line with its UUID to /etc/fstab, for example UUID=… /mnt/data ext4 defaults,nofail 0 2, and test with sudo mount -a.

Before you start

  • Connect with SSH. Commands use sudo; root users can leave it out.
  • Back up first. Choosing the wrong disk in the steps below erases it. Make sure you have a current backup of any disk that holds data. See back up a Linux server and, on a VPS, VPS Panel backups.
  • On a VPS, see which disks are attached on the Storage page. On a dedicated server, open a ticket if a disk you expect is missing.
  • Install the tools if needed: sudo apt install parted xfsprogs (Ubuntu / Debian) or sudo dnf install parted xfsprogs (AlmaLinux / Rocky).
Partitioning and formatting permanently delete everything on the disk you choose. Double-check the device name at every step. Never run these commands on the disk that holds / (your system disk).

How to find the new disk

Here vdb is the new disk: it has no partitions, no file system and no mount point. Names depend on the hardware: Confirm the disk is empty. This command only reads:
No output means no partition table or file system was found. If it lists anything, the disk is not empty: stop and check you have the right one.

How to partition and format the disk

1

Create a GPT partition table and one partition

GPT works for any size of disk. 1MiB 100% uses the whole disk with correct alignment.
2

Check the partition

You see vdb1 under vdb.
3

Format it

XFS can grow but cannot shrink. ext4 can do both (shrinking only while unmounted).

How to mount the disk

This mount lasts until the next reboot.

How to mount the disk automatically with fstab

Device names like /dev/vdb1 can change between boots. Use the file system’s UUID (a unique ID) in /etc/fstab instead.
1

Get the UUID

Use the UUID= value, not PARTUUID=.
2

Back up fstab

3

Add the line

Open /etc/fstab with sudo nano /etc/fstab and add one line at the end (use xfs instead of ext4 for XFS):
nofail lets the server finish booting even if this disk is missing. The last number 2 means “check this file system at boot, after the root file system”.
4

Check the file and test it

findmnt --verify should end with Success, no errors or warnings detected. mount -a mounts everything in fstab; if it prints an error, fix the line before you reboot.
A wrong line in /etc/fstab can drop the server into emergency mode at the next boot. Always run findmnt --verify and mount -a first, and keep nofail on extra disks. If the server does not boot, on a VPS use the VNC console or rescue mode to restore /etc/fstab.bak. On a dedicated server, use your KVM/IPMI console or open a ticket.

How to let a normal user write to the disk

A new file system belongs to root. To let user alex write to it:
See file permissions explained.

Frequently asked questions

Why can I not see my new disk in lsblk?

The disk may not be attached yet or may need a reboot to appear. On a VPS, check it is enabled on the Storage page. On a dedicated server, open a ticket.

Should I use ext4 or XFS?

Both are solid. Use the default of your distribution: ext4 on Ubuntu and Debian, XFS on AlmaLinux and Rocky. Choose ext4 if you might ever need to shrink the file system.

Do I need a partition, or can I format the whole disk?

You can format /dev/vdb directly, but a partition table makes the disk’s purpose clear to other tools and people, so it is the safer habit.

How do I mount the disk somewhere else, such as /var/www?

Use that folder as the mount point. Move existing files out first: anything already in the folder is hidden while the disk is mounted on top of it.

VPS and dedicated server guides

Every guide in this section.

Resize a partition after a disk upgrade

Use new space on an existing disk.

Use LVM on Linux

Combine and grow disks flexibly.

Check disk space

See free space with df.

VPS storage

Your disks in the VPS Panel.

Checked against the official Red Hat Enterprise Linux 9 file systems documentation and the util-linux findmnt, blkid and wipefs manual pages on 4 November 2026; parted, mkfs.ext4, mkfs.xfs, blkid, wipefs -n, a UUID fstab entry with nofail, findmnt --verify and mount -a tested on Ubuntu 24.04 LTS using a loop device. Commands can differ on other distributions or releases.

Need Extra Help?

If you encounter any issues, our support team is ready to assist:

Save on Your Hosting

Ready to upgrade your hosting? Use code KB20 at checkout for 20% off your first order!

Last Updated: November 2026