{"id":4555,"date":"2025-06-28T23:17:14","date_gmt":"2025-06-28T14:17:14","guid":{"rendered":"https:\/\/blog.derrylab.com\/?p=4555"},"modified":"2025-06-28T23:17:15","modified_gmt":"2025-06-28T14:17:15","slug":"how-to-attach-additional-block-volume-in-oracle-cloud-instance","status":"publish","type":"post","link":"https:\/\/blog.derrylab.com\/index.php\/2025\/06\/28\/how-to-attach-additional-block-volume-in-oracle-cloud-instance\/","title":{"rendered":"How to Attach Additional Block Volume in Oracle Cloud Instance"},"content":{"rendered":"\n<p>As I continued rolling out new features across several services in my infrastructure, I noticed disk space was starting to run low. Fortunately, my Oracle Cloud instance still had some unallocated block volume available, but since I wasn\u2019t too familiar with the Oracle Cloud Console, I had to figure things out as I went.<\/p>\n\n\n\n<p>In this post, I\u2019ll walk you through the exact steps I took to attach and mount a new block volume on my instance. If you&#8217;re in a similar situation or just getting started with OCI, I hope this guide saves you time and confusion.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Attach the Block Volume via OCI Console<\/h2>\n\n\n\n<p>Before accessing the disk in Linux, attach it via the Oracle web interface:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Open the navigation menu<\/strong> and select <strong>Compute<\/strong>.<\/li>\n\n\n\n<li>Under <strong>Compute<\/strong>, click <strong>Instances<\/strong>.<\/li>\n\n\n\n<li>Under <strong>List scope<\/strong>, select the <strong>compartment<\/strong> that contains your instance.<\/li>\n\n\n\n<li>In the list of instances, click the <strong>name<\/strong> of the instance you want to attach the volume to.<\/li>\n\n\n\n<li>In the <strong>Resources<\/strong> section (left sidebar), click <strong>Attached block volumes<\/strong>.<\/li>\n\n\n\n<li>Click <strong>Attach block volume<\/strong>.<\/li>\n\n\n\n<li>Choose the volume you created earlier and click <strong>Attach<\/strong>.<\/li>\n<\/ol>\n\n\n\n<p>Once attached as ISCSI, you should run the iscsi command which is provided when you click the three dots at the right of your instance name.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"261\" src=\"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2025\/06\/image-5.png?resize=1024%2C261&#038;ssl=1\" alt=\"\" class=\"wp-image-4567\" srcset=\"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2025\/06\/image-5.png?resize=1024%2C261&amp;ssl=1 1024w, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2025\/06\/image-5.png?resize=300%2C76&amp;ssl=1 300w, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2025\/06\/image-5.png?resize=768%2C196&amp;ssl=1 768w, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2025\/06\/image-5.png?resize=1536%2C391&amp;ssl=1 1536w, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2025\/06\/image-5.png?w=1895&amp;ssl=1 1895w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p>They will provide you with attach command, that&#8217;s all you need to run. Something like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo iscsiadm -m node -o new -T iqn.xxx -p xxx:xxxx\nsudo iscsiadm -m node -o update -T iqn.xxx -p xxx:xxxx -n node.startup -v automatic\nsudo iscsiadm -m node -T iqn.xxx -p xxx:xxxx -l<\/code><\/pre>\n\n\n\n<p>If you don&#8217;t have <code>iscsiadm<\/code>, make sure you have <code>open-iscsi<\/code> installed before:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\nsudo apt install open-iscsi<\/code><\/pre>\n\n\n\n<p>Once attached, the disk will appear in your instance, usually as <code>\/dev\/sdb<\/code>, <code>\/dev\/sdc<\/code>, etc.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Check Available Disks<\/h2>\n\n\n\n<p>Use <code>lsblk<\/code> to inspect attached storage:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lsblk<\/code><\/pre>\n\n\n\n<p>You&#8217;ll see something like these output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sda       8:0    0  46.6G  0 disk\n\u251c\u2500sda1    8:1    0  46.5G  0 part \/\n\u2514\u2500sda15   8:15   0    99M  0 part \/boot\/efi\nsdb       8:16   0    50G  0 disk<\/code><\/pre>\n\n\n\n<p>Here, <code>sdb<\/code> is an extra 50 GB disk with no partitions. Time to prepare it.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Create a Partition<\/h2>\n\n\n\n<p>Run <code>fdisk<\/code> to create a new partition:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo fdisk \/dev\/sdb<\/code><\/pre>\n\n\n\n<p>In the prompt:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>n<\/code> \u2013 New partition<\/li>\n\n\n\n<li><code>p<\/code> \u2013 Primary<\/li>\n\n\n\n<li><code>1<\/code> \u2013 Partition number<\/li>\n\n\n\n<li>Press <code>Enter<\/code> twice to accept default first and last sectors<\/li>\n\n\n\n<li><code>w<\/code> \u2013 Write and exit<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Format the Partition<\/h2>\n\n\n\n<p>Format the new partition as ext4 (or your filesystem of choice):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkfs.ext4 \/dev\/sdb1<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Mount the New Partition<\/h2>\n\n\n\n<p>Create a directory to mount the disk:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir \/mnt\/data<\/code><\/pre>\n\n\n\n<p>Then mount it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mount \/dev\/sdb1 \/mnt\/data<\/code><\/pre>\n\n\n\n<p>Verify with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>df -h<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Make the Mount Persistent (Survive Reboots)<\/h2>\n\n\n\n<p>Find the UUID of your new partition:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo blkid \/dev\/sdb1<\/code><\/pre>\n\n\n\n<p>Example output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/dev\/sdb1: UUID=\"abcd1234-5678-90ef-ghij-klmnopqrstuv\" TYPE=\"ext4\"<\/code><\/pre>\n\n\n\n<p>Edit the <code>fstab<\/code> file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/fstab<\/code><\/pre>\n\n\n\n<p>On Oracle Cloud Infrastructure (OCI), your <code>\/etc\/fstab<\/code> might include this reminder:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># If you are adding an iSCSI remote block volume to this file you MUST\n# include the '_netdev' mount option or your instance will become\n# unavailable after the next reboot.\n<\/code><\/pre>\n\n\n\n<p>So when working with <strong>remote iSCSI block volumes<\/strong>, always:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use <strong>UUID<\/strong>, not <code>\/dev\/sdX<\/code><\/li>\n\n\n\n<li>Add the <code>_netdev<\/code> option<\/li>\n\n\n\n<li>Refer to the official <a href=\"https:\/\/docs.oracle.com\/en-us\/iaas\/Content\/Block\/Tasks\/connectingtoavolume.htm\">OCI block volume docs<\/a><\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>Since this is an iSCSI volume<\/strong>, add <code>_netdev<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>UUID=abcd1234-5678-90ef-ghij-klmnopqrstuv \/mnt\/data ext4 defaults,_netdev 0 2<\/code><\/pre>\n<\/blockquote>\n\n\n\n<p>Save and close.  Test it without reboot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mount -a<\/code><\/pre>\n\n\n\n<p>If there\u2019s no error, you\u2019re good to go! Confirm your new storage with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lsblk\ndf -h<\/code><\/pre>\n\n\n\n<p>Now that additional storage is ready to use! \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As I continued rolling out new features across several services in my infrastructure, I noticed disk space was starting to run low. Fortunately, my Oracle Cloud instance still had some unallocated block volume available, but since I wasn\u2019t too familiar with the Oracle Cloud Console, I had to figure things out as I went. In [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4568,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[291,293,302,290,306,305,310,18,303,295,308,298,299,304,36,294,297,296,292,312,289,307,309,311,300,301,66],"class_list":["post-4555","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-attach-volume","tag-block-volume","tag-cloud-compute","tag-cloud-infrastructure","tag-cloud-storage","tag-cloud-tutorial","tag-cloud-vm","tag-development","tag-devops","tag-disk-management","tag-ext4","tag-fdisk","tag-fstab","tag-iscsi","tag-linux","tag-linux-server","tag-mkfs","tag-mount-volume","tag-oci","tag-oci-guide","tag-oracle-cloud","tag-oracle-instance","tag-persistent-storage","tag-server-setup","tag-storage-expansion","tag-sysadmin","tag-ubuntu"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2025\/06\/pexels-photo-117729.jpeg?fit=1880%2C1253&ssl=1","jetpack-related-posts":[{"id":544,"url":"https:\/\/blog.derrylab.com\/index.php\/2022\/03\/19\/how-to-enable-https-on-your-apache-ubuntu-web-server\/","url_meta":{"origin":4555,"position":0},"title":"How to Enable HTTPS on Your Apache Ubuntu Web Server","author":"derry","date":"March 19, 2022","format":false,"excerpt":"I thought this is an easy task, but after searching for various ways on the internet, it is not as simple as I imagined. There are many ways to enable HTPPS on your web server depending on what server software is used, the operating system, and where the server is\u2026","rel":"","context":"In &quot;linux&quot;","block_context":{"text":"linux","link":"https:\/\/blog.derrylab.com\/index.php\/category\/linux\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/franck-DoWZMPZ-M9s-unsplash.jpg?fit=1200%2C900&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/franck-DoWZMPZ-M9s-unsplash.jpg?fit=1200%2C900&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/franck-DoWZMPZ-M9s-unsplash.jpg?fit=1200%2C900&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/franck-DoWZMPZ-M9s-unsplash.jpg?fit=1200%2C900&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/franck-DoWZMPZ-M9s-unsplash.jpg?fit=1200%2C900&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":2572,"url":"https:\/\/blog.derrylab.com\/index.php\/2023\/02\/08\/how-to-install-the-latest-openwrt-on-arduino-yun\/","url_meta":{"origin":4555,"position":1},"title":"How to Install the Latest OpenWRT on Arduino Yun","author":"derry","date":"February 8, 2023","format":false,"excerpt":"By the time I am writing this, this might be the first article that tells you how to install OpenWRT on Arduino Yun because no one talks about it. Also, Arduino Yun is already reached its end of life, and the version history is not well documented in each article\u2026","rel":"","context":"In &quot;Hardware&quot;","block_context":{"text":"Hardware","link":"https:\/\/blog.derrylab.com\/index.php\/category\/hardware\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/02\/ArduinoYunFront_2.jpg?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/02\/ArduinoYunFront_2.jpg?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/02\/ArduinoYunFront_2.jpg?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/02\/ArduinoYunFront_2.jpg?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/02\/ArduinoYunFront_2.jpg?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":591,"url":"https:\/\/blog.derrylab.com\/index.php\/2022\/03\/18\/now-i-understand-what-is-oblivious-ram\/","url_meta":{"origin":4555,"position":2},"title":"Now I Understand: What is Oblivious RAM?","author":"derry","date":"March 18, 2022","format":false,"excerpt":"ORAM is the acronym of an Oblivious Random-Access Machine. The main idea is to hide the access patterns from attackers. For example, when a client tries to access data stored in the server, the server cannot gain any information about the user access pattern. Imagine data storage, where each data\u2026","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/blog.derrylab.com\/index.php\/category\/programming\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/harrison-broadbent-ING1Uf1Fc30-unsplash-1.jpg?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/harrison-broadbent-ING1Uf1Fc30-unsplash-1.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/harrison-broadbent-ING1Uf1Fc30-unsplash-1.jpg?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/harrison-broadbent-ING1Uf1Fc30-unsplash-1.jpg?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/harrison-broadbent-ING1Uf1Fc30-unsplash-1.jpg?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":92,"url":"https:\/\/blog.derrylab.com\/index.php\/2020\/07\/18\/how-to-create-identical-image-of-usb-device\/","url_meta":{"origin":4555,"position":3},"title":"How to Create Identical Image of USB Device","author":"derry","date":"July 18, 2020","format":false,"excerpt":"Hi, currently I am backing up my micro SD card contents and I'm using dd for that. You can start listing your usb device using: $ sudo fdisk -l After you get the USB address, for example mine is \/dev\/sdb, you can start creating a copy images. Here I tried\u2026","rel":"","context":"In &quot;linux&quot;","block_context":{"text":"linux","link":"https:\/\/blog.derrylab.com\/index.php\/category\/linux\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3171,"url":"https:\/\/blog.derrylab.com\/index.php\/2023\/12\/18\/how-to-enable-browsing-when-you-have-ssh-access\/","url_meta":{"origin":4555,"position":4},"title":"How to Enable Browsing when You Have SSH Access","author":"derry","date":"December 18, 2023","format":false,"excerpt":"Introduction If you have access to SSH into a machine, it means you have full control of that machine. However if not all of the things can be done via terminal SSH, sometimes you need to browse some sites using that machine connection. The simplest solution for this is to\u2026","rel":"","context":"In &quot;linux&quot;","block_context":{"text":"linux","link":"https:\/\/blog.derrylab.com\/index.php\/category\/linux\/"},"img":{"alt_text":"view of tunnel","src":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/12\/pexels-photo-249097.jpeg?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/12\/pexels-photo-249097.jpeg?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/12\/pexels-photo-249097.jpeg?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/12\/pexels-photo-249097.jpeg?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/12\/pexels-photo-249097.jpeg?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":135,"url":"https:\/\/blog.derrylab.com\/index.php\/2020\/11\/18\/how-to-start-a-fresh-raspberry-pi-without-monitor\/","url_meta":{"origin":4555,"position":5},"title":"How to Start a Fresh Raspberry Pi without Monitor","author":"derry","date":"November 18, 2020","format":false,"excerpt":"I mean using SSH because HDMI, mouse, keyboard, and monitor will eat up the whole space in my desk. Prepare the Raspberry Pi OS Firstly we need to get our microSD card with bootable Raspberry Pi OS. I recommend using Raspberry Pi Imager to make this process easier. We just\u2026","rel":"","context":"In &quot;linux&quot;","block_context":{"text":"linux","link":"https:\/\/blog.derrylab.com\/index.php\/category\/linux\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2020\/11\/image.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2020\/11\/image.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2020\/11\/image.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/posts\/4555","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/comments?post=4555"}],"version-history":[{"count":3,"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/posts\/4555\/revisions"}],"predecessor-version":[{"id":4569,"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/posts\/4555\/revisions\/4569"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/media\/4568"}],"wp:attachment":[{"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/media?parent=4555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/categories?post=4555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/tags?post=4555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}