Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Oct 2004 22:01:40 +0200
From:      Henrik W Lund <henrik.w.lund@broadpark.no>
To:        David Kurtz <davidkurtz@mac.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to recover from setting boot_single=""?
Message-ID:  <41702CA4.8020203@broadpark.no>
In-Reply-To: <r02010400-1035-C331CEF41ED311D98B59003065C7D828@[10.1.218.146]>
References:  <r02010400-1035-C331CEF41ED311D98B59003065C7D828@[10.1.218.146]>

next in thread | previous in thread | raw e-mail | index | archive | help
David Kurtz wrote:
> Short story: I placed a single line,
> 
> boot_single=""
> 
> into the previously empty file /boot/loader.conf and now my machine boots with 
 > an extremely limited read-only volume.
> 
> How do I get my old boot behavior back?
> 
> 
> Long story: I was muddling through updating the kernel and world for the first 
 > time, going from FreeBSD 5.1 => 5.2. Following instructions in 
/usr/src/UPDATING
 > I made backups, made buildworld, etc. until it got to the point where 
it says
 > reboot in single user.
> 
> Never having done that, I tried first by "reboot"ing, but for some reason my USB 
 > keyboard doesn't get power until further on in the boot cycle, so I
 > couldn't just "press 4." I looked through the docs and found instruction
 > saying that I should
 > set boot_single. I'm guessing I should have set it to something other
 > than "", which is just copied from /boot/defaults/loader.conf.
> 
> So, a couple more questions: what is this limited read-only mode exactly? 
 > Where are my files (e.g. /usr is empty)? What should I have done? Is it
 > possible to back out?
> 
> It's a personal sandbox, and everything I need is already safely backed 
 > up; if I need to just blast the whole system with a CD install, I can do
 > that. But I am curious to know if it's possible to u-turn in this 
cul-de-sac.
 > Apparently, I know just enough to get myself into trouble, but not
 > enough to get out.

Greetings!

I took the liberty of reformatting your email. Try and set up your 
mailer to wrap the lines at around 72 characters, it makes your email 
much easier to read for those on character terminals. :-)

Now, on to your question. Let me see if I get this straight: you have 
booted into a read-only environment? Did you get a cryptic prompt along 
the lines of "Enter path to shell (default /bin/sh):"?

Sounds like single user mode all right! ;-)

What you need to do is to first run

# fsck -y

to check that all the filesystems (hard drive partitions) are consistent 
(they were unmounted properly).

Next, issue the following:

# mount -u / (this mounts the root filesystem read/write again!)
# mount -a (this mounts the rest of the filesystems in /etc/fstab. 
You'll get your /usr back, for one. :-D )

For some voodoo with the system clock, run

# adjkerntz -i

This is what you should do every time you're boot into single-user in 
order to get anything done (possibly with the exception of mount -a. 
Unless there are files that you need on filesystems other than /, you 
don't need the others. You do for the upgrading procedure, though).

Now for the system-upgrade specific stuff.

# mergemaster -p (this compares files under the old /etc with the files 
under the new /etc and offers you to merge them, discard or what have 
you. Keeping a straight tongue is advised, as missing a critical 
addition of a system user account can be annoying).
# make installkernel (KERNCONF=YOUR_CUSTOM_KERNEL - unless you are 
installing the GENERIC kernel. This should be the same as the one you 
used before rebooting)
# make installworld (this does exactly what you think ;-) )

You might want to remove the line boot_single="" from /boot/loader.conf 
and then reboot. Your system should start up happily. :-D

Hope this helps!

-- 
Henrik W Lund



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