If you are running a virtual machine with NextCloud v16 on linux ubuntu and you want to extend /mnt/ncdata, then:
- Make sure your backup is fine, think about creating a vm snapshot
- Extend second virtual harddrive disk in VMWare virtual machine settings (e.g. from 40Gb to 170Gb)
- Login using SSH/VMWare-Console, change to root user using
sudo su
orsudo -i
- Check the zpool size using
zpool list
- Check the /mnt/ncdata size using
df -h
- Read the new partition size using
parted -l
with the answer "fix" for the adjustment - You can delete the buffer partition 9 using
parted /dev/sdb rm 9
- Extend the first partition using to 100% of the available size
parted /dev/sdb resizepart 1 100%
- Using
zpool online -e ncdata /dev/sdb
you can adjust the partition to the correct size - Check the new zpool size using
zpool list
- Check the new /mnt/ncdata size using
df -h
root@nextcloud:/mnt# zpool list
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
ncdata 39.8G 15.2M 39.7G - 0% 0% 1.00x ONLINE -
root@nextcloud:/mnt#
root@nextcloud:/mnt#
root@nextcloud:/mnt# df -Th
Filesystem Type Size Used Avail Use% Mounted on
[...]
ncdata zfs 39G 896K 39G 1% /mnt/ncdata
[...]
root@nextcloud:/mnt#
root@nextcloud:/mnt# parted -l
[...]
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 183GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 42.9GB 42.9GB zfs zfs-28cd7
9 42.9GB 42.9GB 8389kB[...]
root@nextcloud:/mnt#
root@nextcloud:/mnt#
root@nextcloud:/mnt# parted /dev/sdb rm 9
Information: You may need to update /etc/fstab.
root@nextcloud:/mnt#
root@nextcloud:/mnt# parted /dev/sdb resizepart 1 100%
Information: You may need to update /etc/fstab.
root@nextcloud:/mnt#
root@nextcloud:/mnt# zpool online -e ncdata /dev/sdb
root@nextcloud:/mnt#
root@nextcloud:/mnt# zpool list
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
ncdata 170G 2.51M 170G - 0% 0% 1.00x ONLINE -
root@nextcloud:/mnt#
root@nextcloud:/mnt# df -h
Filesystem Size Used Avail Use% Mounted on[...]
ncdata 165G 896K 165G 1% /mnt/ncdata
[...]
root@nextcloud:/mnt#
Update 25.12.2020: If you are running Ubuntu 20/Nextcloud VM 20, then follow the instrutions here starting point 7: https://how2itsec.blogspot.com/2020/12/increase-disk-and-zfs-of-nextcloud-vm.html