In this article I will describe how to detach a block volume from an Oracle cloud Linux instance We will be covering the following steps:
- Unmount the mount-point from the Linux Instance
- Disconnect the Block volume from the instance
- Detach the Block volume from the Instance
- Delete the volume from Cloud console
1. Unmount the disk from the Linux Instance
Connect to the linux instance and run the umount command to unmount the filesystem with has to be deleted
2. Disconnect the Block volume from the instance
Once the disk is unmounted, access the cloud console and copy the commands to disconnect the block volume from the instance:
Goto Attached block volumes > Click on ellipsis(…) and select iSCSI Commands & Information
Copy the COMMANDS FOR DISCONNECTING
Connect the VM as root user and run the commands
3. Detach the Block volume from the Instance
Once the Block volume is detached. Access the cloud console, navigate to Instances page and click on Instance name (oc-ol7 here)
Under Resources select Attached Block Volumes and click on the ellipsis(…) then select Detach
Click on Continue Detachment
Now we can see the Volume State is Detaching.
4. Delete the volume from Cloud console
Once the volume is Detached, Open the navigation menu. Under Core Infrastructure, goto Block Storage and Click on Block Volumes
In the block volume section click on the ellipsis(…) on which the volume you want to delete, then click Terminate and confirm the selection when prompted.
Now the block volume is terminated successfully.