Bitnami How-To Guides for AWS Cloud

Add Elastic Block Storage (EBS) Volumes for Bitnami Applications on AWS


If your Bitnami application host on Amazon Web Services (AWS) is running out of storage space, there’s an easy fix: increase available storage by adding a new Amazon Elastic Block Store (EBS) volume to it. EBS volumes are persistent block storage volumes that are available in either SSD or HDD format and come with a 99.99% availability guarantee for maximum data security and reliability.

This guide walks you through the process of adding more storage to a Bitnami application instance running on AWS by creating and attaching an EBS volume to it.

Assumptions and prerequisites

This guide assumes that:

Step 1: Identify your Bitnami application instance in the AWS EC2 Console

The first step is to identify your Bitnami application instance and note down the instance ID and availability zone. To do this:

  • Log in to the AWS EC2 console.

  • From the “Services” menu, select the “EC2” service.

  • From the EC2 Dashboard, select the “Instances -> Instances” menu item.

  • Search for and select your Bitnami application instance from the list of available instances.

  • From the instance details pane, note the instance ID and availability zone. You will need these details in subsequent steps.

    Instance details

Step 2: Create and attach an EBS volume

The next step is to create a new EBS volume and attach it to the Bitnami application instance. Here’s how:

  • Log in to the AWS EC2 console (if you’re not already logged in).

  • From the “Services” menu, select the “EC2” service.

  • From the EC2 Dashboard, select the “Elastic Block Store -> Volumes” menu item.

  • Click the “Create Volume” button.

  • On the “Create Volume” page:

    • Select the volume type (SSD, HDD or magnetic) and specify the storage size.

    • Select the same availability zone as the instance.

    • Specify whether the volume should be encrypted.

    • Click the “Create Volume” button to proceed.

      Volume creation

  • Once the volume has been created, note the volume ID. Navigate back to the “Elastic Block Store -> Volumes” page.

  • Search for and select the newly-created volume from the list of available volumes.

  • From the “Actions” menu, select the “Attach Volume” menu item.

    Volume attachment

  • In the resulting dialog, enter the instance ID (obtained in Step 1) for your Bitnami application instance. Note the automatically-generated device name and click the “Attach” button to connect the EBS volume with the instance.

    Volume attachment

Step 3: Format and mount the EBS volume

You’re almost done! The final step is to let the Bitnami application instance know about the new volume. This involves formatting the instance with a file system and mounting it so that it can be used. Perform the following steps:

  • Log in to the application instance using SSH.

  • At the console, run the lsblk command and confirm that the EBS volume has been mapped by checking the device name from Step 2 against the command output.

      $ sudo lsblk

    Volume map

    NOTE: Devices originally created as /dev/sdX in the AWS EC2 console may be mapped with the name /dev/xvdX in the lsblk command output.

  • Format the new device with mkfs, remembering to use the name shown in the lsblk output:

      $ sudo mkfs.ext4 /dev/xvdX

    Volume formatting

  • Create a directory and mount the volume with mount:

      $ sudo mkdir /data
      $ sudo mount -t ext4 /dev/xvdX /data

    Once mounted, check that the storage volume is available with df.

    Volume mounting

  • Edit the /etc/fstab file and add an entry to it for the new volume, as shown below:

      /dev/xvdX       /data   ext4    defaults,nofail

    This ensures that the volume will be automatically remounted if you reboot the instance.

Your new storage volume is now mounted and available for use. To add more volumes, repeat Steps 2 and 3.

To learn more about the topics discussed in this guide, consider visiting the following links:

Last modification September 6, 2018