I have two external hard drives.I want to keep one plugged into a usb port permanently (let us call this one A) and another plugged in every now and then (let us call this one B). Both have Linux operating systems on them.

I want to boot from A if B is not plugged in and from B if it is plugged in.

How can I achieve this? For completeness my current bios look like the following:

enter image description here

It currently seems to be booting simply from the one it last booted from. (If it helps A and B will always be plugged into consistent usb ports and the laptop has no internal hard drive).

  • If you set B as first in the boot order and A as second, wouldn't that achieve your purpose? – harrymc Nov 25 '18 at 14:39
  • @harrymc That's what I thought, but I don't seem to get a separate option for the two hard drives in my list of boot options. – Quantum spaghettification Nov 25 '18 at 14:49
  • It's to understand from your picture what is which disk. – harrymc Nov 25 '18 at 14:50

The different USB ports you have will be internally numbered by the USB hub, so one of them will be #0, the next #1, etc. If you activate USB boot, the BIOS or UEFI tries to boot in that sequence.

You can see the assignment numbers in the Windows Device Manager (or a similar program in other OSs) - plug something in each USB port, check in the device manager which internal device number maps to which device, and you will know which of your ports has which number. You might need to dig a bit to find those IDs. There is actually specific software to make it easier, but it is not required; here an example from Windows USB view: USB view If you plug your 'A' device in a higher port number than your 'B' device, 'B' will be preferred for booting, and if it is not present, 'A' will be found and used.

I don't know the exact specs for your USB hub; it is possible that it tries to be clever, and assigns the numbers dynamically by usage - first device plugged in becomes #0, next device #1, etc. If this is the case, you cannot easily achieve what you want (because device 'A' would always have the lower ID).

  • Great info as it sort of pertains to something I am doing, but in this case OP did said Linux was the OS, not windows. Does Linux do the same thing as Windows? – Forward Ed Nov 25 '18 at 15:50
  • @ForwardEd OS is irrelevant, this is how USB works: ports have predictable order. I don't know if the answer is correct, though. Booting isn't handled by Windows, but by UEFI (which is unaware of what Windows is, it will boot whatever adheres to its spec: be it bootmgr, GRUB2 or Linux kernel) – gronostaj Nov 25 '18 at 16:55

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.