, ,

I’m in the process of building a test VM on my MacBook using Oracle VirtualBox.  I’ve started by downloading and installing VirtualBox and then downloading the ‘Developer Days  Database App Development appliance from this page:


After importing the appliance, but prior to starting it, I upped the RAM to 8G and changed the name of the Virtual Machine in the configuration page.  The new VM came up just fine but lacked a reasonable location for me to stage the installation media and create my Middleware Home.  I needed to add a new disk and I want it to mount to / instead of showing up under the /media directory inside the VM.

It was time to start acting like a Linux System Admin. <Insert your own favorite stereotype of an SA here> 

First, with the VM stopped, highlight the VM in the VirtualBox console

  1. Click on golden gear and open the Settings menu
  2. Select the Storage tab
  3. Click on the  Controller:SATA heading and two icons appear
  4. Click on the right-most icon to Create New Disk
  5. Leave selection set at VDI 
  6. Leave the default at Dynamically Set 
  7. Give it a name and select a size.  The slide is fairly worthless so type-in a value
  8. For this example I’ve created a new file named scratch.vdi

Start the machine and log in as root.

  1. Open a terminal and cd into /etc
  2. Open the Applications dropdown in the Linux desktop
  3. Select System Tools | Disk Utility
  4. Near the bottom of the Local Storage list you’ll find your new disk

In the top-right section you’ll see a listing called Device Name followed by /dev/sd<something>. Mine is called /dev/sdi.  I’ve been busy mounting other filesystems.

Still in that application, press the Format Volume button.  Give the volume a name (scratch in my case) and select file type of EXT2.

Within a moment or two the display in the Disk Manager window will display the name of your volume.

Leave the Disk Manager open and switch over to your Terminal window.

Here’s the sequence of things to do on the command line:

  1. Create a directory that the file system will mount to 
  2. Create a single partition on your new device with fdisk
  3. Format that partition
  4. Mount it
  5. Check it

> mkdir -p /scratch

> fdisk /dev/sdi

          Enter these commands, one at a time at the prompt:

            n To create a new partition  

            p to create the primary partition (then accept all the defaults)

            w to write to disk

Notice that the values just changed in the Disk Manager, including a partition name representing the device name and a digit.  In my case, I now have partition /dev/sdi1 on device /dev/sdi.

Up to now you’ve been working with large chunks.  The next step will build the actual filesystem at the block level. You’ll see when you run it.

 >mke2fs -j -L scratch /dev/sdi1



>vi /etc/fstab

Add this line (substitute your own values and make the layout match the rest of the file, of course):

/dev/sdi1 scratch  ext2  defaults 1 1

:wq from vi

Mount it with this simple command:

> mount -a

> df -h

> echo “Ta da”