Teaching How to Add another storage volume to an existing VBox VM (Ubuntu)

If you need to add an extra volume storage into an existing VBox VM, you can use VirtualBox for that.

  • Stop your VM and go to Virtual Box – Storage
  • Select the Controller: SATA and click the green plus icon to add a new disk
  • Select the type and size
  • Start your instance
  • Once it is running you have to format and mount the new disk, for this, as root run

    fdisk –l or lsblk

     

     

    This will let you discover the name of the extended volume. In this case it is /dev/sdb

  • Format the volume with ext3, but be cautious to choose the right one

mkfs -t ext4 /dev/sdb

Then confirm with y


  • Now again as root, create a new directory, in my case

mkdir /u01

  • Mount the new volume into the previous directory

mount /dev/sdb /u01

  • Done, you can now cd to your new disk. However let’s change the ownership of this folder from root to citurria (or whatever user you chose)

chown citurria /u01

chgrp citurria /u01

  • Finally add your folder in /etc/fstab in order to make sure this gets mounted automatically. For this enter something like this:

/dev/sdb    /u01    ext4    defaults    0 0

Alternatively, instead of /dev/sdb you can use blkid to name the UUID of your device – This is a much better way to refer to it.

I.e.

UUID=e757427b-b2ee-427c-92d2-d7df350111fb /u01 ext4 defaults 0 0

  • Log out as root and once back as citurria make sure you can cd into /u01 – Also run a df –h and confirm the size of /u01, it should be the 30GB that you originally set.
Advertisement

Author: Carlos Rodriguez Iturria

I am extremely passionate about people, technology and the most effective ways to connect the two by sharing my knowledge and experience. Working collaboratively with customers and partners inspires and excites me, especially when the outcome is noticeable valuable to a business and results in true innovation. I enjoy learning and teaching, as I recognise that this is a critical aspect of remaining at the forefront of technology in the modern era. Over the past 10+ years, I have developed and defined solutions that are reliable, secure and scalable, working closely with a diverse range of stakeholders. I enjoy leading engagements and am very active in the technical communities – both internal and external. I have stood out as a noticeable mentor running technology events across major cities in Australia and New Zealand, including various technology areas such as, Enterprise Integrations, API Management, Cloud Integration, IaaS and PaaS adoption, DevOps, Continuous Integration, Continuous Automation among others. In recent years, I have shaped my role and directed my capabilities towards educating and architecting benefits for customers using Oracle and AWS Cloud technologies. I get especially excited when I am able to position both as a way to exceed my customers’ expectations. I hold a bachelor degree in Computer Science and certifications in Oracle and AWS Solutions Architecture.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: