Grow or rename a volume
Make a volume bigger, attached or not, then grow the filesystem on it; or give it another name.
Replace vol-1a2b3c4d with your volume's id and 12345678 with the number in its device path (Device on the instance in the volume's side panel).
Important
A volume only grows; it cannot shrink. It is billed for the new size from then on.
Prerequisites
- Permission for
ec2:ModifyVolume(for growing and for renaming). - In the console, also
ec2:DescribeVolumesto open Volumes (without it the page says "Access denied"). - Room in the Volume storage quota (
ec2.volume-storage) for the difference; else409"Quota exceeded: Volume storage (ec2.volume-storage) — …". - To grow: the volume is no longer
creating(else409"… can be grown once it is available (it is creating)"), and no snapshot or restore of it is in progress (409"Snapshot … of this volume is in progress; …" or "This volume is being restored from …; …"). The console offers Resize only for an Available or In use volume.
Grow the volume
- Open Compute, then Volumes.
- Open the volume's actions menu and choose Resize.
- For New size (GiB), enter a size above the current one, at most 10 000.
- Choose Grow volume. The new size shows in the list.
To rename instead, choose Rename in the same menu, for Name enter the new name, and choose Rename.
dcloud ec2 volumes modify vol-1a2b3c4d --size-gib 100--name renames it in the same call.
PATCH /ec2/api/volumes/vol-1a2b3c4d
{ "sizeGib": 100 }{ "name": "…" } renames it. A smaller size is refused with 400 "A volume only grows: … is …
GiB".
In Terraform, a new size_gib replaces the dcloud_volume; grow it with the CLI or API instead.
Grow the filesystem
The device is bigger now; the filesystem on it is not. On the instance:
# ext4 straight on the disk
sudo resize2fs /dev/disk/by-id/scsi-0HC_Volume_12345678
# XFS, by mount point
sudo xfs_growfs /dataAn encrypted volume opens at its new size at its next unlock: reboot the instance (or unmount, run
sudo cryptsetup close ews-vol-12345678, detach and attach again). On an instance with the
volume helper you can instead grow the open mapping in place with
sudo /usr/local/sbin/ews-volume-unlock resize 12345678. Then run
sudo resize2fs /dev/mapper/ews-vol-12345678.