SOLVED Windows ate my grub-efi

New to Debian (Or Linux in general)? Ask your questions here!

SOLVED Windows ate my grub-efi

Postby Rob2D » 2020-02-18 15:26

So, Windows, in it's neverending quest to outdo itself at causing hardship, decided to wreck my grub-efi from a completely separate drive. I booted to Windows yesterday and when I turned my back for a second it started "checking disks". Sure enough I was unable to get back into my Linux drive afterwards.

https://imgur.com/cY7wnvn

I managed to fix the problem after reading around but just wanted to post here to make sure I did everything right. Also because I'm not sure what exactly I did to change it (and also maybe because I'm proud I was able to fix a Linux problem by myself).

I pretty much followed this guide here:

https://wiki.debian.org/GrubEFIReinstall

I got rEFInder and it picked up my Debian no problem and I was able to get back in.

https://imgur.com/uHyyikV
https://imgur.com/NF5mxN9

I had a look around and to my eyes (keep in mind that I am an idiot) everything looked to be in the right place as far as I understand it:

https://imgur.com/Yztz6UB
https://imgur.com/StsX7C4

I finished the guide anyway and did the grub-efi reinstall and now everything is back to normal:

https://imgur.com/eIVrzd3

Hurrah.

I guess my question is, was it just as simple as a reinstall or could I have fixed it another way? AND, more importantly, is there anything I can do to guard against this happening again in the future??? (short of the poetic justice that would be throwing my Windows drive out a window)
Last edited by Rob2D on 2020-02-18 18:17, edited 1 time in total.
Rob2D
 
Posts: 5
Joined: 2020-02-14 12:34

Re: SOLVED Windows ate my grub-efi

Postby Head_on_a_Stick » 2020-02-18 15:57

Please replace your oversized images with URLs, we have forum users with limited bandwidth and this thread will cost them dear as it is now. TIA.

Rob2D wrote:could I have fixed it another way?

Make a new NVRAM boot entry for Debian by running this command from a live ISO image (booted in UEFI mode):
Code: Select all
# efibootmgr --disk /dev/sda --part 1 --create --label "Debian" --loader /EFI/Debian/shimx64.efi

^ That presumes Debian's EFI system partition is /dev/sda1 (which is actually the default so the --disk & --part arguments can be omitted for that configuration).
User avatar
Head_on_a_Stick
 
Posts: 11992
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: SOLVED Windows ate my grub-efi

Postby Rob2D » 2020-02-18 18:14

Head_on_a_Stick wrote:Please replace your oversized images with URLs, we have forum users with limited bandwidth and this thread will cost them dear as it is now. TIA.


Yeah I can do that. I actually almost made them bigger at the time :lol:

Head_on_a_Stick wrote:Make a new NVRAM boot entry for Debian by running this command from a live ISO image (booted in UEFI mode):
Code: Select all
# efibootmgr --disk /dev/sda --part 1 --create --label "Debian" --loader /EFI/Debian/shimx64.efi

^ That presumes Debian's EFI system partition is /dev/sda1 (which is actually the default so the --disk & --part arguments can be omitted for that configuration).


Yeah that's what I was after. I'll make a note of it.
Rob2D
 
Posts: 5
Joined: 2020-02-14 12:34

Re: SOLVED Windows ate my grub-efi

Postby Head_on_a_Stick » 2020-02-18 18:47

You could also try running the grub-install command with the --removable option, which should allow the drive to be booted even without an NVRAM entry but Windows' bootmgfw.efi loader might take preference.

See https://www.rodsbooks.com/efi-bootloade ... ive-naming for more on this.
User avatar
Head_on_a_Stick
 
Posts: 11992
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: SOLVED Windows ate my grub-efi

Postby Rob2D » 2020-03-09 08:49

Oh my god it happened again! This is ridiculous.

Micro$oft you absolute shower of scumbags! :evil:
Rob2D
 
Posts: 5
Joined: 2020-02-14 12:34


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable