You can create and attach new volumes in four main contexts:
No matter how you create a new volume, before it’s ready for use for the first time, you’ll need to format and mount it.
You can create and attach a new volume or attach an existing volume at the same time you create a Droplet in the Add block storage section. When you choose to add a volume, the selection of regions for the Droplet will be automatically limited to those regions where block storage is available.
When you’ve already created a Droplet and it is located in a region with block storage support, you can create and manage volumes on its Volumes page:
You can also create a new volume and attach it to an existing Droplet at any time from the Create menu.
You can manage all the volumes associated with your account by following the Droplets link in the main navigation and selecting the Volumes tab:
When you first create a new volume, you will need to format it to create a file system. You generally only have to do this once because formatting a volume erases all the data on it. Every time you attach a formatted volume to a Droplet, you will need to mount it so your Droplet can access it.
You can choose to automatically format and mount a volume for first-time use on supported distributions. When auto-mounting is available, it is selected by default. Otherwise, it will be grayed out and the manual option will be selected.
Automatic mounting uses the same commands and options that are provided in the instructions for manual formatting and mounting. The volume is auto-mounted into the
/mnt directory with the options
By default, Ext4 is selected as the default filesystem because of its stability, backwards compatibility, and mature support and tooling. You can also choose XFS, which specializes in performance for large data files.
All volumes can be manually formatted and mounted. Droplet-specific directions are available in the volume’s More menu under Config instructions.
These customized directions have three parts that you can copy to paste directly into a terminal from your local machine. The three parts are:
SSH to your Droplet, which includes the SSH command with the Droplet’s IP address filled in.
If you’ve disabled
root logins or are working with CoreOS, FreeBSD, or RancherOS, you’ll need to substitute the appropriate user for
Format the volume: One time only, which includes the commands to set up a filesystem with the Droplet’s IP address and the SCSI ID of the volume pre-filled. Generally, this is a one-time-only task; when you format a volume it destroys all existing data.
By default, this command uses the Ext4 filesystem. If you prefer, you can use the same commands to format the volume with XFS by changing
Mount the volume, which includes the commands to create a mount point, mount the volume, and set the volume to automatically mount when you reboot. The specific SCSI ID of the volume is pre-filled.
Once a volume is formatted and mounted, it is ready to use.