Is there a way to make a USB flash drive not detected on a reboot, to avoid the PC trying to use it to boot from? Assuming you only have control over the flash drive and are not administering the PC. I know you can to disable it from the PC, and that there are ways to make the flash drive boot up an OS.
My problem, I have a portable apps drive full of useful stuff, but when I reboot I have to unplug and plug it back in or whatever PC I am working on at the time hangs.
A software solution would be best, but if anyone knows of a USB device that only becomes powered some time after boot up that would be interesting as well.
Best Answer
Summary
Boot into Linux (Live or installed) and run
sudo grub-install /dev/sdX
wheresdX
is the file connected to your USB drive. To find the location of your USB drive usesudo parted -l
orsudo fdisk -l
[1] (I am not sure how this will work with UEFI firmware)Main
My issue was I have a portable USB hard drive that I use for backups. I set my BIOS to first boot from USB because, sometimes I have to boot a live OS image from USB. When I would reboot my system, the system would try to boot the portable hard drive and hang.
[1] https://askubuntu.com/q/180023
[2] https://unix.stackexchange.com/a/23588/183350
[3] The first sector (512 bytes) is the Master Boot Record (MBR). The MBR has two sections: the Master Partition Table and the Master Boot Code. The Master Boot Code goes from byte 0-446 and contains the code that the system will use to boot the specified partition. Bytes 447-512 contain the actual partition table. If this is damaged or zeroed the system may not be able to read the partitions. http://www.dewassoc.com/kbase/hard_drives/master_boot_record.htm
[4] https://unix.stackexchange.com/questions/259143/how-does-grub-stage1-exactly-access-load-stage-2