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
- Click on golden gear and open the Settings menu
- Select the Storage tab
- Click on the Controller:SATA heading and two icons appear
- Click on the right-most icon to Create New Disk
- Leave selection set at VDI
- Leave the default at Dynamically Set
- Give it a name and select a size. The slide is fairly worthless so type-in a value
- For this example I’ve created a new file named scratch.vdi
Start the machine and log in as root.
- Open a terminal and cd into /etc
- Open the Applications dropdown in the Linux desktop
- Select System Tools | Disk Utility
- 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:
- Create a directory that the file system will mount to
- Create a single partition on your new device with fdisk
- Format that partition
- Mount it
- 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
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”