Solved Unable to boot

I am in a situation where I have upgraded to 15.0-RELEASE and forgotten to run freebsd-update install twice.

I'm in situation where I can't do anything when booting because I get message about libsys.so.7 not found.

I tried single user mode but ended up with the same error.

Is there anything I can do to recover from within this installation?

I can always boot from an alternate source and copy the required file from a working system, but is there any other way?
 
I am in a situation where I have upgraded to 15.0-RELEASE and forgotten to run freebsd-update install twice.
So you only did it once? I'm assuming it was a major version upgrade? From 13 or 14 to 15.0? Then you should be doing it THREE times actually, the third and final install stage will remove all the libraries and files from the previous version. Or did you only run freebsd-update -r 15.0-RELEASE upgrade?

I'm in situation where I can't do anything when booting because I get message about libsys.so.7 not found.
You shouldn't be in this situation if you only upgraded the kernel (ran freebsd-update install only once).

I tried single user mode but ended up with the same error.
When exactly? Trying to run /bin/sh as your shell?

I can always boot from an alternate source and copy the required file from a working system, but is there any other way?
It's probably fixable, but I'm not sure where you left off and in what state your system currently is.
 
So you only did it once? I'm assuming it was a major version upgrade? From 13 or 14 to 15.0? Then you should be doing it THREE times actually, the third and final install stage will remove all the libraries and files from the previous version. Or did you only run freebsd-update -r 15.0-RELEASE upgrade?


You shouldn't be in this situation if you only upgraded the kernel (ran freebsd-update install only once).


When exactly? Trying to run /bin/sh as your shell?


It's probably fixable, but I'm not sure where you left off and in what state your system currently is.
It was an upgrade to 15.0 and I now realise I did something wrong, but after rebooting I cannot boot. I get stuck at libsys.so.7 not found, with the 'helpful' message:]

Enter full pathname of shell or RETURN for /bin/sh:

Whatever I type shows the same message.

Maybe there is some secret shell I can run which doesn't use this library....
 
It was an upgrade to 15.0 and I now realise I did something wrong
Yes, you probably did something wrong. But you didn't answer the question, how many times did you run freebsd-update install? None? Once? Twice? Three?

Maybe there is some secret shell I can run which doesn't use this library....
Try /rescue/sh instead of /bin/sh.
 
I think that's the issue you get if you didn't upgrade the previous version of FreeBSD first.

So you needed to upgrade FreeBSD 14.x to the latest version (to get the version of freebsd-update that would safely upgrade you to 15.0).

So not related to the 15.0 upgrade itself, but what you missed doing beforehand.


Upgrading Using "FreeBSD Update"




The freebsd-update(8) utility supports binary upgrades of amd64 and arm64 systems running earlier FreeBSD releases. Systems running 14.3-RELEASE can upgrade as follows:




# freebsd-update fetch
# freebsd-update install




Important


This step is essential, as upgrading to 15.0-RELEASE without applying the FreeBSD-EN-25:18.freebsd-update errata update will result in an inoperative system!




Now the freebsd-update(8) utility can fetch bits belonging to 15.0-RELEASE. During this process freebsd-update(8) will ask for help in merging configuration files.
 
There's some discussion here (there's a few similar posts) and one links to a possible workaround (I've not tried it myself, so not saying it is good or wise):

 
There's some discussion here (there's a few similar posts) and one links to a possible workaround (I've not tried it myself, so not saying it is good or wise):

I wish I had read that yesterday so that I could have tried the suggested solution just to see if it worked for me.

I remember the problem referring to libc.so.7 but don't recall if it mentioned ld-elf,so.1.
ld-elf.so.1: Shared object "libsys.so.7" not found, required by "libc.so.7"

I could not find any command that worked. I was wondering if there is any way to find which commands do not need this lib, although having just read through the link, I note, '/rescue is a directory where statically-linked rescue binaries live, which don’t suffer from shared-library misery.' which is an important point to note for future reference.

I fixed the problem by booting from an alternate source and copying the file, so I think it's important for people to have alternate boot metthods,
 
balanga
Hi
In these situations, two things have sometimes "saved" me:
UFS and
rsnapshot

But the solution to almost everything is my switch to ZFS
The BEs!!
bectl activate
...
A boot media in case the disk is no boot !!

One (or two) external USB drives for backups, configuration files, and operator data
 
balanga
Hi
In these situations, two things have sometimes "saved" me:
UFS and
rsnapshot

But the solution to almost everything is my switch to ZFS
The BEs!!
bectl activate
...
A boot media in case the disk is no boot !!

One (or two) external USB drives for backups, configuration files, and operator data
I always have a few FreeBSD installations on my Ventoy disks, as well a as a bootable Iso.

Being able to boot mfsBSD via PXE is also handy.
 
I always wondered what that directory was for but never asked because I thought I ought to know.
Another interesting fact about /rescue, everything is one executable. Almost all files are hardlinks to one and the same file. Just have a look with ls -li /rescue, the first number is the inode, almost every file is linked to the same inode, in other words the exact same file.
 
I tried to update from 11.4 and that was a version two too far away from the fix. Not really enough information here for an actual fix for this so here's what I did:

Put in /rescue/sh as the shell when booting

Remount R/W
/rescue/mount -u -o rw /

Bring up the network
/rescue/ifconfig en0 inet [your network config]
/rescue/route add default [your default gw]


Get the file you need from somewhere else over HTTP (not HTTPS) using netcat
Replace example.com with the hostname and 0.0.0.0 with the IP address (don't use DNS lookups)

/rescue/echo -n $'GET /libsys.so.7 HTTP/1.1\r\nHost: example.com\r\nUser-Agent: FreeBSDNetcatRescue/1.0\r\n\r\n' | /rescue/nc 0.0.0.0 80 > /lib/libsys.so.7

Delete the crap the HTTP protocol puts in by repeatedly hitting "dd" until the last ^M disappears (there's probably a better way but whatever, this worked)
/rescue/vi /lib/libsys.so.7

And we're done with rescue stuff. Try just typing ls to see if it picked it up.

Reboot into single user, remount R/W again (don't have to prefix everything with /rescue anymore), then run freebsd-update install
 
I only need to mount 192.168.1.1:/ /net and have full access to my network so can copy over the required file.
 
Back
Top