0/1 Lessons

Introduction to Linux Server Operating Systems

• 30min

0 / 3 lessons complete

Linux Server Installation and Lab Setup

• 23min

0 / 6 lessons complete

Working with the Linux Command Line Interface

• 1hr 30min

0 / 12 lessons complete

User and Group Management

• 44min

0 / 7 lessons complete

Linux Storage

• 30min

0 / 6 lessons complete

Linux Administration Basics

• 53min

0 / 8 lessons complete

Linux Networking

• 47min

0 / 8 lessons complete

Course Conclusion

• 5min

0 / 1 lessons complete

Configuring and Mounting a New Volume


Q&A (0)

Notes (0)

Resources (0)

Saving Progress...


There are no resources for this lesson.

Notes can be saved and accessed anywhere in the course. They also double as bookmarks so you can quickly review important lesson material.

Create note

In this lesson, you will learn the practical aspects of managing storage in a Linux environment, specifically focusing on how to add a new drive to a virtual machine (VM) in VirtualBox and then configure and mount this new volume on our "Ubuntu Server" VM. This is a crucial skill for anyone managing Linux servers, as it involves understanding how to expand storage capabilities and manage filesystems effectively.

Adding a New Drive to the VM in VirtualBox

To increase the storage capacity of your "Ubuntu Server" virtual machine (VM) in VirtualBox, you need to add a new virtual hard drive. Here's how to do it:

Ensure that your VM is powered off before attempting to complete the steps below. You can shutdown your VM with the `shutdown now` command

1. Start VirtualBox: Open VirtualBox and select the "Ubuntu Server" VM from your list of VMs.

2. Access VM Settings: Click on the "Settings" button while your VM is highlighted. This will open a new window where you can modify various settings of the VM.

image 2
Open VM Settings

3. Navigate to Storage Settings: In the settings window, click on the "Storage" tab. Here, you'll see your current storage setup, including any hard drives or optical drives attached to the VM.

4. Add a New Hard Drive: Look for the "Controller: SATA" or "Controller: IDE" section in the storage tree. Right-click on it and choose "Add Hard Disk".

image 3
image 3

In the new window, select "Create new disk". This will launch a wizard to guide you through the process of creating a new virtual hard disk.

image 4
Create a new Disk Image File

5. Configure the New Hard Disk: The wizard will ask you to choose the hard disk file type (VDI, VMDK, or VHD), the storage details (dynamically allocated or fixed size), and the size of the disk. Choose the options that best fit your needs. For most purposes, a VDI format with dynamic allocation is sufficient. Set an appropriate size for your new disk, keeping in mind the available space on your host machine. I am going to use a 25GB size;

6. Complete the Setup: Follow the rest of the prompts in the wizard to create the disk. Once done, click the Choose button in the Hard Disk Selector window.

image 7
VirtualBox Hard Disk Selector

You will see your new virtual hard disk listed under the storage controller in the storage settings:

image 8
VirtualBox storage settings

7. Start the VM: Close the settings window and start your "Ubuntu Server" VM. The VM will now have access to the new virtual hard disk you just added.

image 9
Start the VirtualBox Ubuntu Server VM

Next, we will move on to configuring this newly added volume within the Ubuntu Server environment.

Configuring the New Volume

Once the VM is up and running with the new drive added, we need to configure this new volume.

Identifying the New Drive: Open the terminal in your Ubuntu Server VM. Use the lsblk command to list all block devices. The new drive will typically be listed as /dev/sdb or similar, depending on your existing configuration.bash


When I run that command on my server, I can see the disk listed as sdb:

paulh@ubuntu-server:~$ lsblk
loop0                       7:0    0 111.9M  1 loop /snap/lxd/24322
loop1                       7:1    0  63.4M  1 loop /snap/core20/1974
loop2                       7:2    0  53.3M  1 loop /snap/snapd/19457
sda                         8:0    0    80G  0 disk
├─sda1                      8:1    0     1M  0 part
├─sda2                      8:2    0     2G  0 part /boot
└─sda3                      8:3    0    78G  0 part
  └─ubuntu--vg-ubuntu--lv 253:0    0    39G  0 lvm  /
sdb                         8:16   0    25G  0 disk
sr0                        11:0    1  1024M  0 rom

Creating a File System: Before using the new drive, you need to create a filesystem on it. Let's use the mkfs command to create an ext4 filesystem (a common Linux filesystem type). Replace sdb with your drive identifier if different.

Server Academy Members Only

Sorry, this lesson is only available to Server Academy Full Access members. Become a Full-Access Member now and you’ll get instant access to all of our courses.

0 0 votes
Lesson Rating
Notify of
profile avatar
Inline Feedbacks
View all comments