0

I'm new here and new to the world of Linux.

I followed instructions on how to create a bootable linux drive on my external SSD (240gb SSD with 1x 20gb partition and 1x 220gb partition).

I installed Linux on the 20gb partition to these instructions: How to install Ubuntu on portable external Hard Drive? (except I didn't "try linux" from the bootable USB device, I installed it), and I put the bootloader on the ext4 that I created on the 20gb partition.

It's all installed now and works, however when I boot up, my machine now goes to Ubuntu to ask if I want to boot up Windows 10 or if I want to boot Ubuntu. This is annoying and I want to change it back to normal (auto boot to windows 10 unless I say otherwise).

Next thing that is very problematic is that if I unplug the external SSD, my original Windows 10 can't boot at all, with an error message saying "Reboot and Select proper Boot device", which means now to boot Windows 10 from my primary drive, I NEED the external SSD plugged in.

I would like Windows to boot as normal (from my primary drive, automatically), unless I specifically press F12 and select to boot from Ubuntu. Can anyone help?

snodge182
  • 1
  • 1
  • Old BIOS or newer UEFI installs? You want to have grub boot loader on external drive, and ubuntu first in boot order and Windows second. Then if external not plugged in, it will default to Windows. May be best to see details, use ppa version with your live installer (2nd option) or any working install, not older Boot-Repair ISO: Please copy & paste the pastebin link to the Boot-info summary report ( do not post report), the auto fix sometimes can create more issues. https://help.ubuntu.com/community/Boot-Repair – oldfred Jun 13 '20 at 14:31
  • @oldfred Hi oldfred, I think I have successfully made the report here: paste.ubuntu.com/p/55c6hMHJYr – snodge182 Jun 13 '20 at 15:36
  • @oldfred I tried the recommended repair: http://paste.ubuntu.com/p/9n2QY9PgMw/ – snodge182 Jun 13 '20 at 15:42
  • See launchpad bugs 1173457,1396379,1702335. Grub's bootloaders go to first EFI parrtition it finds (on your Windows disk), but the rest of the grub files are on the SSD. Just reset your preferred OS (Windows) as first in the EFI boot list, and copy the hdd's EFI to the SDD's EFI, so that device may be booted if selected in the efi menu. – ubfan1 Jun 13 '20 at 15:48
  • The auto fix just reinstalled existing grub. That will not fix anything in your case. – oldfred Jun 13 '20 at 15:48
  • The fix suggested by ubfan will also work but you need to add missing Windows entry, and create the ESP on the external drive to have someplace to copy files to. You need to copy /EFI/Boot & /EFI/ubuntu as the full install of grub to boot from external uses /EFI/Boot/bootx64.efi but also needs extra files in /EFI/ubuntu. A live installer is a stripped down version of grub and only needs /EFI/Boot/bootx64.efi. But all external drives in UEFI boot mode boot from UEFI entry of drive (name, label, or similar) and use /EFI/Boot/bootx64.efi. – oldfred Jun 13 '20 at 15:53

1 Answers1

1

Ubuntu's Ubiquity does not correctly install to external devices. See this bug, but you do not need to reinstall:

https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1396379

Both Windows & Ubuntu are installed in UEFI boot mode. Not sure why you do not have an UEFI boot entry for Windows. This should add a Windows UEFI boot entry or you need to run Windows repairs from your Windows repair/recovery flash drive (you did make one?)

sudo efibootmgr -c -L "Windows Boot Manager" -l "\EFI\Microsoft\Boot\bootmgfw.efi"  /dev/sda -p 2

That will allow you to boot Windows or Ubuntu if external plugged in from f12 UEFI boot menu.

But if you ever want to boot external on another PC, you need to have grub boot loader on the SSD. UEFI only directly boots external drives from /EFI/Boot/bootx64.efi as a USB drive boot entry (same type as installer was).

Since you use Windows to make SSD as gpt, you have the Microsoft Reserved partition as first partition. That is required by Windows before first NTFS bootable partition on a drive. But since you cannot boot Windows from external, it is not required. And then can be converted to an ESP - efi system partition with gparted as FAT32 with boot/esp flag. Then you can use Boot-Repair and its advanced options to install grub to external drive. Afterwards double check that /etc/fstab is updated with new UUID from ESP on external, not existing sda2's UUID. Otherwise major grub update may update internal but not external drive's ESP.

After creating ESP on sdb, use advanced options to choose install on sdb2, and install grub to sdb drive.

https://sourceforge.net/p/boot-repair/home/Home/

oldfred
  • 12,100
  • Thank you Fred, this doesn't make a lot of sense to me but I loaded up terminal anyway and plugged in the script you wrote for me. It comes back with "efibootmgr: invalid option -- '1' "

    This is becoming concerning now as I really need to be able to use my Windows PC when my external SSD isn't plugged in. I'm leaning towards giving up with Linux as it seems even when I specified for it not to touch my sda drive whatsoever, it has still gone ahead and made it unbootable

    – snodge182 Jun 13 '20 at 16:18
  • Would you mind telling me how I can make my Windows drive bootable 'as-normal' again, without the dual boot or anything (I'll keep Linux installed on the SSD for the moment until I know Windows is fixed and back to normal again) – snodge182 Jun 13 '20 at 16:23
  • See also man efibootmgr It shows options and you must not have copy & pasted command. your -1 is not one, but should be the lower case L or el. – oldfred Jun 13 '20 at 16:35
  • I have just done as you said, thank you it processed it successfully. However there are no differences, if I disconnect the external SSD I still can't boot Windows from the Primary. The idea was to have a system similar to if I had 2 hard drives; 1 hard drive plugged in at any one time, and swapping between the two based on if you wanted to use linux of windows. Perhaps that's just something we can't do with tech yet. I now need to remove the Linux system in an attempt to fix what it has done, so that I can continue to use Windows for my work/day job. – snodge182 Jun 13 '20 at 17:04
  • Did you go into UEFI and change boot order, that would probably be f2? You should now have a Windows entry in f12 and can set it first and choose Ubuntu when you want it, or have Ubuntu as first in boot order. You can also use efibootmgr to change boot order. Again look at man efibootmgr and the sudo efibootmgr -o command. http://askubuntu.com/questions/485261/change-boot-order-using-efibootmgr – oldfred Jun 13 '20 at 17:15
  • The first screen I see when I boot up asks me if I want to go into BIOS or if I want to choose which device to boot from. In that list of bootable things is 'P5: Atapi...', 'ubuntu', and 'P1: Samsung EVO...'. The last one 'P1:Samsung Evo...' is where my windows is installed, however if I select that then I get the "Reboot and Select proper boot device" error message. I also tried P5 and that said the same thing. Only through booting to ubuntu (which takes me to grub 2) I then select Windows or ubuntu. Problem is that this is only accessable from the external hard drive (sdb: Integral 240gb) – snodge182 Jun 13 '20 at 17:30
  • Well I looked in the EFI partition of my internal drive and formatted it as it was missing all the files except ubuntu. Perhaps when Linux installed it just didn't want its competitor being so close to it and obliterated all of the files. Either way, the drive is completely unbootable now and also so it seems, is the external hard drive. Its weird because I completely left the internal drive alone during the install of linux but it seems when I do something to one, the other drive is adversely effected. Suffice to say my first experience of Linux has been horrible other than the GUI – snodge182 Jun 13 '20 at 20:03
  • You cannot reformat ESP as that is where all your boot files are. Windows & Ubuntu exist without issue in ESP on virtually every system we have seen. Some have issues on the UEFI boot entry, but there are various work arounds for those systems. Now the only way to repair system is to use Windows repair flash drive to reinstall the Windows boot files and use Boot-Repair's advanced mode to totally reinstall grub. Be sure in both cases to be in UEFI boot mode. – oldfred Jun 13 '20 at 21:06
  • Thank you, I ended up with two operating systems and neither could boot. I resulted in using a friend's PC to read my internal drive and save anything I needed to keep, then had to reinstall Windows fresh. I am going to try Linux again but this time I am going to have my internal drive completely unplugged so it can't worm its way back in there again. This way I'm sure when I boot up with both attached, it will go to the normal bootloader and I can either select Windows as normal, or ubuntu (which will take me to grub)... at least thats how I picture it working – snodge182 Jun 15 '20 at 19:48
  • As a side note, I notice ubuntu is still in my boot list... strange considering its been completely wiped from both drives. – snodge182 Jun 15 '20 at 19:50
  • UEFI remembers boot entries. But also changes paths when drive unplugged. Did you not get a "Windows" boot entry after using efibootmgr to add an entry? You can remove old entries with efibootmgr & -b option. https://askubuntu.com/questions/63610/how-do-i-remove-ubuntu-in-the-bios-boot-menu-uefi Grub will add Windows to boot menu if both are installed in UEFI boot mode and you have Windows fast start up off, so the Linux NTFS driver can see the NTFS partitions. http://askubuntu.com/questions/843153/ubuntu-16-showing-windows-10-partitions – oldfred Jun 15 '20 at 20:35