NomadBSD icon indicating copy to clipboard operation
NomadBSD copied to clipboard

Updating FreeBSD/pkgs leaves me stuck in single user mode

Open a-bateman opened this issue 3 years ago • 6 comments

I updated FreeBSD and pkgs (using FreeBSD-update and pkg update/upgrade), on my installed to disk system, and after doing so the system will only let me login through single user mode. I know there is a new NomadBSD installer available. Is there a way to recover from this using the new installer? Preferably without losing my user data. I haven't been able to find any data on whether installing a new version installs in place or wipes the drive.

a-bateman avatar Mar 16 '21 23:03 a-bateman

Hi @a-bateman,

is there any error message before the single-user mode shell starts?

mrclksr avatar Mar 17 '21 15:03 mrclksr

Sorry for the long response time. Being a mailman is insane these days. No, no error messages before single user mode. I can't tell if updating just messed up a configuration or something. I've checked the configs but don't see anything out of the ordinary from what I can tell.

a-bateman avatar Mar 21 '21 12:03 a-bateman

No problem. Usually, if the system goes into single-user mode without you telling it to do so, there is something wrong (e.g. corrupted filesystem that can't be repaired in background). If you get a login: prompt and you can switch between consoles via Alt+Fn (n = 1, 2, ..., 9) you are in multi-user mode. In this case there probably just dependency/inconsistency problem with some packages related to Xorg that prevents the GUI from starting. This is easy to fix:

Login as root. Then:

# pkg unlock -ay
# pkg upgrade -af
# reboot

mrclksr avatar Mar 21 '21 14:03 mrclksr

I did that. Rebooted and attempted multiuser mode. It dropped me to the shell and gave me this error:

  • [/etc/rc.subr: 2: Syntax error: redirection unexpected (expecting word)]

Haven't dealt with the rc.subr file before but I'm going through it to try to figure out what's wrong with it.

Line 2 is as follows:

  • [<<<<<<< current version]

a-bateman avatar Mar 21 '21 15:03 a-bateman

That looks like you chose to merge your /etc/rc.subr with the new one when running freebsd-update, but you didn't complete it. You left the <<<<<<<<<< marker which introduces the content of the new version. The easiest way to fix that is to boot NomadBSD from a USB pen drive, mount the root partition of your NomadBSD installation, and copy /etc/rc.subr to your HDD installation:

Boot NomadBSD from a pen drive, then:

# mount  /dev/gpt/nbsdrootfs /mnt
# cp /etc/rc.subr /mnt/etc
# umount /mnt
# reboot

mrclksr avatar Mar 21 '21 15:03 mrclksr

That seemed to work. I ended up having to do it in the opposite direction (boot into single user laptop and copy it from pen drive to the running system then reboot.). It seems as though upgrading removed xorg for some reason as it boots me to the command line. Just going to reinstall that and open box and I should be back to normal.

Thank you for all the help.

a-bateman avatar Mar 21 '21 18:03 a-bateman