Ubuntu Hard Disk LUKS encrypted, change (increase) partition size

Hi, I just installed NC on my QNAP as a Virtualization Station VM, all worked like a charm. When setting up the VM, I created a Virtual Disk of 4TB and during the UBUNTU 20.04 Server install, I selected LUKS encryption, as I want the data on the disk to be encrypted when at rest (I have had bad experience with the integrated end-to-end encryption in the past and on mobile devices…)

All worked just fine but I shortly after realized the partition was only 200GB in size strangely enough, this is my FDISK output:

Disk /dev/loop0: 29.9 MiB, 31334400 bytes, 61200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/loop1: 54.98 MiB, 57626624 bytes, 112552 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/loop2: 71.28 MiB, 74735616 bytes, 145968 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/loop3: 273.12 MiB, 286384128 bytes, 559344 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/vda: 4 TiB, 4398046511104 bytes, 8589934592 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: E0126602-2D84-44B0-A474-A346BAD80024

Device       Start        End    Sectors Size Type
/dev/vda1     2048       4095       2048   1M BIOS boot
/dev/vda2     4096    2101247    2097152   1G Linux filesystem
/dev/vda3  2101248 8589932543 8587831296   4T Linux filesystem

Disk /dev/mapper/dm_crypt-0: 3.102 TiB, 4396952846336 bytes, 8587798528 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

This is the drive that is only 200GB:

Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 200 GiB, 214748364800 bytes, 419430400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

So my question is, does anybody have a step by step instruction how to resize and encrypted LUKS partition with Nextcloud on it? Noteworthy I am still at early stages of the process, and if easier, I could re-install Ubuntu Server with NextCloud…

Worth pointing out:

  • I have physical access to the QNAP that hosting the VM
  • SSH is obviously working
  • if you all tell me it’s a stupid idea to use LUKS encryption on a NC instance, I’d reconsider an unencrypted volume which I can managed in an easier way in terms of GPARTED and FDISK…

Thanks!!

Oh man, I do feel embarrassed by answering my own question… Just came across this after I was searching all day long…

Seems to do the trick!