Install cloud-initramfs-growroot by entering the following commands in the terminal:
sudo apt update sudo apt install cloud-initramfs-growroot
automatically resize the root partition on first boot
This package adds functionality to an initramfs built by initramfs-tools. When installed, the initramfs will repartition a disk to make the root volume consume all space that follows it. . You most likely do not want this package unless you know what you are doing. It is primarily interesting in a virtualized environment when a disk can provisioned with a size larger than its original size. In this case, with this package installed, you can automatically use the new space without requiring a reboot to re-read the partition table.