# Frozen black screen after freebsd-update



## sudosu (Nov 10, 2022)

I managed to successfully install FreeBSD 13. I was then experimenting with Gnome, KDE and xfce only to experience Firefox failed to launch because of missing libc.so.7. One simple solution I found on the Internet was to upgrade FreeBSD with executing freebsd-update fetch. I ran this update command and it stuck for minutes. I stopped the process with intention to retry it, but boot was already failed. It is just a frozen black screen, I can't access the terminal.

I am on the brink of depression. Please help. SOS. What should I do to get FreeBSD back? Or rollback procedure may helps? Thanks.


----------



## sudosu (Nov 10, 2022)

fyi I booted freebsd via grub configured in ubuntu, so I can't access beastie menu where I used to choose single user mode. 
1. how to recover beastie menu then?
2. another option I would try is to use memstick to access broken freebsd, is it possible? if so, how?


----------



## jmos (Nov 10, 2022)

sudosu said:


> because of missing libc.so.7


However you did that (that file even can't be deleted without modifying its permissions)…

Take a boot/install image of FreeBSD, and boot it. Select the Live CD. Mount your harddisk, and copy /lib/libc.so.7 from the live system to your drive. Afterwards finish the upgrade to 13.1 as the handbook (!) describes.


----------



## sudosu (Nov 10, 2022)

jmos said:


> However you did that (that file even can't be deleted without modifying its permissions)…
> 
> Take a boot/install image of FreeBSD, and boot it. Select the Live CD. Mount your harddisk, and copy /lib/libc.so.7 from the live system to your drive. Afterwards finish the upgrade to 13.1 as the handbook (!) describes.


yes sir thanks ... I'll try this and revert


----------



## SirDice (Nov 10, 2022)

sudosu said:


> I managed to successfully install FreeBSD 13. I was then experimenting with Gnome, KDE and xfce only to experience Firefox failed to launch because of missing libc.so.7.


Can't happen if the system was originally 13.x and the packages you installed were also for 13. So this is probably a botched or half finished major version upgrade (from 12.x to 13.x for example).



sudosu said:


> One simple solution I found on the Internet was to upgrade FreeBSD with executing freebsd-update fetch.


This doesn't do an _upgrade_, this is an _update_, i.e. 13.1-RELEASE to 13.1-RELEASE-p2. Also, this only _downloads_ those patches and doesn't install or change anything yet on the system.



sudosu said:


> I ran this update command and it stuck for minutes.


It's not 'stuck'. It's showing you some information and waiting for you to exit less(1).


----------



## sudosu (Nov 10, 2022)

SirDice said:


> Can't happen if the system was originally 13.x and the packages you installed were also for 13. So this is probably a botched or half finished major version upgrade (from 12.x to 13.x for example).
> 
> 
> This doesn't do an _upgrade_, this is an _update_, i.e. 13.1-RELEASE to 13.1-RELEASE-p2. Also, this only _downloads_ those patches and doesn't install or change anything yet on the system.
> ...


thanks for your explanation

I did some experimental commands from random intenet suggestions and it's getting worse now. I can't boot to all my OSes (Ubuntu, Windows, and FreeBSD).

I booted using Live CD and after mount devs, I ran fsck -y nvd0p4 to no avail.
With memstick still stick in, I got 'disk not found' response. Without memstick, it went to a black screen.
I then tried gpart set -a active diskid/DISK-215133754BC2 and it was the guillotine. I can't boot my laptop at all.

What should I try next? I attach the images I took during my failed experiments. Appreciate your helps.


----------



## sudosu (Nov 10, 2022)

jmos said:


> However you did that (that file even can't be deleted without modifying its permissions)…
> 
> Take a boot/install image of FreeBSD, and boot it. Select the Live CD. Mount your harddisk, and copy /lib/libc.so.7 from the live system to your drive. Afterwards finish the upgrade to 13.1 as the handbook (!) describes.


I just realized missing libc.so.7 didn't fail the boot since the beginning. It did fail Firefox to launch.
The priority is to boot first then copying / updating will be easier I guess. The halted freebsd-update seems to break the boot records/procedures.

How is then to resume booting FreeBSD?


----------



## SirDice (Nov 10, 2022)

sudosu said:


> The halted freebsd-update seems to break the boot records/procedures.


It doesn't. Simply because the freebsd-update(8) process (updates, or upgrades) won't touch any of it, ever. 



sudosu said:


> fyi I booted freebsd via grub configured in ubuntu


Fix booting Grub first, forget about FreeBSD for a minute, you're too focused on blaming FreeBSD for the system not booting. That's not where your boot issues are.


----------



## ralphbsz (Nov 10, 2022)

sudosu said:


> set -a active diskid/DISK-215133754BC2


How do you know which disk that is? I think your problems are more fundamental. You need to understand basics of FreeBSD updates, packages versus base, and boot process (including the interaction of grub with other boot systems). Knowing how to identify disks when you have multiple (at least the mem stick and the NVMe) is part of that.


----------



## sudosu (Nov 10, 2022)

SirDice said:


> Fix booting Grub first, forget about FreeBSD for a minute, you're too focused on blaming FreeBSD for the system not booting. That's not where your boot issues are.


What should I say then? System booting failed right after freebsd-update. Grub still works fine at that time, it allows me to boot 2 other OSes. Only after I issued gpart set active, I can't no longer see Grub. 

I am new to FreeBSD so what procedures should I follow to recover? May be FreeBSD have kind of undo commands I can try? Thanks in advance.


----------



## sudosu (Nov 10, 2022)

ralphbsz said:


> How do you know which disk that is? I think your problems are more fundamental. You need to understand basics of FreeBSD updates, packages versus base, and boot process (including the interaction of grub with other boot systems). Knowing how to identify disks when you have multiple (at least the mem stick and the NVMe) is part of that.


Sounds scary  Hoping the problem is not too fundamental tho so that I can recover it without reinstall from clean slate.
I know it is the disk from issuing gpart show.


----------



## SirDice (Nov 10, 2022)

Go in your BIOS/UEFI. Make sure you're UEFI booting, disable CSM boot. Select the proper boot 'disk' in the boot order menu.


----------



## ralphbsz (Nov 10, 2022)

sudosu said:


> I know it is the disk from issuing gpart show.


Good, at least you didn't destroy your mem stick in the process.


----------



## sudosu (Nov 11, 2022)

I made sure EUFI booting, no CSM boot. NVMe0 set at top priority boot order. It doesn't work.
It kept loading on boot menu (attached) every time I reboot.

I have no idea what to try next. 
Since the failing become worst after gpart set active, I guess it's worth to try undo the command. I don't know what commands to issue then.


----------



## sudosu (Nov 11, 2022)

well, I'll try another route to recover Grub instead. let's see if this works.


----------



## jmos (Nov 11, 2022)

sudosu said:


> System booting failed right after freebsd-update.


But: You have *not* updated anything - `freebsd-update fetch` does what that command says: It just downloads; There was no change at any file of a running system, and it doesn't change anything related to a boot process. It just "fetches". (To change something there is a second command afterwards needed.)

Both things are not related: Your problems are elsewhere, and are not related to the "unfinished update". (But without your missing libc I doubt you will run any command on FreeBSD, even not a login shell. It is weird that that fundamental file could be missed, as it is undeletable by default; You must have messed some things up *before* you started to fetching update files.)

But as SirDice said: Fix your Grub / boot environment first.


----------



## sudosu (Nov 11, 2022)

jmos said:


> But: You have *not* updated anything - `freebsd-update fetch` does what that command says: It just downloads; There was no change at any file of a running system, and it doesn't change anything related to a boot process. It just "fetches". (To change something there is a second command afterwards needed.)
> 
> Both things are not related: Your problems are elsewhere, and are not related to the "unfinished update". (But without your missing libc I doubt you will run any command on FreeBSD, even not a login shell. It is weird that that fundamental file could be missed, as it is undeletable by default; You must have messed some things up *before* you started to fetching update files.)
> 
> But as SirDice said: Fix your Grub / boot environment first.


Thanks. You are right though.
Without missing libc, I will still be coding happily in Linux and slowly reading Absolute FreeBSD from page 1.
This is the brute force of learning FreeBSD.

Probably libc is missing after I ran pkg delete gnome and all dependent applications manually. (I remember some icons were greyed right after). Missing libc prevent me launch Firefox in KDE and xfce. Booting FreeBSD is still fine without libc. I can juggle DE between KDE and xfce.

I understand that fetch wont change anything, but fact is that after fetch process halt, I cant no longer boot FreeBSD while still able to boot Ubuntu and Windows. (I am not blaming FreeBSD, I am learning FreeBSD and cursing the mess I created). Grub got no problem at this point in time.

Grub only started to fail when I ran gpart set active to GPT disk. Grub dissapeared and I don't know how to fix this.
I wanted to undo set active but not sure which commands to type in. Maybe damage has been done and irreversible.
I am now trying to recover Grub using Ubuntu Live CD.


----------



## SirDice (Nov 11, 2022)

sudosu said:


> I made sure EUFI booting, no CSM boot. NVMe0 set at top priority boot order. It doesn't work.
> It kept loading on boot menu (attached) every time I reboot.


In the BIOS boot order, select "Ubuntu", not NVMe0. 



sudosu said:


> Probably libc is missing after I ran pkg delete gnome and all dependent applications manually.


It won't. libc is  part of the base OS, packages aren't going to touch it.


----------



## sudosu (Nov 12, 2022)

Well, fixing Grub and FreeBSD boot record is found equally difficult. Too bad I can't get correct procedures I can try to get this back alive.
Been trying all random stuffs on the Internet to no avail. Time just doesn't permit longer tinkering.

I just get all this solved with reinstallation Ubuntu and FreeBSD from clean slate. Easier, no fuzzy things.
Maybe next time when I feel masochistic, I will try the harder route.


----------

