# FreeBSD 13.0 hangs on boot (possibly i915kms issue)



## striker2150 (Apr 28, 2021)

Dear Forum Members

I am using FreeBSD 13.0 on a small DIY NAS. Since a few days the system hangs during boot.

The last printed lines are:


```
/etc/hostid size=0x25
/boot/entrophy size=0x1000
/
```
After printing these lines, the system hangs. However, the HDD LED indicates some HDD activity.

The error occurs if I am booting from an internal SATA HDD (using UFS) or from a FreeBSD 13.0 Bootonly CD.
I can boot from an Nomad BSD 1.4 USB stick without problems (it's a FreeBSD 12.2 system).
The kernel is the usual FreeBSD default kernel, so nothing I compiled by myself.

When I try to mount the system disk /dev/ada0s1a from Nomad BSD, the mount command fails due to filesystem corruption.
After fixing the filesystem with `fsck /dev/ada0s1a`, mounting works as usual.

I did two things prior to the boot hang:

Updated the BIOS of my ASRock J3710-ITX from 1.30 to 1.50.
Tried to configure a link aggregation via lagg (however, I already reverted these changes to rc.conf and loader.conf via tha Nomad BSD)
I have two questions:

What is FreeBSD usually doing at this stage of the boot process?
Are there any possibilities to analyze/debug the boot problem?
Have there been any relevant changes to UFS between FreeBSD 12.2 and FreeBSD 13.0?
Thanks in advance for all recommendations.


----------



## striker2150 (Apr 28, 2021)

I’ve downgraded the BIOS to version 1.30 but the system is still hanging during boot.
https://www.asrock.com/mb/Intel/J3710-ITX/index.us.asp#BIOS

Next, I will try booting from an FreeBSD 12.2 CD image. Let’s see if that makes any difference.


----------



## balanga (Apr 28, 2021)

Just a guess ..... do you have some thing like

*kld_list="i915kms"*

in /etc/rc.conf   ?


----------



## striker2150 (Apr 28, 2021)

I didn’t had such an setting in my rc.conf, yet.

However, your answer brought an finding:

I booted from my Normd BSD stick and fixed the filesystem using fsck
Rebooted the system and disconnected the DVI plug while the system was shutting down
Pinged the FreeBSD host from another PC. And see, the system booted correctly.
So, your guess with the integrated graphics card was correct.

I’ve logged in via ssh and installed the drm-kmod package
Created a file /etc/rc.conf.d/intel with kld_list=“i915kms”
Plugged in the DVI connector and rebooted the system
Boot failed again
Rebooted into Nomad BSD and fsck‘d the disk
Maybe, I should note that I don’t run X.Org on my FreeBSD box but normal text terminal sessions. Usually, it runs without monitor and keyboard. So, no wonder that the system first was running without problems after the upgrade from FreeBSD 12.2 to 13.0.

However, a missing Intel GPU driver should not lead to file system damage. Looks like a bug in FreeBSD 13.0. What do you think?


----------



## Phishfry (Apr 28, 2021)

striker2150 said:


> Looks like a bug in FreeBSD 13.0. What do you think?


No. I bet you shut the system down (no display evident) and the filesystem needed cleaning up.

So the drm driver is a red herring if you are using only command prompt. It is not needed.

There are some things you can try. The default console driver is vt(4). The old console driver was sc(4).
Sometimes there are troubles.You can try booting up with sc.
Can you see the loader prompt (beastie graphic) at bootup?


----------



## balanga (Apr 28, 2021)

striker2150 said:


> Created a file /etc/rc.conf.d/intel with kld_list=“i915kms”
> 
> However, a missing Intel GPU driver should not lead to file system damage. Looks like a bug in FreeBSD 13.0. What do you think?


Why did you do this?

kld_list="i915kms" should be in /etc/rc.conf

When I upgraded to 13.0-RELEASE on an i386 system I got a blank screen just at the point when video changes, when the system says 'Loading kernel modules:' I did not think of ssh-ing into the system at the time, but will do so if it happens again.


----------



## striker2150 (Apr 28, 2021)

This wiki entry describes using /etc/rc.conf or /etc/rc.conf.d/intel for the kld_list entry:
https://wiki.freebsd.org/Graphics

See "Example Configuration For Intel system", bullet point number two:


> Take note of the post-install package message as it contains important information - specifically add this to your /etc/rc.conf or /etc/rc.conf.d/intel file:
> kld_list="/boot/modules/i915kms.ko"



From my understanding, both files will be evaluated during the boot sequence.
So, it should not matter which file one uses as long as kld_list is just defined in one of both files.

SSH-ing is my usual way to manage my system as there is usually no keyboard and monitor connected.
Therefore, I was simply not affected by this problem until I made an error while changing the network configuration.
I had to log in locally as the network connection was broken.
At this point, it was the first time I connected an monitor after the upgrade to FreeBSD 13.0.

I also found, that the i915 driver caused freezes on Linux:
https://bbs.archlinux.org/viewtopic.php?id=262283
https://askubuntu.com/questions/1288395/system-is-unusable-after-upgrade-to-20-10-i915-gpu-hang

As far as I know, the FreeBSD driver is derived from the Linux driver.


----------



## balanga (Apr 29, 2021)

Just remembered ... you may need to install drm-fbsd13-kmod


----------



## striker2150 (Apr 29, 2021)

balanga 
drm-fbsd13-kmod is already installed. I also checked that /boot/modules/i915kms.ko exists.

Phishfry 
I can see the boot menu with the FreeBSD logo. I can also see the loading of kernel modules which comes after the boot menu. The last printed lines are the lines I posted at the beginning of this post. They appear after the kernel modules have been loaded.


----------



## Phishfry (Apr 29, 2021)

I think you are being led astray. REPEAT command prompt use does not need i915drm.
Remove it. Then test sc.

A quick check will tell if the old console driver works.

From the Beastie logo go to Loader Prompt (should be choice #3).
From there type this:

`set kern.vty=sc <Enter>
boot <Enter>`

See what happens....


----------



## balanga (Jun 3, 2021)

I originally posted about such a problem here - Thread 79838 but that thread has been locked because of some abuse which broke out.

I have found this hang only occurs on FreeBSD 13.0-RELEASE i386, but on all machines I've tried it.

I don't know if there is a PR for it.


----------

