# Cyclic reboot



## TLoe (Jan 8, 2020)

My system is doing a cyclic reboot..

I tried too boot into single user mode and do zfs mount -a and cat /var/log/messages.. But it doesn't show the output of the failed boot.. How can I find that log?


----------



## TLoe (Jan 8, 2020)

Can I set something so it will halt instead of just automatically reboot so I can get time to read the output on boot?


----------



## SirDice (Jan 8, 2020)

TLoe said:


> My system is doing a cyclic reboot..
> 
> I tried too boot into single user mode and do zfs mount -a and cat /var/log/messages..


When single user mode works but it crashes when booting normally it's often a kernel module that's causing it. You can get into a situation like this when loading a 12.0 kernel module on 12.1 for example. To rule those out look in your /boot/loader.conf and remove any additional modules you may be loading there. Then see if it can boot normally without them. 



TLoe said:


> How can I find that log?


Have a look in /var/crash/. But you may only have a core dumped there, which is not that interesting and requires quite a bit of technical wizardry to make sense of those. Usually I don't bother with them, I'm not a kernel developer so it's all abracadabra for me anyway.


----------



## TLoe (Jan 8, 2020)

Nothing in /var/crash.. Everything there is older files.

It does print out something when it boots, but then the screen just goes Black and I don't have time to read anything.. Tried to take a picture with my phone just in time, but its too Quick and my camera is crap..

Tried removing some of the stuff in /boot/loader.conf with no luck..

Don't remember if the last pkg update I ran was before or after the prevoius reboot..


----------



## TLoe (Jan 8, 2020)

Bah.. Commented out everything in /boot/loader.conf and now I am stuck at mountroot at bootup..


----------



## TLoe (Jan 8, 2020)

When I try

zfs:zroot/ROOT/default i get invalid filsystem


----------



## SirDice (Jan 8, 2020)

You need to enter `load /boot/kernel/zfs.ko` to load the ZFS kernel module first. Or else it won't know what ZFS is.


----------



## TLoe (Jan 8, 2020)

Okay.. Now the only thing I have in /boot/loader.conf now is the loading of zfs and I am back to the cyclic reboot and not being able to read what it outputs before the reboot..


----------



## TLoe (Jan 8, 2020)

Strange that it doesn't have a timer before reboots like this so its possible to read the output..


----------



## SirDice (Jan 8, 2020)

TLoe said:


> Now the only thing I have in /boot/loader.conf now is the loading of zfs and I am back to the cyclic reboot and not being able to read what it outputs before the reboot..


That's weird. As that would more or less imply it's ZFS that's causing the crashing. Are you using a custom kernel? And speaking of kernels, what version of FreeBSD? Did you do an OS upgrade recently (packages don't count, ZFS is part of the OS)?


----------



## TLoe (Jan 8, 2020)

No its a while since I did a upgrade.. No custume kernel.. I use freebsd-upgrade and pkg..

I am on the latest stable of 12.1

I did run freebsd-upgrade some days ago, but got that there was no updates.. And I have rebooted since then..

I installed wireshark yesterday.. But I deleted it in single user mode now, but still the same..


----------



## SirDice (Jan 8, 2020)

Do you have a `kld_list` in your /etc/rc.conf? Try disabling it if you have. As for the rest of /etc/rc.conf, disable as much as you can, but leave the important things like IP address and sshd(8). Try to get it as basic as possible. If that works you can, one by one, enable things again until it starts crashing. Then you know the last thing you enabled is likely the culprit.


----------



## TLoe (Jan 8, 2020)

Hmm that got me past where it rebooted.. I have drm.ko and i915kms.ko in kld_list.. Without it I cannot start xorg though..


----------



## SirDice (Jan 8, 2020)

TLoe said:


> Hmm that got me past where it rebooted.. I have drm.ko and i915kms.ko in kld_list.. Without it I cannot start xorg though..


Ok, good, that's the issue. The graphics/drm-kmod package is still being built for 12.0. And you now have 12.1. So that's the cause of the crash. 

The solution is to build graphics/drm-fbsd12.0-kmod from ports. That will build it correctly for your kernel.


----------



## TLoe (Jan 8, 2020)

Hmm.. I allready built it when I did the upgrade from 12.0 to 12.1 though.. And thats a long time ago and I have rebooted many times since..


----------



## TLoe (Jan 8, 2020)

I did a deinstall and install again from ports now and it boots into xorg now with kld-list back in rc.conf.. Can pkg have installed its 12.0 version on top of it?


----------



## SirDice (Jan 8, 2020)

TLoe said:


> Can pkg have installed its 12.0 version on top of it?


Yes, that could possibly have happened if there was a new version. A pkg-upgrade(8) would install the new version from the package repositories. 

This problem should go away as soon as 12.0 is really EoL. Which will probably happen at the end of January or beginning of February. Once it's really gone the packages will get built for 12.1.


----------



## TLoe (Jan 8, 2020)

Right. Thank you


----------

