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.

    1. Detach the volume.
    2. On the Block Volumes or Boot Volumes list page, find the volume that you want to resize. If you need help finding the list page or the volume, see Listing Volumes or Listing Boot Volumes.
    3. From the Actions menu (three dots), select Edit.
    4. In the edit panel, for Volume size (in GB), enter the new volume size.

      You must specify a larger value than the block volume's current size.

    5. Select Save changes.
      If you resized a volume attached to a Linux-based instance, a dialog opens that lists the commands you need to run after the volume is provisioned.
    6. (Optional) Run the listed commands to ensure that the operating system correctly identifies the increased volume size.
      1. Select Copy to copy the commands.
      2. Select Close to close the dialogue.
    7. See Next Steps for information on rescanning the disk and extending the partition.
  • Block Volumes

    1. Detach the volume.
    2. 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

    1. Detach the volume.
    2. Use the oci bv boot-volume updatecommand 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

    1. Run the DetachVolume operation and specify the volumeAttachmentId attribute to detach a block volume from an instance.

    2. Run the UpdateVolume operation and specify the volumeId attribute in the request body and the sizeInGBs attribute in the UpdateVolumeDetails resource to resize the block volume.

    Boot Volumes

    1. Run the DetachVolume operation and specify the volumeAttachmentId attribute to detach a block volume from an instance.

    2. Run the UpdateBootVolume operation and specify the volumeId attribute in the request body and the sizeInGBs attribute in the UpdateBootVolumeDetails resource to resize the boot volume.