# boot failed from current-13 to release-12.1



## joggx (Jul 31, 2020)

Hi there,

I tried to downgrade current-13 to release-12.1 by building from source (`svnlite co`). Reboot failed after `make -j4 kernel`
The following is console messages. Any help is appreciated.


```
Loading kernel...
/boot/kernel/kernel text=0x1691231 data=0x1d0ae8+0x768d80 syms=[0x8+0x178c38+0x8+0x196a6d]
Loading configured modules...
/etc/hostid size=0x25
/boot/entropy size=0x1000
/boot/kernel/aesni.ko size 0xe1d8 at 0x264a000

Booting [/boot/kernel/kernel]...             
---<<BOOT>>---
Copyright (c) 1992-2019 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 12.1-RELEASE-p7 #0 r363724M: Fri Jul 31 10:47:56 UTC 2020
    root@freebsd-11-3:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)
VT(vga): text 80x25
CPU: Intel(R) Xeon(R) CPU @ 2.30GHz (2299.93-MHz K8-class CPU)

....

da0: 300.000MB/s transfers
da0: Command Queueing enabled
da0: 40960MB (83886080 512 byte sectors)
Trying to mount root from ufs:/dev/gpt/rootfs [rw]...
Setting hostuuid: 8b112461-988e-a170-0897-cb6215a25e0a.
Setting hostid: 0xbfc4d2e4.
pid 46 (dumpon), jid 0, uid 0: exited on signal 12
pid 49 (logger), jid 0, uid 0: exited on signal 12
No suitable dump device was found.
Starting file system checks:
/dev/gpt/rootfs: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/gpt/rootfs: clean, 3964798 free (115086 frags, 481214 blocks, 1.2% fragmentation)
pid 63 (mount), jid 0, uid 0: exited on signal 12 (core dumped)
Bad system call (core dumped)
Mounting root filesystem rw failed, startup aborted
ERROR: ABORTING BOOT (sending SIGTERM to parent)!
2020-07-31T10:55:00.509636+00:00  init 1 - - /bin/sh on /etc/rc terminated abnormally, going to single user mode
Enter full pathname of shell or RETURN for /bin/sh:
```


----------



## SirDice (Jul 31, 2020)

joggx said:


> I tried to downgrade current-13 to release-12.1 by building from source.


-CURRENT is not supported at all. And downgrades have never been supported either. I suggest you do a clean install with 12.1.


----------



## joggx (Jul 31, 2020)

OK. What is buildworld supposed to mean? When you rebuild the 'world' you still have dependency of the old world? Even so it is weird there is not even a rollback measure available.


----------



## SirDice (Jul 31, 2020)

The build process only supports forward upgrades, not backwards. At the moment you're trying to run a 13-CURRENT userland on a 12.1 kernel. That's just not going to work.


----------



## joggx (Jul 31, 2020)

gpb said:


> It is difficult to provide an answer without knowing what you actually did, e.g., commands, output.  In the past I have gone up and down using source and never had a problem.



There is what has been done:
in freebsd-11-4-release-amd64:

`cd /usr/src; rm -rf *; rm -rf .*`
`svnlite checkout https://svn.freebsd.org/base/head /usr/src`
make buildworld and kernel (step 3-10)
handbook/makeworld.html

`svnlite checkout https://svn.freebsd.org/base/releng/12.1 /usr/src`
make buildworld and kernel (step 3-6)


----------



## joggx (Jul 31, 2020)

SirDice said:


> The build process only supports forward upgrades, not backwards. At the moment you're trying to run a 13-CURRENT userland on a 12.1 kernel. That's just not going to work.



I can still revert back the kernel to current to boot. Do you mean upgrade to release is possible when release 13 is out (2021.03)??


----------



## Mjölnir (Jul 31, 2020)

So you did not `make installworld`, too? Then as SirDice wrote, the mount(8) binary is from -CURRENT, the kernel is 12.1-RELEASE.  Plus, beware there might be new options throughtout config files left over from -CURRENT, mergemaster(8) generally assumes up- not downgrade?  Seriously consider to backup your data & switch to ZFS.  It's much more comfortable to do such up & downgrade w/ boot environments (bectl(8) & beadm(8)), than to do it on the very same filesystem. EDIT: either nanobsd(8) or picobsd(8) (or both?) use two partitions to switch on a system upgrade... You can use this technique with two root partitions on a UFS system, as well.


----------



## joggx (Jul 31, 2020)

mjollnir said:


> So you did not `make installworld`, too? Then as SirDice wrote, the mount(8) binary is from -CURRENT, the kernel is 12.1-RELEASE.  Plus, beware there might be new options throughtout config files left over from -CURRENT, mergemaster(8) generally assumes up- not downgrade?  Seriously consider to backup your data & switch to ZFS.  It's much more comfortable to do such up & downgrade w/ boot environments (bectl(8) & beadm(8)), than to do it on the very same filesystem.



The panic occured after `make installkernel`.  `make installworld`  is step 8 and is not reached. The root file system is on zfs. Can I boot into old -current kernel then `make installworld` to complete the install of release 12.1?


----------



## zirias@ (Jul 31, 2020)

joggx said:


> Can I boot into old -current kernel then  make installworld  to complete the install of release 12.1?


_Might_ work. Yes, downgrades are not supported, the handbook instructions are for upgrades. The reason they tell you to install a kernel first and then reboot is that a newer userland ("world") will typically not work with an older kernel. When attempting to downgrade, the only sensible way would be to try it the other way around -- _first_ downgrade world.


----------



## Mjölnir (Jul 31, 2020)

joggx said:


> The panic occured after `make installkernel`.  `make installworld`  is step 8 and is not reached. The root file system is on zfs. Can I boot into old -current kernel then `make installworld` to complete the install of release 12.1?


IMHO that should be possible.  When you have ZFS, please make use out of it's features and create a blank new dataset zroot/ROOT/12.1-REL and use that as $DESTDIR to install onto.  Everything under /ROOT will be treated as an boot env by loader(8) & beadm(8).


----------

