Oracle Cloud Infrastructure Documentation

Extending the Partition for a Boot Volume

When you create a new virtual machine (VM) instance or bare metal instance based on an Oracle-provided image or custom image, you have the option of specifying a custom boot volume size. You can also expand the size of the boot volume for an existing instance; see Resizing a Volume for more information. In order to take advantage of the larger size, you need to extend the partition for the boot volume.

Required IAM Policy

Extending a partition on an instance does not require a specific IAM policy. However, you may need permission to run the necessary commands on the instance's guest OS. Contact your system administrator for more information.

Extending the Root Partition on a Linux-Based Image

For instances running Linux-based images, you need to extend the root partition and then grow the file system.

Prerequisites

Before you can extend the partition, you need to detach the boot volume from the instance and attach it to another instance as a data volume. To do this:

  1. Stop the instance. For steps, see Stopping and Starting an Instance.

  2. After the instance has stopped, detach the boot volume. For steps, see Detaching a Volume.

  3. Attach the boot volume to a second instance as a data volume. For steps, see Attaching a Volume and Connecting to a Volume.

Extending the Linux Partition

After attaching the boot volume as a data volume to the second instance, connect to this instance and perform the following steps to extend the partition.

Extending the root partition

After you extend the root partition, you need to grow the file system. The steps in the following procedure apply only to xfs file systems.

Growing the file system for the root partition

Next Steps

After you have extended the partition and grown the file system, you can restart the original instance with the boot volume. To do this:

  1. Disconnect the volume from the second instance. For steps, see Disconnecting From a Volume.

  2. Detach the volume from the second instance. For steps, see Detaching a Volume.

  3. Attach the volume to the original instance as a boot volume. For steps, see Attaching a Boot Volume.

  4. Restart the instance. For steps, see Stopping and Starting an Instance.

Extending the System Partition on a Windows-Based Image

On Windows-based images, you can extend a partition using the Windows interface or from the command line using the DISKPART utility.

Windows Server 2016 and Windows Server 2012

The steps for extending a system partition on instances running Windows 2012 or Windows 2016 are the same, and are described in the following procedures.

Extending the system partition using the Windows interface
Extending the system partition using the command line with DISKPART

Windows Server 2008

Use the steps described in the following procedures to extend a system partition on instances running Windows 2008.

Extending the system partition using the Windows interface
Extending the system partition using the command line with DISKPART