# root can not login after update and reboot



## topclimber (Feb 24, 2010)

I'v got a root login problem caused by freebsd update from 7 to 8 release.

What I have done is following below instruction from official page.

1. I did `# freebsd-update upgrade -r 8.0-RELEASE`
2. `# freebsd-update install`
3. `# shutdown -r now`
4. `# freebsd-update install`
during this step, I did portsnap fetch update for all ports, but not manually rebuild all ports, and then found share libs are broken and many programs can not work properly, like wget, vim ....,then I did a step5 for a reboot
5. `# shutdown -r now`

After this step, the root user can not login due to some broken libs(can not recall exact error message, I can post if you need it later)

Any idea I can fix problem and login as root? I haven't tried signle user mode but thinking the broken libs issue will still exist even for single user mode.


===================Reference=============================
FreeBSD Update

The freebsd-update(8) utility supports binary upgrades of i386 and amd64 systems running earlier FreeBSD releases. Systems running 7.[012]-RELEASE, 8.0-BETA[1234], or 8.0-RC[123] can upgrade as follows:

`# freebsd-update upgrade -r 8.0-RELEASE`

During this process, FreeBSD Update may ask the user to help by merging some configuration files or by confirming that the automatically performed merging was done correctly.

`# freebsd-update install`

The system must be rebooted with the newly installed kernel before continuing.

`# shutdown -r now`

After rebooting, freebsd-update needs to be run again to install the new userland components:

`# freebsd-update install`

At this point, users of systems being upgraded from FreeBSD 8.0-BETA2 or earlier will be prompted by freebsd-update to rebuild all third-party applications (e.g., ports installed from the ports tree) due to updates in system libraries. See:

    *

http://www.daemonology.net/blog/2009-07-11-freebsd-update-to-8.0-beta1.html

for more details. After updating installed third-party applications (and again, only if freebsd-update printed a message indicating that this was necessary), run freebsd-update again so that it can delete the old (no longer used) system libraries:

`# freebsd-update install`

Finally, reboot into 8.0-RELEASE:

`# shutdown -r now`


----------



## aragon (Feb 24, 2010)

You will probably need to try recover in single user mode.  Boot up like that and try use /bin/sh as shell.  If that fails, make note of the problematic library and then try /rescue/sh.  There are a bunch more binaries in /rescue that are statically compiled that should help you fix your broken libs.


----------



## jnbek (Feb 24, 2010)

> During this process, FreeBSD Update may ask the user to help by merging some configuration files or by confirming that the automatically performed merging was done correctly.


During the initial FreeBSD update process some of the configuration files are things like /etc/passwd, /etc/group, etc and the 'merged' versions will wipe out your root password, and any users/groups added before the upgrade. mergemaster was good for this, you have to be careful and watch out for that when the update process is merging files. Single User Mode with /bin/sh or /rescue/sh and then executing [CMD="passwd root"][/CMD] should take care of the root password problem, however, if the update process wiped out existing users and groups, you'll need to recreate them. Note, the home directories should still be intact so you'll want to make sure to use them when re-adding the users.


----------



## SirDice (Feb 24, 2010)

topclimber said:
			
		

> After this step, the root user can not login due to some broken libs(can not recall exact error message, I can post if you need it later)


Let me guess, you changed root's shell to bash?

Boot to single user mode. Then:

```
fsck -y
mount -u /
mount -a -t ufs
swapon -a
```

Now change root's shell back to /bin/tcsh with the `# chsh` command.


----------



## topclimber (Feb 25, 2010)

*Yes it's a bash problem*

Changing bash to s resolved the problem. Thanks all


----------

