Wednesday, April 20, 2016

#493 IaaS - Adding Storage Volumes to a running instance

We begin with a refresher -

A temporary, non-persistent storage volume is associated with your Compute Cloud instance on creation. Your instance boots from this nonpersistent storage volume.

What if you want to save applications or data on your instance?
Then you must create a persistent storage volume and attach it to your instance.
If necessary, you can also specify a bootable storage volume. Using a bootable storage volume
allows you to save any configurations made to your instance at OS level.
This allows you to delete from instance and create it again without losing your OS configurations.

Once created, we can attach it to one of our instances, from the previous post.

Please note: 

The disk number you specify here determines the device name.

The disk attached at
index 1 is named /dev/xvdb,
the disk at index 2 is /dev/xvdc,
the disk at index 3 is /dev/xvdd, etc.

Now I ssh into my vm.

Note disk xvdc above.

Now I create a disk partition -

sudo fdisk /dev/xvdc

I now create a file system - sudo mkfs -t ext3 /dev/xvdc1

Now mount - sudo mount -t ext3 /dev/xvdc1 /u01

No comments: