# FreeBSD boot hangs randomly "Root mount waiting for..."



## retux (Jul 20, 2020)

Hi everyone,

I installed FreeBSD version 12.1-STABLE on a pretty old netbook (Intel based motherboard).
Many times FreeBSD boots up fine and I can work with it normally, but quite randomly system boot hangs on the following message:

```
Root mount waiting for: usbus4 CAM
```
It seems to be an issue with the webcam, that it's usb based. But this issue only occurs certain times while FreeBSD is booting.

I can not disable the webcam by using the bios utility. I'd really like to fix this issue, I guess some kernel parameter can do the trick. Any tips will be highly appreciated.
Cheers!


----------



## tingo (Jul 20, 2020)

Do you get any more relevant info if you do a verbose boot?


----------



## George (Jul 20, 2020)

CAM is likely not the Webcam, but rather cam(4).

There is a `sysctl` regarding the wait time:
_vfs.root_mount_always_wait=1_


----------



## T-Daemon (Jul 20, 2020)

You can try to disable root mount waiting for USB by setting in /boot/loader.conf :


```
hw.usb.no_boot_wait=1
```


----------



## George (Jul 20, 2020)

I think he wants to wait, because he is booting from usb, isn't he?


----------



## T-Daemon (Jul 20, 2020)

Elazar said:


> I think he wants to wait, because he is booting from usb, isn't he?



I understood it that way, OP has installed on the netbooks hard disk, not USB. When *retux* comes back, the situation should be cleared up.


----------



## retux (Jul 20, 2020)

Hey guys,

Thank you for your responses.
This box is not booting from usb. This issue appears to happen 50% of boot times. That is why it is kinda "random".
I added hw.usb.no_boot_wait=1 to /boot/loader.conf and I saw the booting process getting stack while running /sbin/init as it can be seen on the snapshot attached. The behavior is pretty similar, it only fails some times, not always. Going to reverse hw.usb.no_boot_wait=1 change to see if I get the previous behavior.


----------



## T-Daemon (Jul 20, 2020)

Try what *tingo* suggested, set in /boot/loader.conf:

```
boot_verbose="-v"
```


----------



## VladiBG (Jul 20, 2020)

According to your attached screenshot your sata controller also fail to query the device. You may try to change your hard-disk to see if there's any difference.


----------



## Mjölnir (Jul 20, 2020)

You can also try 
	
	



```
kern.cam.boot_delay="2000"
```
 in /boot/loader.conf. IIRC it's in milli seconds.
EDIT Install sysutils/smartmontools and check the disk: `smartctl -t long /dev/ad0`


----------



## retux (Jul 20, 2020)

Hey guys,

I enabled smartd and it does not report errors so far. I suspect it might be a boot time issue because those times when the box completes the boot I can startx, and run enlightenment with no issues at all.
boot mode is set to verbose. And  kern.cam.boot_delay="2000" was also added to /boot/loader.conf as suggested by mjollnir. But still no luck half of the times boot get still stuck.
The machine is running multi-boot with grub2 and linux install on different partition (that linux works with no issue at all).


----------



## Mjölnir (Jul 21, 2020)

Sporadic failures are 99% due to bad hardware.  2nd, some controllers and devices (HDD/USB) have _quirks_ encoded in the kernel (they do not 100% comply to standards).  For shure Linux has similar things.  Carefully inspect the verbose boot messages of your Linux system, to see if they have a _quirk_ that FreeBSD does not have.


----------



## George (Jul 21, 2020)

I would rather try to increase the delay, so that cam can finish probing.. Something like kern.cam.boot_delay="10000".

Or set "vfs.root_mount_always_wait=1" in
/boot/loader.conf

`dmesg | grep usbus4` should tell you which usb device is causing the problems.


----------

