Volumes are network-based block devices that provide additional data storage for Droplets. You can move them between Droplets, create disk images of them, and resize them at any time.
If you need more storage space than your current volume provides, you can attach additional volumes to the same Droplet or expand the size of a current volume.
Increasing the size of a volume has two steps:
You cannot decrease the size of a volume. In other words, volume resizes are irreversible.
Data is not always sequentially written in memory, so reducing the available space would risk data loss and filesystem corruption. To decrease the size of a volume, create a smaller volume and transfer the contents of an existing volume to it using a tool like SnapShooter or rsync.
We strongly recommend taking a snapshot of the volume before resizing.
Any changes to a filesystem can lead to data loss if something goes wrong. We strongly recommend backing up the volume’s data before resizing. If you use snapshots, you can delete the snapshot after confirming that the resize was successful.
Before detaching a volume, unmount it to avoid data loss.
To resize a volume using the API, use the volume actions endpoints and set the type
field to resize
and the size_gigabytes
field to the number of GiB you want the volume to be.
After you create a backup of the volume, you can increase the volume’s size in the control panel. From the volume’s More menu, choose Increase size.
In the window that opens, select a new size for the volume. You can choose any size at least 1 GB larger than the volume’s current size.
Click Resize volume to change the volume to the selected size.
To use the additional space, you need to expand the volume’s filesystem. You can check which kind of filesystem is on the volume with df -T /mnt/your_mount_point
.
For unpartitioned volumes using the ext4 filesystem, pass the /dev/disk/by-id
volume identifier to resize2fs
:
The output looks like this:
For unpartitioned volumes using the XFS filesystem, pass the mount point to the xfs_growfs
tool:
The output looks like this:
If you receive the error open: No such file or directory while opening /dev/disk/by-id/scsi-0DO_example
, make sure that the volume is mounted and then retry the command.
Verify that the larger filesystem is available with df
:
The output of df
looks like this:
Some operating systems require a reboot to see the volume’s new size. If you do not see the volume’s new size, reboot your Droplet.
If the size or available space doesn’t match what you expected, read our support article on why filesystem tools may report your volume as smaller than expected.