You can initialize a BSU volume that you attached to an instance to make it available for use.

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

    Important

    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:

    Warning

    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:

    $> mount DEVICE_NAME /MOUNT_POINT

    Important

    - 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. 

    Tip

    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 mouting

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

Warning

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 ext4ext3, 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


Initializing a Volume from a Windows Instance

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


  1. Connect to your instance. For more information, see Accessing Windows Instances.

  2. In the task bar, right-click Windows   , then click Disk Management
    The Disk Management utility appears. 

  3. Right-click the disk corresponding to the volume you want to mount, then click Online.

  4. (new disk only) If mounting the disk for the first time, do the following actions to initialize it:

    Warning

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

    1. Right-click the disk, then click Initialize Disk
    2. In the dialog box, select a partition. 
    3. Click OK to validate. 

  5. To create and format the volume, right-click the unallocated space of the disk, then click New Simple Volume and follow the instructions on screen. 


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





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.