Welcome to Chucktips Hardware HELP WITH DEAD OS Installing FreeBSD Miscellaneous
 add article

HOWT0: Go from single-user to multi-user
Miscellaneous Posted by Jason on Sunday May 12, @10:52AM
from the dept.
As many of you may already know, UNIX is separated into two main camps. The BSD camp and the system V camp. System V Unix OS's have many run levels which they can run in and each level starts up different services. On the other hand, BSD(FreeBSD included) has only two: single-user and multi-user mode. Also, you can switch between these two modes without a reboot. Here's how...

For this to work, you have to start FreeBSD in single-user mode, after that you can switch to multi-user mode and back to singe-user mode without rebooting.

[Boot in single user mode]

As the operating system is starting, it will display the following message:

Hit [Enter] to boot immediately, or any other key for command prompt.

Booting [kernel] in 10 seconds...

You should now press the space bar, and you will see the following message:

Type '?' for a list of commands, or 'help' for more detailed help.


Now type boot -s and press the enter key to start FreeBSD in single user mode. After the system boots, you should see the statement:

Enter full pathname of shell or RETURN for /bin/sh:

Press the enter key and you will have a # prompt.

[Mount the filesystems]

Next, you will have to mount your filesystems manually. At the command prompt, issue the mount command. This command will mount all the filesystems listed in your /etc/fstab file. You may also wish to enable your swap.

# mount -t ufs -a
# swapon -a

[Switch to multi-user mode]

At the command prompt, issue the exit command. This command will run your normal startup scripts and start FreeBSD in multi-user mode.

# exit

[Switch back to single-user mode]

At the command prompt, issue the shutdown now command. This will not shutdown the computer, but instead will drop you back to single-user mode.

# shutdown now

[Shutting down]

To shutdown the OS in either single-user or multi-user mode, issue the halt command:

# halt

To learn more about the commands listed in this post please refer to the man pages.

man mount
man swapon
man shutdown
man halt

<  |  >


Related Links
  • Articles on Miscellaneous
  • Also by Jason
  • Contact author

    Lilliput Mini USB Computer Monitor

    If you have ever wanted to learn about Cisco Routers, check out my new book "Cisco Routers for the Small Business" - it's Cisco CLI for the Regular Guy!

  • Sponsors

    The Fine Print: The following comments are owned by whoever posted them.
    ( Add a Reply )

    Re: HOWT0: Go from single-user to multi-user
    by ATorres on Friday April 18, @11:36AM
    Good day, Please excuse my ignorance. I'm a DOS/Windows guy. How can I setup BSD to execute an application program after boot (just like Autoexec.bat in DOS) automatically? In the same line, is there a way to setup BSD so that it doesn't ask me for a user name to login? Again, imitating my DOS computer, I'd like to turn on the computer and the system would boot and run an application. Thanks much.
    [ Add a Reply to this ]
    • No user and password prompt
      by Doug on Wednesday July 13, @10:43AM
      You could install a "display manager" like xdm or kdm or gdm if you want to get to a pretty login screen. I believe that kdm will do auto-login if you set it up properly.
      [ Reply to this ]
    Re: HOWT0: Go from single-user to multi-user
    by Gary on Saturday June 14, @03:31PM
    add a line to /etc/rc.local or a script to /usr/local/etc/rc.d
    [ Add a Reply to this ]
    The Fine Print: The following comments are owned by whoever posted them.
    ( Article Reply )

    "You never know how many friends you have until you own a Condo on the beach." -- Jason's Postulate

    Powered by Zope  Powered by Apache  Squishdot Powered
    All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest ©2001 Jason Neumann.
    [ main | post article | search ]