Offline Resizing a Block or Boot Volume
You can use offline resizing to detach the volume from an instance before you expand the volume size. Once the volume is resized and reattached, you must extend the partition, but you do not need to rescan the disk.
Considerations When Resizing an Offline Volume
Whenever you detach and reattach volumes, there are complexities and risks for both Linux-based and Windows-based instances. This applies to both paravirtualized and iSCSI attachment types. You should keep the following in mind when resizing volumes:
-
When you reattach a volume to an instance after resizing, if you are not using consistent device paths, or the instance does not support consistent device paths, device order and path may change. If you are using a tool such as Logical Volume Manager (LVM), you may need to fix the device mappings. For more information about consistent device paths, see Connecting to Volumes With Consistent Device Paths.
-
When you detach and then reattach an iSCSI-attached volume to an instance, the volume's IP address will increment.
-
Before you resize a volume, you should create a full backup of the volume.
Block Volumes
- Detach the volume.
-
Use the
oci bv volume update
command and specify the--volume-id
and--size-in-gbs
parameters to resize a block volume:oci bv volume update --volume-id <volume_OCID> --size-in-gbs <new_size>... [OPTIONS]
Boot Volumes
- Detach the volume.
-
Use the
oci bv boot-volume update
command and specify the--volume-id
and--size-in-gbs
parameters to resize a block volume:oci bv boot-volume update --volume-id <volume_OCID> --size-in-gbs <new_size>... [OPTIONS]
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Block Volumes
-
Run the
DetachVolume
operation and specify thevolumeAttachmentId
attribute to detach a block volume from an instance. -
Run the
UpdateVolume
operation and specify thevolumeId
attribute in the request body and thesizeInGBs
attribute in theUpdateVolumeDetails
resource to resize the block volume.
Boot Volumes
-
Run the
DetachVolume
operation and specify thevolumeAttachmentId
attribute to detach a block volume from an instance. -
Run the
UpdateBootVolume
operation and specify thevolumeId
attribute in the request body and thesizeInGBs
attribute in theUpdateBootVolumeDetails
resource to resize the boot volume.
-
Next Steps
- Rescan the disk. See Rescanning the Disk for Volumes Attached to Linux-Based Instances and Rescanning the Disk for Volumes Attached to Windows Instances.
- Extend the partition. See Extending the Partition for a Block Volume on a Linux-Based Image and Extending the Partition for a Block Volume on a Windows-Based Image.