8

I run dual boot Ubuntu and Windows on my machine. Last night Windows started installing some updates and it stated the machine would restart a few times during the updates.

Well, after the first restart it brought up this GRUB rescue screen, and it seems my machine can't find the Ubuntu partition. I start to think Windows may have destroyed it by updating.

In all other threats I've found so far it says to execute the 'ls' command to find all partitions and the 'set' command to see what GRUB has set up.

ls returns:

(hd0) (hd0,msdos5) (hd0,msdos2) (hd0,msdos1)

OK, set returns:

cmdpath=(hd0)
prefix=(hd0,msdos7)/boot/grub
root=hd0,msdos7

Now I understand this is wrong. The solution would be to ls every partition until the Ubuntu one is found. I tried this by doing ls (hd0,msdos#)/ where # is one of the numbers shown by ls. All of the commands return:

error: unknown filesystem.

I also tried adding boot/grub and combinations to the command, but nothing works.

Now, my next plan is to get a Ubuntu live USB using somebody else's computer, but I can't right now.

What is wrong here? Is my hard disk drive broken? Did the uncompleted update break it? Is there another solution?

18
  • Ah... the notorious Windows 10 Anniversary Update. Your idea about seeing what's left using the Ubuntu Live DVD is a good idea. Your problem probably came up because your GRUB is always set to boot Ubuntu, and as you note, Windows wants to reboot itself... then it'll probably do a nasty and overwrite your GRUB with a standard Windows Boot Loader. For now, try and reboot into Windows to try and let the Windows update complete. Monitor any reboots, and choose Windows each time, until the update completes. Then you may have to worry about reinstalling GRUB using boot-repair. Cheers, Al
    – heynnema
    Aug 26, 2016 at 19:02
  • Alright, thanks for the answer. I'll have to note I had windows 10 installed already. It were just 'updates'. Also I can't get past the grub rescue. I can reach the bios but after that it shows the grub rescue, so I don't know how to boot into windows to finish the update.
    – Tijmenh
    Aug 26, 2016 at 19:12
  • Do you have either a Windows installation disk, or, Ubuntu Live DVD, or can get access to boot-repair on USB flash drive or CD? Search here on AskUbuntu for boot-repair, and see other posts about how to install and run boot-repair from the Ubuntu Live DVD. Cheers, Al
    – heynnema
    Aug 26, 2016 at 19:32
  • I've made a live USB now, I tried boot-repair but no results. I used Lilo to bypass grub and boot directly into windows. Finishing the update now. EDIT: Also used gparted and found out the Ubuntu partition is still there.
    – Tijmenh
    Aug 26, 2016 at 21:03
  • Sounds like we're making progress! Once/if you're able to boot into Windows, then boot-repair might work for you to restore dual-boot functionality. ps: Does the Ubuntu partition show up as EXT4, or something else? Cheers, Al
    – heynnema
    Aug 26, 2016 at 21:11

2 Answers 2

20

I had a very similar problem.

I dual boot Windows 10 and Debian (BunsenLabs), and if it is relevant then I use the (U)EFI BIOS system. Here is how I solved the problem.

Yesterday, I opened Windows for first time since summer, and it needs to install updates and to reboot and at second reboot I get the GRUB rescue prompt.

error: unknown filesystem
grub rescue>

ls gave: (hd0) (hd0,gpt6) (hd0,gpt5) (hd0,gpt4) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1)

In order to find a filesystem GRUB rescue could recognise I run through ls (hd0,#) where the hashtag is a number between 1 and 6 (note: one can leave out the "gpt"-part and probably also the "msdos" part if you use the old partition table).

It turns out gpt5 is my home partition and gpt4 is my Debian root partition. None of the other partitions had a filesystem that could be recognised (by GRUB rescue).

I now followed Carla Schroder's "How to rescue a non-booting GRUB 2 on Linux" guide. At the end of the guide she provides commands to boot from GRUB rescue. Notice when reading the guide, that at first she addresses the problem of booting from the normal GRUB prompt - that is not the rescue prompt, which is relevant to us, so read past that part, and you'll get to the rescue prompt.

Since my boot partition is gpt4, I ran the following commands:

set prefix=(hd0,4)/boot/grub
set root=(hd0,4)
insmod normal

The last one made the font of the prompt change a bit, and then the command

normal

which started the my normal GRUB 2 graphical boot menu. The guide didn't say anything about that, that would happen... but it worked splendid. I choose the Windows booter, and the update install continued. It rebooted another time, and sent me back into the GRUB rescue prompt, and I repeated the procedure, again choosing to boot Windows, and this time the update installation finished.

Now reboot manually (when the Windows update have been configured). Again I get the GRUB rescue prompt and I repeat, but this time in the graphical boot menu I choose my Linux (BunsenLabs), and when I have logged in I open a terminal and still following Carla Schroder's guide, I did

sudo update-grub

which finds my Linux image and the Windows boot manager, and then I did:

sudo grub-install /dev/sda

Finally I reboot again to check that everything works. I now directly get the graphical GRUB boot menu and both Linux and Windows can be chosen.

I hope this will be helpful, if anyone experiences a similar problem.

9
  • 2
    Thank you @daniel... thank you thank you thank you!!!
    – atreeon
    Jan 7, 2019 at 13:16
  • This worked perfectly for me dual booting Linux Mint 19.1 and Windows 10, after updating to 1809. In my case, the only filesystem recognized was (hd0,msdos4) as ext2.
    – John B
    Mar 24, 2019 at 21:06
  • 2
    This should be the accepted answer. Jun 10, 2019 at 14:39
  • @LucaD'Amico The first two comments come from users other than the original poster. What (may have) worked for them may not apply to the original poster's problem. And, if you note, John B problem also occurred after a major Windows update, and that their Ubuntu partition had been changed to ext2. Either testdisk or Ubuntu reinstall would fix that kind of problem... not a GRUB reinstall.
    – heynnema
    Jun 10, 2019 at 15:50
  • As I said in your answer, I was able to recovery my system using these steps after the windows 10 may 2019 update. Jun 10, 2019 at 16:22
1

Major Windows updaters have a bug that changes Linux partition types on MBR disks. Either use testdisk see how to here to fix your MBR partition problem, or a full Ubuntu install would be needed to fix the problem in this case.

6
  • 1
    Nope, an ubuntu reinstall just to fix an issue with GRUB is not what is needed. Check Daniel answer for a full fix. Jun 10, 2019 at 14:39
  • @LucaD'Amico Never mind that this is a three year old answer... if you read the comments, you'd see that a major Windows update changed the linux partition from ext4 to some other partition type, and that's why Ubuntu no longer boots. It's a known Window updater bug. It's not a GRUB problem, or something boot-repair can fix. Three years later I can say that testdisk might be something to try instead of a reinstall, but it's a very technical tool that requires intimate knowledge of disk partitioning to use properly. You can remove your down vote please.
    – heynnema
    Jun 10, 2019 at 15:32
  • I got this problem after updating my windows installation (may update), and yeah it changed my partition from ext4 to ext2 (or at least that's what grub recovery shell told me). I was able to fully recover my system by following the Daniel's answer. No testdisk needed. So yeah, I can remove the downvote but still your answer is clearly wrong. I repeat: after windows 10 May 2019 update, grub failed to find partition (it saw my ext4 partition as ext2), but after following Daniel's answer I fully recovered my system and I have NOT used testdisk. Jun 10, 2019 at 16:19
  • yeah I have GPT. Okay, so if you specify that a full reinstall may be needed for users with MBR partition table (and not GPT), I can remove the downvote. Jun 10, 2019 at 16:30
  • @LucaD'Amico Yes, for MBR disks, testdisk or reinstall.
    – heynnema
    Jun 10, 2019 at 16:31

Not the answer you're looking for? Browse other questions tagged .