3

Windows 10 + Ubuntu 16.04 LTS dual boot on a Lenovo Laptop.. after getting nagged about an update... I have been dumped into the grub rescue screen

grub rescue>

and a lot of the help for dual boot linux users seemed to rely on ls showing you a valid partition.. none of the partitions I am seeing are returning as valid file systems

grub rescue> ls
(hd0) (hd0,msdos5) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1) 

grub rescue> ls (hd0,msdos5)/
error: unknown filesystem.

I am told I should grab a USB live stick.. boot in .. but a little bit uneasy since most of these walkthroughs are from 2015 & seem to get people stuck..

Windows 10 upgrade led to grub rescue

can someone nail down exactly what is the proper procedure ..

UPDATE 1

I tried to utilize the boot-repair utility, used the default repair.. shutdown and restarted.. didn't work, still seeing grub rescue and the same partitions as before

UPDATE 2 Now going through testdisk, here's the latest output enter image description here

http://paste.ubuntu.com/25572230/

UPDATE 3 Performed the quick scan, my files are seemingly there.. but when I do the deep scan I get this warning

enter image description here

Leaving everything marked for deletion.. in my experience I need to select the partition with the boot file in the root dir to be bootable, and unmark for deletion all the rest...

enter image description here

Erik
  • 260
  • 1
  • 6
  • 24
  • There's not a proper procedure, it depends on what really happened. I supposed you either have an old PC or a new one and installed everything in Legacy mode? –  Sep 18 '17 at 20:01
  • post this: sudo parted -l to see if the Windows bug deleted a logical ext4 partition. If missing then testdisk or parted rescue to restore partition and probably reinstall of grub is required. – oldfred Sep 18 '17 at 21:02
  • @MichaelBay I did not install Windows on this machine, so cannot comment on procedure it was installed. – Erik Sep 19 '17 at 12:49
  • @oldfred , I am stuck at Grub rescue screen.. guessing you mean to go into a USB live session of ubuntu to perform that action? – Erik Sep 19 '17 at 12:49
  • Back up existing partitions, just in case you make a mistake. sudo sfdisk -d /dev/sda > PT_sda.txt Copy to another device/drive. Testdisk is showing multiple Linux partitions (you may have resized several times.). But it looks like your last screen shows all your partitions including the missing Linux one? I would not keep D on all the others. Others have said parted rescue is easier as it is using sectors. http://askubuntu.com/questions/665445/upgraded-to-windows-10-on-dual-boot-and-cant-boot-to-ubuntu-partition/665462 – oldfred Sep 19 '17 at 15:12
  • Did testdisk work out for you @erik? I have the same problem – mickadoo Sep 24 '17 at 03:07
  • @mickadoo after a long and scary path, yes! It is scary because I wasn't sure it'd work.. but I had little to lose if it borked it. let me check the answer – Erik Oct 07 '17 at 09:33
  • @mickadoo i ended up in the end, deleting the swap.. rebooting, reinstalling grub, then re-making the swap partition once I booted back into the system – Erik Oct 07 '17 at 09:34

2 Answers2

1

Windows 10 Anniversary Update, and the more recent Windows 10 Creators Update, have a really bad habit of wiping out Linux partitions on MBR disks. Sounds like you're a victim.

Recovery is possible, but it can be tricky.

Boot to the Ubuntu Live DVD/USB.

Open Software & Updates and make sure that all of your software repositories are enabled.

In terminal...

sudo apt-get update # update the software database
sudo apt-get install testdisk # install testdisk
man testdisk # read the manual
sudo testdisk # start testdisk

You can also get specific instructions here: http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step

heynnema
  • 70,711
  • Getting unable to locate package testdisk – Erik Sep 19 '17 at 12:52
  • 1
    @Erik open Software & Updates and make sure that all of your software repositories are enabled, and then try again. – heynnema Sep 19 '17 at 12:55
  • All my partitions seem listed in this tool.. I'm trying to figure out how to recovery properly.. guessing in the link you sent I need section 11 Partition table recovery ? – Erik Sep 19 '17 at 13:13
  • 1
    @Erik follow the example at the web site that I reference. First you try to discover where your Linux partition USED to be, then you manipulate the partition table to restore the proper values so that the partition is returned to its original state. It's not easy. There's no real way to walk you through the process. But the web site is the best resource that I've found :-) Oh, I see you've updated your question... let me look at it... – heynnema Sep 19 '17 at 13:21
  • 1
    @Erik see partition 4? It's an "extended" partition that used to contain two "logical" partitions... your Ubuntu partition and a swap partition. What's missing between partitions 4 and 5 is your Ubuntu partition. That's what you need to recover. The display seems to be showing the start/end in CHS (cylinder/head/sector) format, which is outdated, and which makes it difficult. You really need to see it in sector format. In testdisk, you'll want to see if there's a pref, or some such, to show the start/end in sector format. – heynnema Sep 19 '17 at 13:28
  • The deep scan didn't find anything new, but all drives are now marked as unrecoverable. In my experience.. I need to keep my partitions, but mark one of them to boot to.. but it feels I may be in over my head here. Might just hand this back to IT – Erik Sep 19 '17 at 13:40
  • 1
    @Erik yes, it requires a healthy knowledge of disk partition structure. Thankfully I've never actually had to do it myself on my own disk. – heynnema Sep 19 '17 at 13:48
  • I wish testdisk would update to sectors. Testdisk uses CHS - formula for conversion to LBA http://en.wikipedia.org/wiki/Cylinder-head-sector – oldfred Sep 19 '17 at 15:07
0

From the link you posted, it seems that the win10 upgrade repartitions the HDD and deletes non windows partitions.

So before you can do the grub repair steps that you found, you have to recover the deleted linux partitions.

Boot from a liveCD or USB and install testdisk.

ravery
  • 6,874