From owner-freebsd-questions@FreeBSD.ORG Mon Feb 23 10:50:26 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A671E16A4CE for ; Mon, 23 Feb 2004 10:50:26 -0800 (PST) Received: from munk.nu (mail.munk.nu [213.152.51.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6480D43D1D for ; Mon, 23 Feb 2004 10:50:26 -0800 (PST) (envelope-from munk@munk.nu) Received: from munk by munk.nu with local (Exim 4.30; FreeBSD) id 1AvL9p-0005ua-Hv; Mon, 23 Feb 2004 18:50:21 +0000 Date: Mon, 23 Feb 2004 18:50:21 +0000 From: Jez Hancock To: Stephen Liu Message-ID: <20040223185021.GB21636@users.munk.nu> Mail-Followup-To: Stephen Liu , freebsd-questions@freebsd.org References: <403A1311.6000703@icare.com.hk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <403A1311.6000703@icare.com.hk> User-Agent: Mutt/1.4.2.1i Sender: Jez Hancock cc: freebsd-questions@freebsd.org Subject: Re: How to start single user mode or safe mode X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2004 18:50:26 -0000 On Mon, Feb 23, 2004 at 10:49:53PM +0800, Stephen Liu wrote: > Accidentally I made a mistake > > # ee /etc/rc.conf > ..... > hostname=localhost > .... > > and could not start the PC > > At booting > ...... > Enter full pathname of shell or RETURN for /bin/sh: > Hit > # ee (could not work) > > I rebooted the PC. At booting, selecting [3] or [4] could not boot to > 'safe mode' nor 'single user mode' Firstly it would help if you could tell us why you were originally dropped to single user mode - ie the messages prior to 'Enter full pathname of shell...'. To boot into single user mode at startup: - hit any key APART FROM ENTER when the system counts down from 10. This will take you to the boot prompt. - type 'boot -s' to boot into single user mode After booting into single user mode, to be able to write any changes /etc to disk you need to change the status of the / partition from read only to read/write mode. To do this execute: /sbin/mount -u / Note you should use the full path because /sbin may not be in your PATH for one reason or another. Now you can move on to fix any problems with /etc/rc.conf. If you really want to use ee(1) then you'll need to first mount the partition containing /usr/sbin since ee(1) resides there and if the partition containing /usr/sbin isn't mounted you won't be able to use ee(1). If /usr has it's own dedicated partition you'd do: mount /usr generally. Finally you should be able to do: /usr/sbin/ee /etc/rc.conf again using the full path to ee(1). This is one of the reasons I forced myself to learn ed(1)/vi(1) - it's the one editor that's generally available no matter what when you boot a system in single user mode. -- Jez Hancock - System Administrator / PHP Developer http://munk.nu/ http://jez.hancock-family.com/ - Another FreeBSD Diary http://ipfwstats.sf.net/ - ipfw peruser traffic logging