To follow along, you will need a DigitalOcean account. If you don’t already have one, you can register on the sign up page.
You can create and attach a new volume to an existing Droplet or while creating a new Droplet. The Droplet and volume must be in the same region.
From the Create menu in the top right of the control panel, click Volumes, then choose an existing Droplet to attach the volume to in Select Droplet to attach to.
Alternatively, on the Droplet create page, in the Add block storage section, click Add Volume.
Choose the size of your volume, which can be from 1 GB to 16 TB (16,000 GB).
Choose whether you want to mount the volume automatically or manually.
To mount manually, follow the instructions in the volume’s More menu, under Config instructions. Automatic mounting runs the same commands and options provided for manual formatting and mounting, and can be a more convenient option when it’s available.
By default, both mounting options:
/mntdirectory with the options
fstabto ensure the volume will be re-mounted after reboots.
Detaching a volume removes the volume from its current Droplet. The volume and all of its contents can later be attached to a different Droplet as needed.
To detach a volume:
umount /mnt/your_mount_point) or powering down the Droplet.
You can move volumes between Droplets by detaching the volume from the first Droplet and reattaching it to another Droplet in the same region.
To attach an existing unattached volume to an existing Droplet in the same datacenter:
To attach an existing unattached volume to a new Droplet during creation:
You’ll need to mount the volume again by following the instructions in the volume’s More menu, under Config instructions.
To increase the size of your volume:
resize2fsfor Ext4 and
xfs_growfsfor XFS. If your volume is partitioned, you will need to resize the partition before expanding the filesystem.
Detailed instructions are available in the manual mounting, formatting, and partitioning how-to.
Decreasing the size of a volume is not possible due to the high risk of data loss or corruption.
Deleting a volume permanently and irreversibly destroys the volume and its contents.
To delete a volume, on the account-level Volumes page or the Volumes page for an individual Droplet, open the volume’s More menu and choose Delete.