Booting with missing /usr/local

Dominic Mitchell dom at
Wed Sep 10 08:04:27 BST 2003

On Wed, Sep 10, 2003 at 08:02:04AM +0100, Henrik Morsing wrote:
> I moved /usr/local to a seperate device but forgot to mount it on start
> up. Now I can't login because it can't find /usr/local/bin/bash (I
> shouldn't really use this shell for root, should I).
> What can I do now?

Boot in single user mode and set root's shell to /bin/csh.

If you hit space when the loader is counting down from 10 whilst it's
booting, then type in "boot -s" at the prompt.  It should ask you which
shell you want to use when the kernel has finished loading.  Either that
or it'll chuck you into /bin/sh, I forget which.

The first thing you'll have to do in single user mode is mount the disks
read-write.  Type in "mount -u /" which should do the trick.

Finally, type in "chsh root" and change the shell to something sensible
like /bin/csh or /bin/sh.

FWIW, you probably shouldn't be logging in to the root account much
anyway.  Investigate things like sudo from the ports collection.

EVen when you do need to log in as root, just type in "exec bash" at the
beginning of the session.  You're much less likely to screw up that way.


More information about the Ukfreebsd mailing list