As Krunal said, gdisk will ruin your grub, to avoid rescue mode:
If boot from BIOS, you'd better create a BIOS boot partition before you write and quit gdisk. (Otherwise a EFI partition is required if boot from UEFI).
And you grub-install /dev/sda
to fix your bootloader then reboot and good luck.
i.e. I used the 2048 sectors between sda1 and sda5, exactly 1MB for BIOS boot partition:
Number Start (sector) End (sector) Size Code Name 1 2048 999423 487.0 MiB 8300 Linux filesystem 5 1001472 41940991 19.5 GiB 8E00 Linux LVM
Number Start (sector) End (sector) Size Code Name
1 2048 999423 487.0 MiB 8300 Linux filesystem
5 1001472 41940991 19.5 GiB 8E00 Linux LVM