# USB Devices stop BSD from booting?



## SirFixAlot (Sep 8, 2018)

I've noticed that when I reboot my box, if I have any USB device plugged in (keyboard, mouse, thumb drive, wifi dongle) , the reboot will hang ---just stick on black screen--- the next go around. It's as if the hand-off between bios and boot gets jacked somehow. If I _unplug _all the USB devices, then upon booting, it will _not _hang and start up as usual.

Question: Is this normal? I can't imagine everyone is unplugging and re-plugging in all their USB devices upon a reboot. 

What might be the issue?  Issues with the motherboard or BIOS/ UEFI?  

Any troubleshooting tips are welcome. 

Thanks!


----------



## kpa (Sep 8, 2018)

See if it's your usb thumb drive only, if that is formatted in FreeBSD the BIOS of your system might choke on the unusual partitioning/filesystems.


----------



## ralphbsz (Sep 8, 2018)

Completely not normal.  I have oodles of USB stuff plugged into my server (keyboard, UPS, extra ethernet, a disk drive, serial ports, and often a memory stick), and it boots perfectly fine.

Either your motherboard is borken, or your BIOS is misconfigured, or you are using a kernel build that is borken, or one of your USB devices is borken.  Note that it is easily possible for a single device to "hang" the boot so much that people think the machine has crashed.  I've seen that many times with disk drives (although not with USB attached ones): If the drive has a problem that causes the HBA adapter card to spend 45 minutes of 4 hours attempting to read it while doing the BIOS initialization (to determine whether to boot from the drive), then the user will thing the boot has hung.  In reality, the boot is making slow progress, namely trying to examine all attached disks to determine whether they are bootable.  The correct fix is to figure out which diskdrive is the cause of the problem (not easy on a machine that has 300 or 800 disks attached), disconnect it, and throw it in the trash.  The wrong fix is to hit the reset button again and again.  An OK but not productive fix is to hit the reset button a few times, and then going to the next bar and drinking.


----------



## SirDice (Sep 10, 2018)

SirFixAlot said:


> if I have any USB device plugged in (keyboard, mouse, thumb drive, wifi dongle) , the reboot will hang


Does it hang during boot or during shutdown?


----------



## Martin Paredes (Sep 14, 2018)

For me, the problem is with the BIOS/UEFI code (a timeout to long), an update to the BIOS/UEFI should be tried and if the problem persist the manufacture should be contacted.

A PC with Windows 7 in the job has the same problem, it is configured to boot from HHD, but if a USB stick is connected when the PC is power on, it hang (the user has 3 USB connected)

The problem was with 1 specific USB (the PC can boot from HDD with the other 2 USB stick connected)


----------



## k.jacker (Sep 14, 2018)

Try `# sysctl hw.usb.no_shutdown_wait=1` and reboot.
If that works add it to /etc/sysctl.conf

```
hw.usb.no_shutdown_wait=1
```

The cause is most probably a usb compatibility issue. Playing with the compatibility options in the BIOS/UEFI might help,
but could also break other USB devices.
I experienced that, too, with an external sound card, that prevented one of my computers
from shutting down, while all other computers (all FreeBSD) would shut down without problems, with that usb sound card connected.


----------



## SirFixAlot (Nov 19, 2018)

Thanks all for the troubleshooting tips. I played around with the BIOS/UEFI to the point where nothing worked and it was taking way too much time. I set it aside and figured a new build is in order... something with guaranteed hardware support. So, I'll be building a new box soon. Yay.


----------



## ShelLuser (Nov 19, 2018)

Late reaction but this is completely normal behavior, depending on your hardware. It's caused by the BIOS which is scanning for bootable devices and when you have specific devices plugged in then this can take up ages. I've seen this behavior with several boxes, went over all the options in the BIOS but nothing had any effect.


----------

