Score:0

Grub broken and password lost

cn flag

My grub is broken and my PC is booting into the grub command line. I managed to get the PC to reboot with the following commands:

set prefix=(hd0,2)
set root=(hd0)
insmod linux
insmod normal
normal

My PC reboots normally after I issue the command, however when I reboot my PC returns to the grub command line.

Where is my issue. I cannot fix grub from the bash command line because I lost my password. How do I fix grub and recover my lost password from this point?

Bash prompt

ru flag
Without seeing the grub errors that *dropped* you to the prompt we can't help you. Are you able to take a picture of the screen with your phone or a camera when you are at the GRUB prompt so we can see the items before it that triggered that drop to the prompt?
Hendré avatar
cn flag
Hi @ThomasWard. I updated the post with the prompt image. No errors are given.
Score:1
de flag

I would put this as a comment but don't have the reputation to do so, so I'll leave an answer instead. If you are able to edit GRUB entries, you could always try entering into single-user mode upon booting up. This will put you inside of a root shell where you can run passwd <your user name> and change your password to something new without needing to remember your old one.

Hendré avatar
cn flag
I have managed to boot into single-user-mode and succesfully reset my password. However dispite running sudo update-grub, my grub menu remains broken. Every time I reboot I end up at the grub prompt. How do I restore my grub menu?
Organic Marble avatar
us flag
What did you do right before this started happening? Did you update `fstab`, add a drive, change something in `/etc/grub.d/`? Don't hold back information if you want help.
Hendré avatar
cn flag
@OrganicMarble I lost my password and tried to reset it using the bash shell from the grub menu. I must have made changed to grub that now makes it boot to the grub shell every time. Exactly what changes I made I can unfortunately not recall.
Hendré avatar
cn flag
I a computer repeatedly boots into the grub prompt, there must be a procedure to restore grub to it's original state.
christopolise avatar
de flag
[This](https://sourceforge.net/p/boot-repair/home/Home/) is another tool that I have used when my GRUB appears to be broken. Even though it looks old, I have seen it work for older systems, maybe you could give it a try?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.