Skip to main content

Prepare a new disk on a VPS

A disk added as an add-on arrives empty and isn't mounted. Before you store anything on it, create a partition, format it, and mount it. To buy a disk, see Buy an add-on.

On Linux​

Use only the new disk

Run the steps below only on the new disk: the one of the size you bought, with no partitions and no mount point.

  1. Connect to the VPS over SSH as root.

  2. Run lsblk and find the new disk: the one of the size you bought, with no partitions and no mount point, such as /dev/vdb or /dev/sdb.

  3. Create a partition that fills the disk, replacing /dev/vdb with your disk:

    parted /dev/vdb --script mklabel gpt mkpart primary ext4 0% 100%
  4. Format the partition. Run lsblk again to see its name, such as /dev/vdb1:

    mkfs.ext4 /dev/vdb1
  5. Create a folder and mount the partition on it:

    mkdir -p /mnt/data
    mount /dev/vdb1 /mnt/data
  6. Run blkid /dev/vdb1 and copy its UUID.

  7. Add a line to /etc/fstab so the disk mounts again after a reboot, using the UUID you copied:

    UUID=<your-uuid> /mnt/data ext4 defaults,nofail 0 2
  8. Run mount -a. No output means the line is correct.

Use the UUID in /etc/fstab, not the device name. A device name such as /dev/vdb can change after a reboot, and the UUID can't. With nofail, the VPS still starts if the disk is missing.

On Windows​

Use only the new disk

Initialize and format only the new disk: the one marked Unknown and Not Initialized, with Unallocated space.

  1. Connect to the VPS over Remote Desktop.
  2. Right-click Start and open Disk Management.
  3. If Windows asks to initialize the new disk, choose GPT and select OK. Otherwise, right-click the disk marked Unknown and Not Initialized, and select Initialize Disk.
  4. Right-click the disk's Unallocated space and select New Simple Volume.
  5. Follow the wizard: keep the full size, pick a drive letter, and format it as NTFS.

Result: the disk appears in File Explorer under its drive letter and comes back after every restart.