How to resize Nextcloud data disk with ZFS
The Nextcloud VM appliance comes configured with two disk - one for the OS and one for data. Both of them are 40g, which is to small to event store one backup of a modern phone. To fix it here is what you need to do:
-
If you have any data on the Nextcloud, make sure you have a backup
-
Shutdown the host - just in case
-
Login to VMware console and extend the second hard disk to the size you want
-
Start the server again
-
Login via ssh to nextcloud and become root (sudo su - should do the trick)
-
Look at the current zfs configuration: zpool list and check the disk usage: df -h
-
Update the partition size: parted -l than choose the “fix” option when asked
-
Delete the “buffer” partition: parted /dev/sdb rm 9
-
Extend the size of the first partition to utilize 100% of the disk: parted /dev/sdb resizepart 1 100%
-
“Unmount” the ZFS pool: zpool export ncdata
-
Mount the ZFS pool: zpool import /dev ncdata
-
Make the ZFS pool online: zpool online -e ncdata sdb
-
Check the new partition size with: zpool list and df -h