Initializing a Volume from an Instance

After attaching a volume to an instance, you need to initialize the volume to make it available for use.

Linux Instance

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

(blank new volume only) Create the File System of the Volume

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

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

    $ lsblk

    Inside the instance, a device that you named xvdX in your OUTSCALE account is typically renamed sdY. For more information, see About Volumes > Linux Instances.

  3. (optional) To verify that the volume is blank, run the following command:

    $ sudo file -s /dev/DEVICE_NAME

    If the command returns data only, the volume does not have a file system and you need to create one.
    If the command returns something else, the volume already has a file system.

  4. To create and format an xfs file system on the entirety of the volume, run the following command:

    $ sudo mkfs -t xfs /dev/DEVICE_NAME

    We do not recommend partitioning your volumes or using LVM on the OUTSCALE Cloud, as these affect volume performance. We strongly recommend using your volumes directly as is.

Mount the Volume

  1. To create a directory to serve as the mounting point of the volume, run the following command:

    $ sudo mkdir /MOUNT_POINT
  2. To mount the volume on the mounting point, run the following command:

    $ sudo mount /dev/DEVICE_NAME /MOUNT_POINT

    To confirm that the mounting is successful, you can run the df -hT command to display the list of all volumes mounted on the instance.

    The volume is initialized and available for use.

(optional) Make the Mounting Permanent

To make the mounting of the volume persist across reboots, you need to modify /etc/fstab, which is the file that configures and mounts the volumes of the instance. To avoid any potential loss of access to your data, it is recommended to create a backup of this file before modifying it, using the following command:

$ sudo cp /etc/fstab /etc/fstab.orig
  1. Open the /etc/fstab file using the following command:

    $ sudo vim /etc/fstab
  2. Press i to enter insert mode, then add the following line at the end of the file:

    /dev/DEVICE_NAME /MOUNT_POINT    xfs defaults,nofail 0   2

    For more information about possible configuration options, see for example the fstab page in the official Ubuntu documentation.

  3. Press Escape, then type :wq to save the file.

  4. (optional) To verify that the file is valid, run the following command to re-execute it:

    $ sudo mount -a

    If the command returns an error message, the options in the file are not valid. You need to restore the original file and reconfigure it.

    To restore the original /etc/fstab file, run the following command:

    $ sudo mv /etc/fstab.orig /etc/fstab

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 a Windows Instance.

  2. Click the Start menu, type diskmgmt.msc, and click the program that appears.

  3. In the bottom-left panel, right-click the disk corresponding to the volume you want to mount, then click Online.

  4. (blank new disk only) If you are mounting the disk for the first time, do the following actions:

    1. Right-click the disk, then click Initialize Disk.

    2. Click OK to validate.

    3. Right-click the unallocated space of the disk, then click New Simple Volume…​ and follow the instructions in the dialog box.

    The volume is initialized and available for use.

Related Pages