To clarify, I am not talking about making installation media. My installation USB works just fine. What I want to do is install Debian 12 Bookworm to a second USB drive to use as the permanent boot drive for a machine.
As for why I want to do this: I have a small HP elitedesk 800 G3 mini-pc. It has both an NVMe drive and a 2.5" SATA drive. I want to turn it into a file server with RAID 1 between the NVMe and SATA drives, with a USB drive in the back as the boot drive (yes I know about the issues of wear-out from running an OS from a USB drive. I am okay with this).
My procedure so far has been simple: insert both the installation USB and the target USB. I am able to detect and install the OS to the target USB without issue. The system then reboots and I am able to log into the OS from the USB drive (performance depends a lot on the speed of the USB drive being used, I have tried a few different types and settled on an abnormally fast USB drive which performs pretty well as far as I can tell).
However, as soon as I shut down from that first boot and remove the install USB, the next time I boot, the BIOS says “boot device not found” as though it cannot detect any OS. And after that I am completely unable to boot into that drive ever again. I have gone into the BIOS and changed as many settings as I can think of, such as turning off secure boot, turning off fast boot, verifying that the boot order is set to boot from USB. Nothing so far has worked.
Does anyone have any thoughts for what could be wrong? I know sometimes booting from a USB is treated differently from booting from a internal drive, but I am unclear on the exact details of this.
Any help would be much appreciated.
Okay, I was able to find a workaround. I use rEFInd as the boot manager on my everyday laptop so I just installed that onto the boot partition of the thumb drive.
I took out the USB drive, plugged it into my laptop and ran
refind-install --usedefault /dev/sdb1
(or whatever the ESP partition is of your thumb drive, and you would have to have refind installed first), then plugged it back into the mini PC again.I had to disable secure boot, which is par for the course with Linux I guess, and after that refind loaded and seems to be working consistently now.
It would have been nice for the sake of this thread to have found a solution within Grub, but unless someone comes by with a solution, I may just stick with refind for now. I have nothing against Grub, but honestly I have grown to love refind for the degree to which it just. freaking. works.