You can initialize a volume that you attached to an instance to make it available for use. The volume can be either a BSU volume, or an ephemeral volume corresponding to an ephemeral storage disk.

This action formats the volume and mounts it to the instance so that you can access and modify its files. You can also create a back-up of the volume using snapshots. For more information, see Creating a Snapshot of a Volume.

The following procedures are available:

Initializing a Volume from a Linux Instance

Before you begin: Attach the volume to your instance. For more information, see Attaching a Volume to an Instance.

Set up your mounting environment

  1. Connect to your instance using SSH. For more information, see Accessing Linux Instances

  2. To get the device name (DEVICE_NAME) of the volume you want to mount, run the following command to display the list of devices attached to the instance: 

    $> lsblk

    Depending on the Outscale machine image (OMI) used to launch your instance, the attachment name and device name of the volume may be different. For more information, see About Volumes > Volumes Attachment and Device Names.

Create the file system 

  1. To check whether the volume already has a file system, run the following command: 

    $> file -s DEVICE_NAME

    If the command returns data only, the volume does not have any file system. You need to create one to use the volume.
    If the command returns more information, the volume already has a file system. You can either keep the existing file, or create a new one. 

  2. (optional) To create a file system on the volume, run the following command:

    To prevent data loss, back up all data on the device beforehand, for example using a snapshot. For more information, see Creating a Snapshot of a Volume.

    $> mkfs -t ext4 DEVICE_NAME

Mount the volume

  1. (optional) To create a mount point (MOUNT_POINT) for the volume, run the following command, with MOUNT_POINT the name of a new directory where you want to access the volume files: 

    $> mkdir /MOUNT_POINT
  2. To mount the volume, run the following command:


    - You need to partition the volume before mounting it. Otherwise, this command fails and an error message is returned.

    - For a temporary mount, you can use the /mnt directory as mount point.

    - If you use an existing directory as mount point, the data it already contains is still stored but remains invisible as long as the volume is mounted.

  3. (optional) To confirm that the mounting was successful, run the following command to display the list of all volumes mounted on the instance:

    $> df -h

    The volume is initialized from your instance and available for use. 

    You can control which users and applications can access and/or modify the files of your volume. For more information, see the File Security section in the Linux documentation project.

(optional) Configure persistent mounting

You can modify the /etc/fstab file to automatically mount the volume at every reboot of the instance: 

This file is critical to the system, and modifying or deleting it may damage your instance. We highly recommend creating a backup, for example using the following command:

$> cp /etc/fstab /etc/fstab.orig

  1. In a text editor, open the /etc/fstab file as root user. 

  2. At the end of the file, add information about the volume using the following format: 

    DEVICE_NAME MOUNT_POINT FS_Type FS_Options FS_Frequency FS_Check_Order
    • FS_Type: The type of file system, for example ext4, ext3, or XFS
    • FS_Options: The mount options of the file system (by default, defaults,nofail). 
    • FS_Frequency: The dump frequency of the file system (by default, 0). 
    • FS_Check_Order: The order of the file system checks at reboot (by default, 2). 
  3. To confirm, run the following command to mount the file system in the /etc/fstab file: 

    $> mount -a

    If the command does not return any error, persistent mounting is configured on your instance. 
    If the command returns an error message, persistent mounting is not properly configured. You need to restore the original /etc/fstab file at the next step, then start the Configure persistent mounting procedure again. 

  4. (optional) To restore the /etc/fstab file, run the following command: 

    $> mv /etc/fstab.orig /etc/fstab

Windows® is a registered mark of Microsoft Corporation in the United States and/or other countries.

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.

See Legal Mentions.