Skip to content

Lab 15 ‐ Detach Block Volume

Md Mahbub Alam edited this page Oct 25, 2026 · 1 revision

To detach a block volume from an instance, follow these steps:

  1. Make sure no applications are using the volume.
  2. Unmount the filesystem using the umount command.
  3. Open the /etc/fstab file using vi in PuTTY and comment out or remove the entry for that volume.
  4. Run the iSCSI detach commands (now called Disconnect)
  5. Finally, detach the block volume from the instance using the OCI Console.

Steps

  1. First, make sure no applications are using the volume. Before unmounting it, run lsblk and df -h to record the current state for comparison later.
image image
  1. Now we will either comment out the line or delete the line which refernces this volume in /etc/fstab file

sudo vi /etc/fstab

  1. Now we run iSCSI Disconnect command which will show a successful message sudo iscsiadm -m node -T iqn.2015-12.com.oracleiaas:9171b6dd-e18f-4854-ad42-0c9fbde4053a -p 169.254.2.2:3260 -u sudo iscsiadm -m node -o delete -T iqn.2015-12.com.oracleiaas:9171b6dd-e18f-4854-ad42-0c9fbde4053a -p 169.254.2.2:3260
image image
  1. Now we will verify if the volume is detached lsblk
image
  1. In OCI console navigate to storage details page of the instance and click the actions menu in the Attached block volumes section and click Detach volume

Navigation menu > Compute > Instances > the instance (bastion-server1) > Storage > Actions > Detach

image image image image image image

Clone this wiki locally