Warning
This content has been generated by machine translation. The translations are automated and have not undergone human review or validation.
3.6.6 Unmounting Block Volume
Unmount
Connect to the Compute Instance with SSH.
Update /etc/fstab
Execute the sudo vi /etc/fstab command to delete /mnt/vol1, the volume to be unmounted, from the fstab file.sudo vi /etc/fstab
Unmount
sudo umount /mnt/vol1
Disconnect to Volume
Open the navigation menu in the OCI console. Go to Compute > Instances.
Click on the name of the target Instance you created earlier.
On the Instance detail page, click Resources > Attached block volumes in the lower left corner.
Click on the action icon (three dots on the right) next to the Block Volume you just mounted, then click on iSCSI commands and information.
The iSCSI Commands and Information dialog appears.
Copy the commands of Disconnect COMMANDS and execute them one by one in the SSH session connected to the instance.
ubuntu@NOTEBOOK-WORK:~/.ssh$ ssh -i privateKey opc@146.56.171.xx Last login: Mon Jan 10 07:24:34 2022 from 223.62.21.xx [opc@examplelinuxinstance ~]$ sudo iscsiadm -m node -T iqn.2015-12.com.oracleiaas:2626c782-30e1-43c2-847a-2504080445ec -p 169.254.2.3:3260 -u Logging out of session [sid: 1, target: iqn.2015-12.com.oracleiaas:2626c782-30e1-43c2-847a-2504080445ec, portal: 169.254.2.3,3260] Logout of [sid: 1, target: iqn.2015-12.com.oracleiaas:2626c782-30e1-43c2-847a-2504080445ec, portal: 169.254.2.3,3260] successful. [opc@examplelinuxinstance ~]$ sudo iscsiadm -m node -o delete -T iqn.2015-12.com.oracleiaas:2626c782-30e1-43c2-847a-2504080445ec -p 169.254.2.3:3260
Check with the fdisk -l command to confirm whether or not it has been dismounted.
You can see that the /dev/sdb disk is gone.
[opc@examplelinuxinstance ~]$ sudo fdisk -l WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion. Disk /dev/sda: 50.0 GB, 50010783744 bytes, 97677312 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 1048576 bytes Disk label type: gpt Disk identifier: BBBA97C2-4E47-43B0-9059-2702FDB720E7 # Start End Size Type Name 1 2048 411647 200M EFI System EFI System Partition 2 411648 17188863 8G Linux swap 3 17188864 97675263 38.4G Microsoft basic
Unmount Volume
In the OCI console, click the action icon next to the Block Volume you want to dismount, then click Detach.
After confirming the warning, click Detach volume. We ran the /etc/fstab cleanup, unmount, and iSCSI Disconnect commands all earlier.
It shows DETACHING status. When finished, it will disappear from the Attached Block Volumes list.
As an individual, this article was written with my personal time. There may be errors in the content of the article, and the opinions in the article are personal opinions.