Mount Volume to Linux OCI Instance

mount volume to linux instance oracle cloud

If you are using Oracle Cloud Infrastructure and you want to attach the Block Volume to your existing Machin here is the procedure;

Create and Attach Block Volume to VM

  • Create the Block Volume in Oracle Cloud Infrastructure – Storage Option
  • Attach the volume to the running instance
  • Open Running instance SSH
  • use the command to add block volume in Operating System.

Mount Block Volume to Linux

Follow below steps in SSH

First of all check if the Block Volume is attached, you can check this using below command

lsblk

Now it will show you if the disk is attached in my case the disk name was dev/sdb which was 50 GB attached from above process

Now in next step, you need to create the file system in the disk which is listed. So use below command and make sure you change the disk name in my case it is sdb. So I will use below command

sudo mkfs -t ext3 /dev/sdb

Now file system will be created, in nex step you need to create a directory to which you will mount this volume. I will create directory in mnt folder by using the command

mkdir /mnt/amjid-data

Make sure to change the name of directory that you want to keep.

In next command you will need to mount the volume to the directory by using below command

sudo mount /dev/sdb /mnt/amjid-data

Wait you are not done yet. You need to update the fstab (File System Table). Which is configuration file to mount and unmount the volume.

So I will be editing the configuration table by typing below command

sudo nano /etc/fstab

This will open the configuration file and you must add your volume information at the end of the configuration file. Don’t make changes to existing configuration until you really want to so in my case I will add below line to the existing configuration

/dev/sdb /mnt/amjid-data ext3 defaults,nofail 0 0

Once you add the line just close and save the file.

Reboot the Server.

Your volume will be mounted to the server.

TODAY'S OFFERS

Gator Website Builder

Leave a Reply

Your email address will not be published.