Recover Linux Dual Boot after update to Windows 10

Here’s the problem: I dual boot Windows 7 and Ubuntu 14.04, after deciding to upgrade Windows to 10, I ended up with upgrade partially finished and GRUB going into rescue mode.

That means that Windows messed up GRUB and possibly corrupted Linux’s partition. Here are basic steps I had to take to recover Linux + Windows dual boot (make sure you have a live USB to boot from):

1. Finish Windows upgrade. To do that we’d have to pass the GRUB rescue and be able to boot in Windows. Installing boot-repair and using its one click repair function should do the trick (boot from live USB and choose “Try Ubuntu”):

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install boot-repair

Now run boot repair

boot-repair

And use it to fix GRUB. Chances are at this moment you end up only having Windows (check what gparded shows for your Linux partition to be sure). After boot-repair is done, write down its paste URL and restart the computer without USB to finish Windows update.

2. Recover Linux partition. If you didn’t get your Linux back after finishing p.1, you’d have to recover it. Boot into live USB again and then install testdisk:

sudo apt-get install testdisk

Now run it

sudo testdisk

And use it to fix your Linux partition. Basic steps would be:

  • Create Log File
  • Select the hard drive that contains Linux partition
  • Select the partition type (probably just leave default since testdisk should know better)
  • Hit “Analyse” to perform quick analysis

At this moment testdisk must have found your Linux partition, select it in the list and hit “p” to list files, make sure it’s the correct one. Return to analysis results (“q”) and hit Enter, check the list of all partitions and if it looks good – Windows one should be bootable / primary (*), Linux logical (L) – choose “Write”.

Now reboot your computer without USB, you should get Windows again, it’s ok, it means it wasn’t messed up in the process of recovering Linux partition. Reboot into Live USB again, use Nautilus to mount your Linux partition, you should now see the files and be ready for the last step.

3. Recover GRUB (again). Since the first time we ran boot-repair our Linux partition was unaccessible it only saw Windows, now that we recovered Linux and rebooted, it will see both systems. From live USB session run:

boot-repair

After that you have to be able to boot into both systems again, congrats!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.