FreeBSD boot time

ist

New Member


Messages: 5

Hi, newcomer here.

I'm having problems with unusually long boot time of the system. It takes around 45 seconds. I don't remember it being that way last time I tinkered with FreeBSD. The system I installed it on is Thinkpad T440p with i5-4300m, 12GB RAM and I used the m.2 SATA SSD for it. I used UEFI with GPT partitions.

It's a fresh install with ZFS. I didn't enable any services at startup other than cleanup of /tmp directory. I didn't update or upgrade anything yet.

Any help is appreciated.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,563
Messages: 37,878

Is it connected to the network if you boot it? It might be waiting for a DHCP response on the (wired) interface before it continues to boot. If it's not connected it will take a while for this to time-out.
 
OP
I

ist

New Member


Messages: 5

Yes, it's connected to network through wlan interface. I don't remember configuring anything for wired interface.

Something strange I noticed during boot are these messages showing up few times. Quite a bit of time is spent on these.
Code:
Root mount waiting for: usbus0
usbd_req_re_enumerate: addr=2, set address failed (USB_ERR_TIMEOUT, ignored)

Other than that, there's 8-10 seconds delay after following command appears:
Code:
wlan0: link state changed to UP

Is there a way to log boot process?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,563
Messages: 37,878

Those USB time-outs don't look good.

Is there a way to log boot process?
You can do a verbose boot, you can enable that on the loader menu. That should provide more information. Also look at dmesg(8) and/or /var/log/messages for anything out of the ordinary.
 

George

Well-Known Member

Reaction score: 192
Messages: 484

I have never tried this. But according to the Syslogd manpage, you can enable timestamps in the dmesg output.

O format
Select the output format of generated log messages. The values
bsd and rfc3164 are used to generate RFC 3164 log messages. The
values syslog and rfc5424 are used to generate RFC 5424 log mes-
sages, having RFC 3339 timestamps with microsecond precision.
The default is to generate RFC 3164 log messages.

This could help finding the one process that slows you down.
 
OP
I

ist

New Member


Messages: 5

The USB thing is definitely out of order. There seems to be a problem with XHCI drivers for USB 3.0. There seems to be a few bugs reported for this issues similar to this. But even with that bug, boot takes too long. Usually stuff on old thinkpads work :(.
 
OP
I

ist

New Member


Messages: 5

SirDice, I think you were right. I freshly installed FreeBSD without configuring network at installation and boot time reduced to 15 seconds. I'll try to manually configure network now.
 

Mjölnir

Daemon

Reaction score: 1,507
Messages: 2,114

Lessen the USB timeout in /boot/loader.conf:
Code:
kern.cam.boot_delay="2000"
and concerning the WLAN interface, change in /etc/rc.conf
Code:
defaultrouter=""
background_dhclient="YES"
ifconfig_wlan0="WPA DHCP"
This might help. background_dhclient is not really needed as it's default.
 
Last edited:

wolffnx

Aspiring Daemon

Reaction score: 226
Messages: 667

and maybe
Code:
defaultroute_delay="1" 
# Time to wait for a default route on a DHCP interface.
 

Mjölnir

Daemon

Reaction score: 1,507
Messages: 2,114

Another delay comes from the UEFI boot process. I could drasically reduce the boot time before the FreeBSD loader comes in by setting the UEFI/BIOS setting:
Code:
Boot Method: UEFI only
CSM: off
 
Top