USB boot loader to pick from Windows or Linux

I am looking for a boot loader. I have linux and windows install on 2 separate SSDs.
My setup, installed windows 10 onto my desktop.
Insert a drive into my laptop and install linux. Then plug the SSD drive with linux into my desktop.

What I want is a boot loader that installs onto a USB so I can pick to go into either Linux or Windows. Is this possible? I want to dual boot with out modifying the MBR or GPB boot table for windows or linux.

Then if I get tired of dual booting, I can pull the USB and then set which ever drive I want in the UEFI as the default.

That is achievable by

  • inserting your Linux Install ISO into your computer
  • inserting a blank USB stick medium large enough for a full OS install (recommend minimum 128 GB, unless someone knows it can be done with 64GB)
  • boot the computer to Install disk process
  • select the USB stick as the target for the OS
  • install the OS with GRUB and os-prober turned on

Once completed,

  • remove the install ISO,
  • boot the computer (with the USB stick as having plug-n-play priority over the internal disk for booting)
  • confirm you have the os-prober confirming that it offers your stick as first choice and your linux disk as second choice (on your laptob)
  • shut down
  • transfer the disk to the desktop
  • then reboot with the USB stick plugged in, again with plug-n-play priority to boot from USB
  • GRUB will run os-prober and offer the stick Linux as first choice, then the Windows and internal Linux as 2nd/3rd choices

at which point you can choose and the system will boot that selection.

:slight_smile:

I already have Linux and Windows installed. They are installed on 2 separate SSDs.

What I want is a boot manager, to select which OS to load when the computer boots up. I want the computer to boot from the USB that has the boot manager installed, and then the boot manager will allow me to select which boot loader to load, windows or linux.

I do not want to install linux to a USB.

Would rEFInd be suitable?

2 Likes

Refind would be fine, but I cannot find any docs on installing and using it from USB.

I spent several hours looking around, and I cannot find any bootmanagers, that support running from USB drives. This sucks. They all install into either windows or linux. I did find a workaround sort of.

If I press a Key during the post process, then I can select which boot device I want to use. However my motherboard does not see my linux install when doing this. The Motherboard is an MSI b250M Mortar, and uses UEFI. I built this computer in 2018.

I do not know what version of UEFI. I looked into trials for paid software, they were garbage. And tons of free options.

I am happy to go either way, I just do not know how to get what I need or where to go further from here.

Have a re-read of what @ericmarceau suggested. You would not actually be using the Linux OS on the USB, it was just a clever and simple way to end up with GRUB on a USB that is configured to use os-prober to find the Linux and Windows you already have so you could pick one of them every time you boot from the USB.

There are multiple ways to do this without installing a whole Linux OS to the USB, but it would require some careful reading and instruction following to achieve. Likewise for rEFInd which has a downloadable USB image linked right from the post that @tea-for-one pointed to.

Is there some reason you didn’t want your installed Linux bootloader to offer the Windows Boot Manager as an option? That’s how it is usually done and what the Ubuntu installer sets up for you if it sees you have Windows on the system and you answer yes when it asks if you want to dual boot.

1 Like

There is plenty of info in the links previously provided for rEFInd
Nevertheless, I’ve dragged some useful snippets here:-

(a) The following text from here

A USB flash drive image file—Although you can create your own rEFInd USB flash drive using the binary .zip file and its refind-install script, you may find it easier to download this version and copy it to your USB drive with dd or some other low-level disk copying utility.

(b) The following text taken from the readme within the refind-flashdrive-0.14.2.zip

The .img file in this archive should be bootable on any EFI-based computer.
It launches the rEFInd boot manager, which in turn should be able to locate
boot loaders on the computer’s EFI System Partition (ESP) or on other
partitions.

To use this disk image, you must copy it to a USB flash drive or similar
medium. Under Linux or Mac OS X, you can do this with dd as root, as in:

dd if=refind-flashdrive-{version}.img of=/dev/sdx

The method described in post 2 above would probably be the simplest for you. Installing windows/linux on an EFI system does not write any code to the MBR as there will be a separate vfat/EFI partition and the windows boot files will be in a directory named Microsoft and the Ubuntu files will be in a directory named ubuntu. They do not overwrite each other during install but will generally change the boot priority in the BIOS.

You indicate that your Linux drive is not seen in your Desktop computer so that means you can not boot it. You said you installed it on a laptop so can you boot it from the laptop? You need to have code in the nvram of the motherboard of the computer you are booting from. You can do that but it is a bit more complicated if you cannot boot your linux.

You don’t have to do a full install of Ubuntu or another Linux to a usb, you can simply install Grub to the usb. The problem with this is it requires creating a grub.cfg file and writing correct menuentries in the grub.cfg file which would seem problematic in this case. Using this method, you would not be able to update grub on the USB since grub has a number of different files in locations outside the /boot/grub directories.

The way most people do this when they want windows/linux on separate drives is to do the install with an EFI partition on each drive for the OS on the drive and select the drive from the BIOS. You can also use grub to boot either.

1 Like

If you want to later remove the flash drive and boot either install, each has to have full installs totally separate on each drive. Often with UEFI, only one ESP on first drive is used, and first drive is defined but UEFI/BIOS.

I found rEFInd worked on an old USB drive that was too small for anything else. I have used it for emergency boot. Refind is a boot manager or menu, not a boot loader. It uses the boot files in each install.
http://www.rodsbooks.com/refind/
My old 256MB (too tiny for just about anything) flash drive.
Extract refind ISO & change to folder it creates

cd refind-cd-0.11.3
sudo bash refind-install --usedefault /dev/sdc2 --alldrivers

I also put rEFInd and many repair ISO on a flash drive that I boot with Ventoy.
https://www.ventoy.net/en/doc_grub2boot.html
https://discourse.ubuntu.com/t/beyond-grub-usb-stick-with-refind/67747
https://discourse.ubuntu.com/t/beyond-grub-usb-stick-with-refind/67747
I extract Ventory in my ISO folder/partition change to the extracted sub-folder and run this to install to my sdb flash drive, which will erase anything else on drive.

fred@z170-noble:~/ISO/ventoy-1.1.07$ sudo bash Ventoy2Disk.sh -i -g /dev/sdb

1 Like

thanks everyone for the help. I did learn the difference in my research between a boot manager, and a boot loader.

This topic was automatically closed after 30 days. New replies are no longer allowed.