Set Up an Additional Disk


After you add a disk in the dashboard, set it up in the operating system.

Check Disk Names
Copy link

On Hostman, disks are usually named sd*. On servers created before May 2025, disks are named vd*.

The disk name in the dashboard may not match the actual name in your system. To see the actual disk names, run:

lsblk

Example output:

NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
loop1    7:1    0 63.9M  1 loop /snap/core20/2318
loop2    7:2    0   87M  1 loop /snap/lxd/29351
loop3    7:3    0 50.9M  1 loop /snap/snapd/24505
loop4    7:4    0 63.8M  1 loop /snap/core20/2599
loop5    7:5    0 89.4M  1 loop /snap/lxd/31333
loop6    7:6    0 50.9M  1 loop /snap/snapd/24718
sda      8:0    0   15G  0 disk 
└─sda1   8:1    0   15G  0 part /
sdb      8:16   0   10G  0 disk 
vda    252:0    0    1M  1 disk

In this example, sdb is the new disk. sda is the main system disk, and vda is reserved for cloud-init by default.

The commands below use sdb. Replace it with the actual disk name on your system.

Step 1. Create a Partition
Copy link

Start fdisk:

fdisk /dev/sdb

In fdisk:

  1. Press n to create a new partition.
  2. Press p to select a primary partition.
  3. Press Enter to accept the default values for the remaining options.
  4. Press w to write the changes and exit.

1964dcf0 B9a0 4c0f 9787 34ce903ce011

To verify that the partition was created, run lsblk:

lsblk

The new partition is sdb1.

NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda       8:0    0   25G  0 disk
├─sda1    8:1    0 24.9G  0 part /
├─sda14   8:14   0    4M  0 part
└─sda15   8:15   0  106M  0 part
sdb       8:16   0   10G  0 disk
└─sdb1    8:17   0   10G  0 part
vda     252:0    0    1M  1 disk

Step 2. Create a Filesystem
Copy link

Create a filesystem on the new partition. This example uses EXT4:

mkfs.ext4 /dev/sdb1

Step 3. Mount the Disk
Copy link

Mount the disk to a directory to start using it. Each disk needs its own mount point. For example, if you add another disk (sdc) later, mount it to a different directory.

Create a mount directory:

mkdir /mnt/disk2

Mount the disk:

mount -o barrier=0 /dev/sdb1 /mnt/disk2

Files you store in /mnt/disk2 are now written to the new disk.

Step 4. Add an Entry to /etc/fstab
Copy link

To keep the disk mounted after a reboot, add an entry to /etc/fstab.

You can reference the disk by its device name (for example, sdb1), but the name can change if you reattach disks or remove others. We recommend using a UUID instead, because it is unique and doesn't change.

To find the UUID, run:

lsblk -o NAME,UUID

Example output:

sda    
└─sda1 fcafbb78-fd6c-4083-82d8-3c06bd6ad4b1
sdb    
└─sdb1 534c6694-d2b0-4867-843b-b8a934bf0e5d
vda    041E-4E90

Here, the UUID of the new partition is 534c6694-d2b0-4867-843b-b8a934bf0e5d.

Open /etc/fstab:

nano /etc/fstab

Add the following line, replacing <disk-uuid> with the corect value:

UUID=<disk-uuid> /mnt/disk2 ext4 defaults 0 2