How to resize a volume¶
To resize your volume please follow these instructions:
Unmount the volume¶
First you should manually unmount the filesystem from your instance.
sudo umount /path/to/mounting/directory
(optional) nfs export¶
If the filesystem is exported via nfs it is better to check if any files has been kept open by the system and then stop the nfs server.
lsof +D /path/to/mounting/directory
sudo service nfs-kernel-server stop
Web Interface to Detach, Extend and Reattach¶
Detach the volume from the server¶
To detach the volume from your server:
- From Dashboard, on Volumes tab, find your volume
- Select the volume and click Manage Attachments
- Click Detach Volume and confirm your changes
Extend Volume size¶
Select volume and click extend volume and specify the new size
Reattach Volume to running instance¶
Attach volume to Instance using the ScienceCloud GUI. Check the Attach Volume section for detailed information.
Verify the volume is attached¶
On the ScienceCloud GUI, select the Volume tab and check what is reported in the Attached To and Size fields. Alternatively, logon to your instance and use lsblk
to find to which device name your volume is attached
lsblk
You should see entries like /dev/vd<LETTER>
or /dev/sd<LETTER>
with the new size – where <LETTER>
is a lowercase latin letter like a, b, etc.
(optional) Scan the filesystem for errors¶
sudo e2fsck -f /dev/sd<LETTER>
Resize the file system¶
sudo resize2fs /dev/sd<LETTER>
Mount the new filesystem¶
sudo mount /dev/sd<LETTER> /path/mount/point
(optional) Restart the NFS server¶
If mounted volume was exported via NFS, you should restart the NFS server
sudo service nfs-kernel-server start
Note
You may need to wait few minutes before all the nodes see the newly mounted filesystem.
Check the size of the file system¶
df -h