Use > Set up an Attached Volume

Set up an Attached Volume

After you create a Block Storage Volume (while creating a subscription) and attach it to an instance, you must perform the following tasks within the instance to use the attached volume:

  1. Use SSH to connect to your server

    Enter the following command to use SSH to log on to your instance:

    $ ssh –i <keypair><myinstance>@<ipaddress>

    For example:

    $ chmod 0600 keypair1.pem
    $ exec ssh-agent bash
    $ ssh-add keypair1.pem
    $ ssh -i keypair1.pem cirros@10.11.12.5
  2. Format the volume

    1. Enter the following command to ensure that the device for new volume is present:

      $ ls /dev/vdb
      /dev/vdb
    2. Enter the following command to format the volume:

      $ mkfs /dev/vdb
  3. Mount the volume

    1. Enter the following command to mount the newly formatted disk:

      $ mkdir /Test
      $ mount /dev/vdb /Test
    2. Enter the following command to verify that the newly mounted volume has the correct size:

      $ df –h

      A similar output similar is displayed:

      Filesystem Size Used Available Used% Mounted on
      /dev 998.2M 0 998.2M 0% /dev
      /dev/vda 387.4M 10.4M 357.0M 3% /
      tmpfs 1001.8M 0 1001.8M 0% /dev/shm
      tmpfs 200.0K 96.0K 104.0K 48% /run
      /dev/vdb 1007.9M 1.3M 955.4M 0% /Test

      You can see from the output that the Cinder-created volume has the correct size. This indicates that the process has worked successfully.