How to recover from setting boot_single=""?
Henrik W Lund
henrik.w.lund at broadpark.no
Fri Oct 15 13:05:28 PDT 2004
David Kurtz wrote:
> Short story: I placed a single line,
> 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
> I made backups, made buildworld, etc. until it got to the point where
> 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
> Apparently, I know just enough to get myself into trouble, but not
> enough to get out.
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
More information about the freebsd-questions