How to Use Additional Disks on a Linux Server
After a fresh installation, the operating system is on the first disk. Installation clears all disks; additional disks need to be set up before use: this page shows how to make a disk usable as a folder, for example /data, that is there again after every restart. The commands were tested on Ubuntu 26.04 LTS; run them as root.
To join several disks into one that survives a disk failure, see How to Create Software RAID on a Dedicated Server instead.
1. Find the Empty Disk
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS
The system disk has partitions mounted at /, /boot and so on, usually sda or nvme0n1. An empty disk has no partitions and no mount point, for example:
sdb 3.6T disk
The next steps erase the disk. Never use the disk that holds /. Below the empty disk is sdb; use your own name.
2. Partition and Format It
parted /dev/sdb --script mklabel gpt mkpart data ext4 0% 100% mkfs.ext4 -L data /dev/sdb1
The first line creates one partition over the whole disk, sdb1. The second formats it with the ext4 file system; on a 4 TB disk this takes about 20 seconds.
3. Mount It Permanently
Create the folder and find the disk's UUID, its fixed ID:
mkdir /data blkid -s UUID -o value /dev/sdb1
Add a line with that UUID to the end of /etc/fstab (for example with nano /etc/fstab):
UUID=3f2a9c1e-7b4d-4e8a-9c21-5d6f0a1b2c3d /data ext4 defaults,nofail 0 2
Use the UUID instead of /dev/sdb1: disk names can change after a restart, the UUID does not. nofail lets the server start even if this disk fails.
Load the change and mount everything from /etc/fstab:
systemctl daemon-reload mount -a df -h /data
df shows the new drive with its size. If mount -a reports an error, fix the line in /etc/fstab before you restart.
The folder belongs to root. To let your user write into it:
chown alex:alex /data
Before You Reinstall Linux
Installing or reinstalling Linux from the Client Area erases all data on all disks of the server, including the additional disks and any software RAID on them. Keep a backup outside the server before you reinstall: Back Up Your Linux Server Before a Reinstall. See also Reinstalling your Dedicated Server.
After the reinstall, set up the disks again as described above.