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
Run the steps below only on the new disk: the one of the size you bought, with no partitions and no mount point.
-
Connect to the VPS over SSH as root.
-
Run
lsblkand find the new disk: the one of the size you bought, with no partitions and no mount point, such as/dev/vdbor/dev/sdb. -
Create a partition that fills the disk, replacing
/dev/vdbwith your disk:parted /dev/vdb --script mklabel gpt mkpart primary ext4 0% 100% -
Format the partition. Run
lsblkagain to see its name, such as/dev/vdb1:mkfs.ext4 /dev/vdb1 -
Create a folder and mount the partition on it:
mkdir -p /mnt/datamount /dev/vdb1 /mnt/data -
Run
blkid /dev/vdb1and copy itsUUID. -
Add a line to
/etc/fstabso the disk mounts again after a reboot, using the UUID you copied:UUID=<your-uuid> /mnt/data ext4 defaults,nofail 0 2 -
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
Initialize and format only the new disk: the one marked Unknown and Not Initialized, with Unallocated space.
- Connect to the VPS over Remote Desktop.
- Right-click Start and open Disk Management.
- 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.
- Right-click the disk's Unallocated space and select New Simple Volume.
- 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.