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 suorsudo -i
- Check the zpool size using zpool list
- Check the /mnt/ncdata size using df -h
- Read the new partition size using parted -lwith 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/sdbyou 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#
 
 
 
I tried on 18.04 vm and had to do the following for expand command to work
ReplyDeletezpool export ncdata
zpool import -d /dev ncdata
zpool online -e ncdata sdb
That is perfect, thanks a lot! I will cover it in a new article :-)
DeleteThank you :) See here: https://how2itsec.blogspot.com/2020/12/increase-disk-and-zfs-of-nextcloud-vm.html
Deletethat's work for me too. Thanks!
DeleteThats work with 20.04 LTS NC 25.03 too. Thanks :)
DeleteOMG TY!!! Took me few days to try and expand it got stuck only to find this in the comments.
Deleteubuntu indirmek için tıklayın: ubuntu indir
ReplyDelete