----------------------------
Symtom:
----------------------------
error: no such partition
Entering rescue mode...
grub rescue>
1. Find linux
grub rescue> ls
(hd0) (hd0,gpt7) (hd0,gpt6) (hd0,gpt5) (hd0,gpt4) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1) (hd1)
grub rescue> ls (hd0,gpt6)
(hd0,gpt6): Filesystem is unknown.
grub rescue> ls (hd0,gpt7)
(hd0,gpt7): Filesystem is ext2.
grub rescue> ls (hd0,gpt7)/boot
./ ../ ...... /grub ......
grub rescue> set root=(hd0,gpt7)
grub rescue> set prefix=(hd0,gpt7)/boot/grub
grub rescue> insmod normal
grub rescue> normal
5. Using step no. 3, we enter Debian OS to repair grub. We reinstall grub-efi-amd64, or run apt-get install without --reinstall to install grub-efi-amd64
# apt-get install --reinstall grub-efi-amd64
# mkdir /boot/efi
# fdisk -l
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 2248606F-393A-467A-9527-D0649049F9E3
Device Start End Sectors Size Type
/dev/sda1 2048 616447 614400 300M Windows recovery environment
/dev/sda2 616448 821247 204800 100M EFI System
/dev/sda3 821248 1083391 262144 128M Microsoft reserved
/dev/sda4 1083392 244840447 243757056 116.2G Microsoft basic data
/dev/sda5 245762048 567171071 321409024 153.3G Microsoft basic data
/dev/sda6 567171072 582795263 15624192 7.5G Linux swap
/dev/sda7 582795264 976771071 393975808 187.9G Microsoft basic data
# mount /dev/sda2 /boot/efi/
# grub-install /dev/sda
Installing for x86_64-efi platform.
Installation finished. No error reported.