1

I have a multi-boot machine with a Ubuntu 14 partition, an ubuntu 16 partition and a Windows partition (probably Windows 10). I hadn't used Windows in over a year and after rebooting, it forced me into Windows updates. After that, my machine won't reboot. I get to the GRUB rescue prompt. The only error message is

error: no such partition

I could not run any useful commands from the GRUB rescue prompt, so I removed the hard disk and mounted it on a separate Ubuntu PC. I ran parted on the disk and this is what it looks like:

Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  525MB   524MB   primary   ntfs            boot
 2      525MB   1015GB  1014GB  primary   ntfs
 3      1015GB  1015GB  891MB   primary   ntfs            diag
 4      1015GB  2000GB  985GB   extended
 5      1983GB  2000GB  17.1GB  logical   linux-swap(v1)

I want to fix grub so it can multi-boot Windows (Partition 2), Ubuntu 14 and Ubuntu 16. I don't remember how I created the Ubuntu partitions, but I'm hoping they are somewhere in the extended partition 4 (maybe they are logical volumes?). Can I do this?

UPDATE: I was able to recover the two Ubuntu partitions with testdisk. I then rebooted into Ubuntu 14 via grub rescue mode. I think the hard part is done. Now, I have to get grub working correctly. Currently, this is what I have to do in order to get to the grub boot menu:

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

How can I fix things so that grubs runs without having to go through the grub rescue prompt? Possibly load grub into the Master Boot Record?

5
  • Win10 uppdate repartitions the drive and deletes linux partitions. try testdisk to recover the partitions, in most cases it will boot normally after recovery
    – ravery
    Oct 2, 2017 at 17:07
  • Are you kidding or are you serious? Does WIn10 update really delete Linux partitions? How do I get testdisk?
    – JB_User
    Oct 2, 2017 at 17:09
  • yes I am serious. testdisk is in the repo sudo apt-get install testdisk
    – ravery
    Oct 2, 2017 at 17:11
  • It's true. See this
    – Redbob
    Oct 2, 2017 at 18:06
  • 1
    It not just Windows 10, this Windows bug has been there since Windows 7. often a reinstall of Windows 7 did same. Windows updates partition table but "forgets" to write logical Linux partitions. See askubuntu.com/questions/654386/… Parted rescue seems easier than testdisk askubuntu.com/questions/665445/…
    – oldfred
    Oct 2, 2017 at 19:00

1 Answer 1

4

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

Update:

Your missing Ubuntu partitions were between partitions 4 and 5, and went from 1015GB to 1983GB-1.

8
  • I had previously tried booting a Ubuntu Live USB but that failed. I get to the point where the screen is blinking on and off every second or so. Something isn't right. And I can't consistently boot to that point with the Live USB. RIght now the problematic hard drive is mounted in an external drive enclosure on a working Ubuntu machine. I hope to fix from that machine.
    – JB_User
    Oct 2, 2017 at 21:01
  • I think you are right in tha tthe missing partition is between 1015GB and 1983GB. However, there are two missing Ubuntu partitions in there.
    – JB_User
    Oct 2, 2017 at 21:12
  • Why do you think there were two Ubuntu partitions there? Also, the partition has to end before 1983GB, 'cause that's the start of the swap partition. That's why I said 1983GB-1. The problem booting the Live USB may be with your video card... use the nomodeset parameter to get it to boot. Lastly, you can install testdisk on your working Ubuntu machine.
    – heynnema
    Oct 2, 2017 at 23:02
  • Also, with a 2TB HDD, you should be using GPT formatting. Is your computer UEFI?
    – heynnema
    Oct 2, 2017 at 23:07
  • I don't know how to answer that. It is a fairly new PC (purchased in 2016 April). I knew the answer to that at one time, but I do admin work so infrequently that I forget everything 18 months later when problems happen. Anyway, I'm not at the point where I can boot the machine into Windows, or either of the Ubuntu partitions. However, I have to go through the grub rescue mode to get there. Do you know how I can have grub load automatically?
    – JB_User
    Oct 3, 2017 at 0:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.