Wednesday, July 25, 2018

grub2 - Dual boot between ubuntu 18.04 and windows 7 boots straight into ubuntu

I know there are several threads on these but none of their solutions seem to help me.



I had WIN7 and Ubuntu 14.04 installed on this computer and dual booting was working fine. Keep in mind they are being booted from the same SSD. I updated ubuntu to 18.04 (It failed updating through the terminal and I did a clean reinstall with a live usb) and grub disappeared and it boots straight into ubuntu. All my windows files are still here and intact.



What I've tried:





  • os-prober and update-grub or update-grub2 (made no difference).

  • boot-repair and boot-info, none of which made a difference.

  • Used the grub config file to force grub to load (grub loads but the only option I have is to start ubuntu).

  • Tried manually adding the win7 installation to the grub config file without much avail (but I probably did this wrong anyway).

  • Tried grub-customizer, which did not detect win7.



The boot-info pastebin file is found here:



http://paste.ubuntu.com/p/yRDNz8rnCk/




According to the pastebin it seems there is windows 7 loader files on sda1 and sda2 (Assuming one of these is the system reserved partition?) but if I run update-grub I get the following output:



Found linux image: /boot/vmlinuz-4.15.0-33-generic
Found initrd image: /boot/initrd.img-4.15.0-33-generic
Found linux image: /boot/vmlinuz-4.15.0-29-generic
Found initrd image: /boot/initrd.img-4.15.0-29-generic


So I get the impression it does not find windows at all. Should it be looking in sector 2 of sda instead of sector 1? I honestly have no clue what is wrong here.




Any help would be greatly appreciated.



Edit: When I try to manually add windows to grub I get the following error:



error: no such device: D8E475D4E475B57A
error: can't find command 'drivemap' .
error: invalid EIF file path.



Thinking maybe I should repair the win7 loader.



Edit 2: I tried repairing the win7 boot manager using a win7 live usb. It finds windows ok but assures me there are no errors.



Edit 3: Running boot-repair on a live usb instead of in the installed version gave a tiny bit of progress. After doing this, two instances of win7 showed up in grub (Windows 7 /dev/sda1 and Windows 7 /dev/sda2). This is how it used to look when I was dualbooting with ubuntu 14.04.



Unfortunately, neither of them work, prompting this error:



error: file '/boot/grub/x86_64-efi/ntfs.mod' not found.
error: no such device: 4CA8732DA8731524.

error: can't find command 'parttool'.
error: invalid EFI file path.


Upon restarting the computer these two instances of win 7 were gone again.



Edit 4:



I read someone said that checking the partition with gparted fixed some issues for them which made it work. Well, when I tried doing this I got an error message pertaining to sectors being listed multiple times and that I should do chckdisk /f /r. Thinking maybe there were sector issues I made a new windows live USB so I could run chckdisk from the command window. I booted into BIOS and told BIOS to boot from USB. Instead it loaded GRUB (but now in a much higher resolution) and selecting win 7 actually booted into my win 7 installation and everything seems to work fine.




If I do NOT attempt to boot through the usb, win7 will NOT work through Grub. What's more confusing is that if I try to access this USB from Windows it says it is corrupted (I had some error messages when I attempted making the windows bootable so I'm assuming that's why).



Long story short I have a solution if I want to use Windows, but it's not exactly ideal... Maybe this additional information helps diagnose the problem.

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...