Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Refresh language, layout

Panel
bordertrue
titleThis page:

Table of Contents
maxLevel1

After creating your instance, you will most likely want to create and attach a data volume to store all your data on. We also encourage running all your analyses on the data volume, so that you are not using up your root volume space on your instance.it is important to have a place to store your data. The usual way to do this is with a data volume attached to your instance.

Warning

Storing input or output data on the root volume of your instance can quickly fill it up, leading to problems with using or even logging into the instance. Follow the instructions below to use a data volume instead.

Create and Attach a Data Volume

Create and attach a volume


  1. Log in to the Nimbus dashboard.
  2. Navigate to Volumes > Volumes, then click + Create Volume to bring up the + Create Volume buttondialogue window.

    Note

    You may see an existing volume already there, with a name like 91bd1e23-ce06-41e0-aeb5-41382df48170. It is most likely the root volume for your instance, and you can ignore it.

    On the Create Volume dialog window, enter


    1. Enter a volume name
    and choose a size of your choice in gigabytes, then click the Create Volume button. On
    1. Enter a Size in gigabytes
    2. Click Create Volume
  3. Back on the Volumes page, click the drop-down arrow next to Edit Volume and select click Manage Attachments.

  4. Select the an instance you want to attach this volume to.
  5. Click the Attach Volume button.
Format and mount

Create a filesystem


Once you have attached the volume as above, confirm that the volume is properly attached.

Info

You may see the /dev/vda device when working with volumes and filesystems, e.g. with the df command. This is the root volume, mounted at / (known as slash or root), where the operating system and system files are stored. You will not be performing any format or mount commands on this device.

  1. Use ssh to log in to your instance from a terminal.
  2. Check that you have properly attached the volume:

    Code Block
    $ sudo fdisk -l /dev/vdc

    You should see this returned:

    Code Block
    Disk /dev/vdc: 20 GiB, 21474836480 bytes, 41943040 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes


  3. (Only new volumes) Format the volume with a new filesystem:

    Note

    Do this step only for new volumes. Do NOT do this step for existing volumes, as it will wipe any existing data on it.


    Code Block
    $ sudo mkfs.ext4 /dev/vdc


Mount the filesystem


  1. Mount the volume to a new directory called /data:

    Code Block
    $ sudo mkdir /data
    $ sudo mount /dev/vdc /data


  2. Check your new /data volume:

    Code Block
    $ df -h | grep vdc


  3. Check that you can write files to your new volume:

    Code Block
    cd /data
    touch test.txt

    If you see an error about 'permission denied', you most likely need to change the owner of the volume to ububtu ubuntu (that's you!) with the following command

    Code Block
    sudo chown ubuntu /data


You have now successfully attached and mounted your data volume.

Note

You need only create and attach a volume to your instance once, and should only format the filesystem once.

If your instance is rebooted for any reason, you will need to mount your volume again.


Resize a Volume


It is possible to resize an existing data volume to make it larger, if additional space is required in an instance. This option is dependent on a few things:

  • You need to have sufficient volume storage quota in your project. Go to the "Overview" page on the Nimbus dashboard to see how much volume storage is available.
  • You cannot resize a root volume of an instance (the volume mounted as /dev/vda1 inside the instance). If you require a larger root volume, your only option is to delete the instance and re-create it with a larger root volume on the "Source" section during instance creation.
  • You cannot shrink an existing volume. The new volume size must be larger than the old size.

Provided it meets all these requirements, you can resize a volume by the following steps:

  1. Log on to the instance, and make sure that any file systems on that volume are unmounted (use "umount" if it is mounted):

    Code Block
    $ df -h
    $ sudo umount /data


  2. Leaving your instance login active, log on to the Nimbus dashboard, go to the "Volumes" page, and select "Manage Attachments" from the drop-down menu to the right of the volume
  3. Click on "Detach Volume", and confirm
  4. Once detached, select "Extend Volume" from the drop-down menu to the right of the volume
  5. Enter the new size in GB (it must be larger than the current size), then click on "Extend Volume"
  6. To re-attach the volume, select "Manage Attachments" from the drop-down menu to the right of the volume
  7. Select the instance you want to attach it to, make a note of the value of the "Device Name" field (usually usually /dev/vdc), then click on "Attach Volume"
  8. Go back to your active instance login from step 2, and make sure that the operating system can see the attached volume:

    Code Block
    $ sudo fdisk -l /dev/vdc


  9. Run a file system check on the patition partition first (assuming that the partition is is /dev/vdc,  although fdisk will tell you if the partition has a different name like /dev/vdc1):

    Code Block
    $ sudo e2fsck -f /dev/vdc


  10. Resize the partition to use the additional space added to the volume:

    Code Block
    $ sudo resize2fs /dev/vdc


  11. You can now mount the volume again (replace /data with the mount point you normally use for the volume):

    Code Block
    $ sudo mount /dev/vdc /data