Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Jun 1998 12:12:31 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Marco Shaw <marco@nbnet.nb.ca>, freebsd-questions@FreeBSD.ORG
Subject:   Re: HELP! no shell
Message-ID:  <19980602121231.C22406@freebie.lemis.com>
In-Reply-To: <000701bd8db8$a3243580$0a22a10a@ipo10161034010.nbtel.net>; from Marco Shaw on Mon, Jun 01, 1998 at 08:54:38PM -0300
References:  <000701bd8db8$a3243580$0a22a10a@ipo10161034010.nbtel.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon,  1 June 1998 at 20:54:38 -0300, Marco Shaw wrote:
> I just installed my system today.  I prefer the BASH shell, so I immediately
> changed my shell (root) to BASH.  I presumed that it was in /bin/bash and
> already installed, BUT it wasn't.  Now I can't login as root, I just get
> kicked back to the login prompt, and I can't 'su' to root because the groups
> aren't setup right!

You shouldn't use bash in single-user mode, since it's dynamically
linked and needs the libraries in /usr/lib.  Use sh instead, and put
this in your .profile:

if [ -x /usr/local/bin/bash ]; then
  exec /usr/local/bin/bash
fi

> How can I get in without reinstalling?  My friend suggested I boot a kernel
> from the floppy, but how can I get one?  I only have the boot floppy and no
> 'emergency floppy'.

You should be able to reboot in single user mode and fix this.
Compare the instructions on page 157 of "The Complete FreeBSD", second
edition (http://www.cdrom.com/titles/os/bsdbook2.htm):

Single user mode
________________

Sometimes  it's  inconvenient  that  multiple users can access the system.  For
example, if you're repartitioning a disk, you don't want other  people  walking
all  over  the disk while you're doing so.  Even if you're the only user on the
system, daemons may be doing things in the background.  In order to avoid  this
problem,  you  can  stop  the boot process before most of the daemons have been
started and enter single user mode.  To do this, specify the -s  flag  at  boot
time:

Boot: -s

As  soon  as  the device probes have been completed, the system startup will be
interrupted, and you will be prompted for a  shell.   Always  choose  sh:  some
other  shells,  notably  bash,  get confused in single user mode. Only the root
file system will be accessible, and it will be mounted read-only.   The  reason
for  this  is that the file system may be damaged and require repair before you
can write to it.  If you do need to write to the root file system,  you  should
first  check  the consistency of the file system with fsck (see the man page on
page 715).  For example,

npx0 on motherboard
npx0: INT 16 interface                  end of the probes (high intensity display)
Enter pathname of shell or RETURN for sh:    hit RETURN
erase ^H, kill ^U, intr ^C
# fsck -y /dev/rwd0a                         check the integrity of the root file system
** /dev/rwd0a
** Last Mounted on /
** Root file system
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
1064 files, 8190 used, 6913 free (61 frags, 1713 blocks, 0.4% fragmentation)
# mount -u /                            remount root file system read/write
# mount /usr                            mount any other file systems you need

To leave single user mode and enter multi user mode, just enter CTRL-D:

# umount /usr
# ^D
Skipping file system checks...
(the rest of the boot sequence)

Greg
--
See complete headers for address and phone numbers
finger grog@lemis.com for PGP public key

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980602121231.C22406>