Validated on 3 Oct 2019 • Last edited on 17 Apr 2025
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 manually partitioned your volume when you created it, the process for increasing the size of the volume has additional steps.
However, volumes are unpartitioned by default. If you automatically formatted and mounted your volume or used the Config instructions in the control panel, your volume is unpartitioned, and you should follow the less complicated steps to resize an unpartitioned volume.
Tip
If you’re not sure if your volume is partitioned, you can check with lsblk --fs:
We recommend gdisk to rewrite partition tables. It supports backups of the existing table, explicitly moves GPT recovery data to the end of the disk, and works with partitions of any size. Tools like growpart are straightforward, but the versions shipped with most distributions can only resize partitions up to 2 TB.
First, unmount all partitions. This is the same process as unmounting an unpartitioned volume repeated for each of the partitions on the volume.
Change to a writable directory so you can successfully write the partition table backup file, then start gdisk with the volume identifier.
cd ~
sudo gdisk /dev/disk/by-id/use_your_volume_identifier
For safety, use the b command to back up the current partition, and enter a filename for the backup when prompted.
b
Enter backup filename to save: partition_table.bak
Switch to the experts menu with x, which changes the prompt to reflect the new context. Use e to move the backup GPT data structures to the end of the volume, which changed when you expanded the volume, and exit back to the main menu with m.
Command (? for help): x
Expert command (? for help): e
Relocating backup data structures to the end of the disk
Expert command (? for help): m
Command (? for help):
To use the new space on the volume, you need to expand the last partition into the free area by removing the existing partition and recreating it.
You can use p to display the current partition table first to note the Number, Start (sector), Code, and Name values of the last partition. You can use these to verify the correct values when you create the new partition.
p
Disk /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01: 419430400 sectors, 200.0 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 016F1E0A-83C5-4CF2-A78B-150F689CC45A
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 419430366
Partitions will be aligned on 2048-sector boundaries
Total free space is 209719229 sectors (100.0 GiB)
Number Start (sector) End (sector) Size Code Name
1 2048 209713151 100.0 GiB 8300 primary
Use d to remove the partition. If the volume has multiple partitions, d prompts for a partition number, so choose the last partition.
d
Using 1
Use n to start creating a new partition, which prompts you for information about the partition you’re creating. The suggested values are usually correct, but verify them with the values of the partition you deleted. For the Last sector prompt, accept the default to expand the partition to the end of the disk.
n
Partition number (1-128, default 1):
First sector (34-419430366, default = 2048) or {+-}size{KMGTP}:
Last sector (2048-419430366, default = 419430366) or {+-}size{KMGTP}:
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to 'Linux filesystem'
The partition creation process does not prompt for an internal GPT partition name, but you can use the c command to set the name to its previous value. You can verify the new partition table you’ve created with the p command again.
When you’re ready, use the w command to write the partition data to the volume and confirm the write with Y:
w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01.
The operation has completed successfully.
This expands the last partition to consume the rest of the available space on the volume.
Expand the Filesystem of the Last Partition
Next, you need to expand the filesystem on the last partition to use the extra available space.
First, unmount the disk:
sudo umount /mnt/use_your_mount_point
The procedure used to grow the last partition’s filesystem depends on the filesystem type.
You can check the filesystems written to your partitions by using the lsblk utility. Most modern variants have a --fs option which displays filesystem-related information:
The ext4 resize tool requires that you check the partition for inconsistencies that may have happened during repartitioning before you can expand it. The e2fsck command can safely check unmounted filesystems.
Pass the last partition on the volume to the e2fsck program and use the -f option to force the check:
resize2fs 1.42.13 (17-May-2015)
Resizing the filesystem on /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01-part1 to 52428539 (4k) blocks.
The filesystem on /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01-part1 is now 52428539 (4k) blocks long.
We recommend using the xfs_repair utility to check the filesystem for inconsistencies introduced by repartitioning before expanding XFS filesystems. Pass in the last partition on the volume:
You can now mount the new filesystem and use the expanded space in the volume. If you want to verify the available space, use df -h -x tmpfs -x devtmpfs to list information about the filesystems and their size.
We can't find any results for your search.
Try using different keywords or simplifying your search terms.