• Start sudo parted /dev/sda.

  • Print the partition table and take note of the End sector of the last line:

    unit s print free
    
  • Resize the sda2 partition (it should be shown by parted as 2):

    resizepart 2
    

    answering "yes" if parted warns you about the partition being in use and asks for confirmation; type in the number you obtained in step (2)—the last available sector on the device—appending the s (sectors) unit to it, when parted asks you for the end sector (you may then be asked to accept a slightly different final sector out of alignment reasons; that would be fine).

  • Print the partition table again (same as point (2)) to confirm that sda2 has been resized.

  • Quit parted.

  • Use lsblk /dev/sda to make sure the kernel is aware of the resized partition. If its shown size is still 10G, use sudo partprobe -s to refresh it and check it again.

  • Resize the file system:

    sudo resize2fs /dev/sda2
    

    You may be asked to run sudo e2fsck -f /dev/sda2 before being able to resize the file system. Do it and then retry the resize2fs command.
    When given no size argument, resize2fs grows the file system to match the size of the containing partition.

  • Use df -h /dev/sda2 to verify the new size.