Solved Not booting after upgrading to 12.2

My server had version 12 r0 so, I decided to upgrade with freebsd-upgrade. The first part of the installation was successfully but after requested to reboot. I couldn't boot anymore:


20201229_110317.jpg


I don't have any info abou the gpt or zfs. How can I solve this? Don't want to lost any data!
 
My server had version 12 r0 so, I decided to upgrade with freebsd-upgrade. The first part of the installation was successfully but after requested to reboot. I couldn't boot anymore:
...
I don't have any info abou the gpt or zfs. How can I solve this? Don't want to lost any data!
Did you read my thread:


Looks similar. I did not manage to solve this problem. Just replaced the functional HP motherboard with ASUS board. After that it is all good, but the actual problem is still there.
 
I just came across a moment ago, you did find a way to boot it with usb stick 12.2?

My problem is that don't have big knowledge to know how to get into the shell to follow the thread you pointed. Did you boot live image from the memstick?
 
I just came across a moment ago, you did find a way to boot it with usb stick 12.2?

My problem is that don't have big knowledge to know how to get into the shell to follow the thread you pointed. Did you boot live image from the memstick?
I think, in my case, the (HP) motherboard was a kind of tricky. It is stable, can run weeks when booted, and also boots Windows without any problems. But refuses to boot FreeBSD 12.2. With tricks, playing around in BIOS, changing boot order, etc. it booted up, but next time the problem was still there. So, eventually I concluded, that this is some sort of hardware incompatibility and replaced the motherboard. Now the same disks, same system is rock solid. Boots without any problems. Everything looks good. :)

So, my advice here is to take the boot disk out and put it into some other system (different brand). Try if it boots.
 
How did you do to run this:
Bash:
efibootmgr -c -l /mnt/EFI/BOOT/BOOTX64.EFI -L FreeBSD
?

I got "No such file or directory"
 
How did you do to run this:
Bash:
efibootmgr -c -l /mnt/EFI/BOOT/BOOTX64.EFI -L FreeBSD
?

I got "No such file or directory"
There is an image file /boot/boot1.efifat

You can load it to the UEFI partition by: gpart bootcode -p /boot/boot1.efifat -i <your UEFI partition #> <your drive> in my case gpart bootcode -p /boot/boot1.efifat -i 1 ada1

With efibootmgr -v you can see the boot order.
 
Argentum I just tried that with the hope to see different screen but, same result. I have 2 HDD in the cpu so, I did a new install on the other one, fresh, and it boots correctly. So, the hardware is not a problem. Something got broken in the update.

free-and-bsd Sorry can't understand the question...
 
Argentum I just tried that with the hope to see different screen but, same result. I have 2 HDD in the cpu so, I did a new install on the other one, fresh, and it boots correctly. So, the hardware is not a problem. Something got broken in the update.
This is good news. Now you can boot the new system, mount the original filesystem and fix it.

And with new system, see sysctl machdep.bootmethod
 
Argentum I just tried that with the hope to see different screen but, same result. I have 2 HDD in the cpu so, I did a new install on the other one, fresh, and it boots correctly. So, the hardware is not a problem. Something got broken in the update.

free-and-bsd Sorry can't understand the question...
All right, may be a good point to start from. Read about EFI vs BIOS boot modes -- it concerns all operating systems. Your screen shows you're booting in EFI mode. However, it is known to have problems as it is "younger" than "BIOS" mode.

Now your screen says nothing about OS/hardware problems -- it just freezes at EFI boot message. Gives me reason to believe EFI is to blame.
 
My server had version 12 r0 so, I decided to upgrade with freebsd-upgrade. The first part of the installation was successfully but after requested to reboot. I couldn't boot anymore:...
...
I don't have any info abou the gpt or zfs. How can I solve this? Don't want to lost any data!
Don't worry, it won't be lost this way. But if you run a SERVER and hate to lose your DATA, well then you better get to know about GPT or ZFS or whatever stuff your server is using.
Why do I say so? Because, like this case of yours, you may need to boot your machine in a "non-standard" way -- that is, using boot-disks (CD or USB). In the process you will NEED to know your HDD configuration. I'm afraid, there is no way out of it :)
 
Don't worry, it won't be lost this way. But if you run a SERVER and hate to lose your DATA, well then you better get to know about GPT or ZFS or whatever stuff your server is using.
Why do I say so? Because, like this case of yours, you may need to boot your machine in a "non-standard" way -- that is, using boot-disks (CD or USB). In the process you will NEED to know your HDD configuration. I'm afraid, there is no way out of it :)
Ok, how to do that: boot from a standard install FreeBSD-12.2 CD, then instead of installation choose "shell" option. From the shell you use command:
Code:
gpart show
That will show you your disk configuration & partitions.
Talking about ZFS (if it is used by your install), you can check that by this command:
Code:
zpool import
That will show you your ZFS pool -- if it exists. Then you can try to import that pool using zpool import -f $pool_name command. After that you'll see the datasets your have using this command: zfs list.
That may give you a good idea of what your "root device" is, from which the system boots.
 
Don't worry, it won't be lost this way. But if you run a SERVER and hate to lose your DATA, well then you better get to know about GPT or ZFS or whatever stuff your server is using.
Why do I say so? Because, like this case of yours, you may need to boot your machine in a "non-standard" way -- that is, using boot-disks (CD or USB). In the process you will NEED to know your HDD configuration. I'm afraid, there is no way out of it :)
free-and-bsd thanks for the advice, really helpful. I just ran the two commands that you asked me. This is the output:


Code:
#gpart show ada0
40            234441568    ada0    GPT    (112G)
40            409600           1    efi    (200M)
409640        1024           2    freebsd-boot (512K)
410664        984                 - free - (492K)
411648        4194304           3     freebsd-swap(2.0G)
4605952     229834752      4    freebsd-zfs (110G)
234440704   904                 - free -

The ada0 used to be the main disk where everything worked fine.

Code:
#zfs list
NAME                USED    AVAIL.    REFER    MOUNTPOINT
zroot                46.9G    58.7G      88K    /zroot
zroot/ROOT            13.9G    58.7G      88K    none
zroot/ROOT/default    13.9G    58.7G      13.9G    /
zroot/tmp            144K    58.7G      144K    /tmp
zroot/usr            17.7G    58.7G      88K    /usr
zroot/usr/home        15.3G    58.7G      15.3G    /usr/home
zroot/usr/ports        1.69G    58.7G      1.69G    /usr/ports
zroot/usr/src        704M    58.7G      704M    /usr/src
zroot/var             1.79M    58.7G     88K      /var
zroot/var/audit     1.79M    58.7G   88K      /var/audit 
zroot/var/crash     1.79M    58.7G  88K      /var/crash
zroot/var/log         1.79M    58.7G  1.33M  var/log
zroot/var/mail         1.79M    58.7G 116K   var/mail
zroot/var/tmp         1.79M    58.7G 88K    /var/tmp

I could import it but, couldn't mount it correctly, don't know if the import need some parameters or I need new command.
 
free-and-bsd

This very weird, after mount the dataset, I see that /root/ folder has everything but, not my user which is /home/ismatim, and I can't understand why. Why just my personal folder is completed erased?
 
You see, you can always use install CD as a rescue system. Good to know how you can use it, right?

...So, from your gpart show output we see, you have "efi" partition that has number "1" on your disk "ada0". Which means, your system was originally installed to use EFI boot method (see my post above). Which means, in turn, there must be something wrong with the upgraded EFI boot code.
On the other hand, as you were able to boot from the CD, it contains a WORKING boot code. So we can use it to restore your system's boot.

You can now refer to this manual to see how you can install/restore/fix your system's bootloader (which is, most likely, the problem here).
You will actually need two commands. This one : zpool set bootfs=zroot/ROOT/default. If it says it's already set -- good.
Then this one: gpart bootcode -p /boot/boot1.efifat -i 1 ada0-- to make sure your system will use the working boot code from the CD. It should be working since you just booted from it, right?
(No matter in what order you issue these two commands).
Also, see the output of mount command, no arguments. Check where zroot/ROOT/default is mounted (if it is).
You will see something like zroot/ROOT/default on /some/mount/point (zfs, local, noatime, nfsv4acls).
Then you check what is in /boot/loader.conf: cat $mount_point/boot/loader.conf. It must have at least this:
Code:
zfs_enable="YES"
zfs_load="YES"

After this try to reboot from your system (without a CD). If it still doesn't boot, I'll tell you how to boot using the CD boot loader.
 
Otherwise, you can just reboot into your BIOS, turn off UEFI boot and reboot -- it must boot. Because you have a "freebsd-boot" partition as well. That one is used for "legacy" boot method -- which works just fine.
 
free-and-bsd I committed two mistakes:
1. Deleted the efi partition.
2. Overwrote the freebsd-boot with the new installation I made on the other disk.

When was trying to find a workaround :(
 
free-and-bsd I committed two mistakes:
1. Deleted the efi partition.
2. Overwrote the freebsd-boot with the new installation I made on the other disk.

When was trying to find a workaround :(
Deleting efi partition is not a big mistake. Just recreate it in the same place and number and install EFI image by gpart bootcode -p /boot/boot1.efifat -i 1 ada0

That /boot/boot1.efifat is available everywhere - on install USB image, your disk, etc.
 
Note that the efi partition doesn't need to be the first on the disk, it can live anywhere on disk. The installer creates it as the first partition but that's not a requirement for it to work.
 
Besides, your system will boot just fine without any EFI partition. Just set it in BIOS to boot UEFI or BIOS. It will automatically detect that you DON"T have any EFI partitions and boot in "legacy" mode. Though the only 'legacy' thing about it is that it's easier to troubleshoot than EFI. Oh, and of course, WINDOWS will not boot in that mode!!! But since your sever doesn't seem to have any such horror...
 
Back
Top