Updated 2023-01-04

Rescanning the Disk for a Block Volume or Boot Volume

The Oracle Cloud Infrastructure Block Volume service lets you expand the size of block volumes and boot volumes while they are online and attached to instances, for more information, see Online Resizing of Block Volumes Using the Console. After the volume is provisioned, you need to run commands to rescan the disk, so that the operating system identifies the expanded volume size. You will need to run different rescan commands depending on the operating system of the attached instance. This topic describes some procedures you can use to rescan the disk.

Required IAM Policy

Rescanning the disk 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.

Rescanning the Disk for Volumes Attached to Linux-Based Instances

For volumes attached to Linux-based instances, run the following commands rescan the disk for a block volume:

sudo dd iflag=direct if=/dev/<device_name> of=/dev/null count=1
		echo "1" | sudo tee /sys/class/block/<device_name>/device/rescan

These commands are also displayed in the dialog that opens after you click Save Changes in the Edit Size or Performance dialog, and you can copy them from that dialog.

Next Steps

After you've rescanned the disk, you need to extend the partition. See Extending the Partition for a Block Volume on a Linux-Based Image for block volumes. For boot volumes, use the oci-growfs operation from OCI Utilities.

Rescanning the Disk for Volumes Attached to Windows Instances

Using Disk Management or diskpart

For volumes formatted as FAT32 or NTFS, you can rescan the disk using the Windows interface, in Disk Management, or you can use the diskpart utility's rescan command from the command line.