[SOLVED] Debian on USB won't boot when other drives connected
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Debian on USB won't boot when other drives connected
I did a full install of Debian Stretch to a 32gb USB stick. Prior to installation I disconnected my Jessie HDD to ensure it would not be affected. After installing to the USB I rebooted the computer and the USB boots fine. I then shut down the computer, connected the HDD, and restarted the computer. The USB stick will not boot. I have verified that Fast Boot is disabled and that Secure boot is off. The USB stick shows up in the BIOS as being bootable. I also looked at the USB stick using Gparted and it has 3 partitions, VFAT, ext4, and swap. The VFAT partition is flagged as boot, esp. I also tried to boot the USB by pressing F12 to show a boot menu and selected the USB stick. Still won't boot. I then tried the stick on my Intel NUC running Debian Stretch. Same results. It won't boot.
Any clues as to what might be wrong with the USB installation, or where I might have gone wrong?
As a side note, I also installed the Debian Live with persistence to a USB stick and it booted fine.
The existence of the VFAT partition on the USB stick suggests you installed to the stick in UEFI mode. The failure to boot it with the HDD connected suggests Jessie on the HDD is configured in Legacy/MBR mode. You may need to change a BIOS setting to ensure only UEFI mode booting is permitted whenever you wish to boot the USB.
The existence of the VFAT partition on the USB stick suggests you installed to the stick in UEFI mode. The failure to boot it with the HDD connected suggests Jessie on the HDD is configured in Legacy/MBR mode. You may need to change a BIOS setting to ensure only UEFI mode booting is permitted whenever you wish to boot the USB.
I was thinking the same and would add. There is a compatible mode with my EFI motherboards that allow to boot both at the same time. With this you get an option to boot a drive in either EFI or normal BIOS. The F12 listing gives me an option of both one prefixed by EFI: drivename_or_os_installed to boot in EFI mode.
Okay. Secure Boot (disabled), Fast Boot(disabled) and Boot from USB (enabled) were all set as needed. The problem turned out to be as follows.
In the vfat (boot,esp) partition I found EFI/debian/grubx64.efi.
The boot/efi/EFI folder on the USB, was empty.
The UEFI BIOS was looking for EFI/boot/bootx64.efi, not EFI/debian/grubx64.efi. So I modified the vfat (boot,esp) partition accordingly.
Also, I modified the boot/efi folder so as to have boot/efi/EFI/debian/grubx64.efi.
After making those mods the USB stick booted like charm. Thanks for the feedback.
How do I mark this as solved?
Oh, by the way, my Gigabyte motherboard will boot UEFI and Legacy. After getting the USB (UEFI) to work I can boot either, depending if the USB is present or not. Cool.
Oops, just saw how to mark as solved. will now do so.
Last edited by CR_John; 04-29-2019 at 06:17 PM.
Reason: further clarification
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.