Here are the steps to quick format and permanently mount an additional hard drive in Linux (Debian/Ubuntu):
-
Open a ticket and make sure we have mounted your additional large storage. Once we have done so, you will be notified and your VPS will need to be restarted for the disk to be visible to the OS.
-
SSH to your server and use the command
lsblk
to check the name and partition of the newly added hard drive. It will be listed as a block device and will typically be named/dev/vdb
-
Use the command
fdisk /dev/vdb
(or the appropriate name for your hard drive in place of 'vdb') to open the fdisk utility and partition the hard drive. -
Use the command
n
to create a new partition, thenp
to create a primary partition. Select the default options for the first and last sectors to create a partition that fills the entire hard drive. -
Use the command
w
to write the changes to the hard drive and exit fdisk. -
Format the new partition using the command
mkfs.ext4 /dev/vdb1
(or the appropriate name for your partition). This process will take a few minutes depending on the size of your block storage, be patient. -
Create a mount point for the new partition using the command
mkdir /hdd
. -
Use the command
mount /dev/vdb1 /hdd
to mount the new partition. -
To make the partition mount automatically on boot, add the following line to the file
/etc/fstab
:/dev/vdb1 /hdd ext4 defaults 0 0
-
Verify the new partition is properly mounted by using the command
df -h
. This should show /dev/vdb1 and it's size mounted to /hdd - That's it! Enjoy your new persistent large storage space.
Notes: The above instructions are very simplistic and generated with Debian/Ubuntu in mind, use ext4 file system, and make some basic assumptions about disk name and where to mount.