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 web interface
Verify the volume is attached¶
Logon to your instance and use
lsblk to find to which device name your volume is attached
You should see vd<letter> with the new size.
(optional) Scan the filesystem for errors¶
sudo e2fsck -f /dev/vd<letter>
Resize the file system¶
sudo resize2fs /dev/vd<letter>
Mount the new filesystem¶
sudo mount /dev/vd<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
You may need to wait few minutes before all the nodes see the newly mounted filesystem.
Check the size of the file system¶