You can extend an existing volume from the NeCTAR Dashboard.


WARNING: The process requires some system administration skills and there is a risk that you can lose your data, so make sure you have a backup. It is also recommend that you try it out on a small test volume first.


The first step is to check that you have the required Volumes quota available.


To check your available quota in the Dashboard, click the Compute tab, then the Volumes sub-tab. The graph at the top of the screen shows how much of your volume storage allocation is being used. The Attached To column shows the Instance name and Device for the attached instance.



If you need additional quota, please see Managing An Allocation.


Once you have confirmed the required quota is available, the volume needs to be un-mounted on the instance. Login to the instance and un-mount the required device, for this example:


ssh -i <key file> <username>@<IP address>
...
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
...
/dev/vdb        9.8G  5.0G  4.3G  54% /mnt/cinder
$ sudo umount /dev/vdb


You can now detached the volume back in the NeCTAR Dashboard. Click Edit Volume then Manage Attachments.



Click Detach Volume here, and then again in the Confirm Detach Volume window. You may need to refresh the Dashboard page to see that the volume is no longer attached to the instance.



The Extend Volume option should now appear in the Edit Volume options. Click Extend Volume.



Enter the required New Size for the volume, and click Extend Volume.



You should see the new volume size in the Dashboard. Click Edit Volume, and then Manage Attachments to re-attach the volume to the required instance.



Select the required instance from the Attach to Instance list, then click Attach Volume.



Return to your instance ssh login session and re-mount the volume. Once remounted, you can see that the volume filesystem size is still the same.


$ sudo mount /dev/vdb /mnt/cinder
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
...
/dev/vdb        9.8G  5.0G  4.3G  54% /mnt/cinder


Depending on the volume filesystem type, you should now be able to extend the filesystem to match the new volume size. For example, using the resize2fs command. To resize the filesystem using resize2fs, first un-mount the volume.


$ sudo umount /dev/vdb


Perform a file system consistency check.


$ sudo e2fsck -f /dev/vdb
...
Pass 5: Checking group summary information
/dev/vdb: 12/655360 files (0.0% non-contiguous), 1363138/2621440 blocks


Resize the filesystem to match the volume size.


$ sudo resize2fs /dev/vdb
resize2fs 1.42.9 (28-Dec-2013)
Resizing the filesystem on /dev/vdb to 5242880 (4k) blocks.
The filesystem on /dev/vdb is now 5242880 blocks long.


Re-mount the volume and check that the filesystem size matches the new volume size.


$ sudo mount /dev/vdb /mnt/cinder
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
...
/dev/vdb         20G  5.0G   14G  27% /mnt/cinder


Your volume's extra storage is now ready!