How to start single user mode or safe mode
Hi all folks, 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 ENTER # ee (could not work) I rebooted the PC. At booting, selecting [3] or [4] could not boot to 'safe mode' nor 'single user mode' Kindly advise how to boot to 'single user mode' or 'safe mode' TIA B.R. Stephen Liu ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
[FAQ pointer] Re: How to start single user mode or safe mode
Stephen Liu [EMAIL PROTECTED] writes: Hi all folks, 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 ENTER # ee (could not work) I rebooted the PC. At booting, selecting [3] or [4] could not boot to 'safe mode' nor 'single user mode' Kindly advise how to boot to 'single user mode' or 'safe mode' The precise answer depends on what version of FreeBSD you're running, which you failed to mention. You can work it out from the FreeBSD FAQ entry titled I made a mistake in rc.conf, or another startup file, and now I cannot edit it because the filesystem is read-only. What should I do?, which you can read at: http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/admin.html#RCCONF-READONLY ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: How to start single user mode or safe mode
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 ENTER # 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 ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: [FAQ pointer] Re: How to start single user mode or safe mode
- snip - Kindly advise how to boot to 'single user mode' or 'safe mode' The precise answer depends on what version of FreeBSD you're running, which you failed to mention. You can work it out from the FreeBSD FAQ entry titled I made a mistake in rc.conf, or another startup file, and now I cannot edit it because the filesystem is read-only. What should I do?, which you can read at: http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/admin.html#RCCONF-READONLY Hi Lowell, V5.2 === Thanks for your advice. Problem was solved as follow; .. Enter full pathname of shell or RETURN for /bin/sh: ENTER # mount -a -t ufs # ee /etc/rc.conf Now another problem popup. At rebooting . /tmp not clearly dismounted /var not clearly dismounted /usr not clearly dismounted ... ... Starting syslog ... Recovering vi editor session: It hanged here. Kindly advise how to umount /tmp, /usr and /var If I need to run 'fsck' whether starting single user mode will mount / at read only. From there I can run # fsck /dev/ad4s1a (I suppose boot) # fsck /dev/ad4s1b (I suppose swap) # fsck /dev/ad4s1c (I suppose /) Kindly advise how to re-check the device, boot, swap and / TIA B.R. Stephen ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: [FAQ pointer] Re: How to start single user mode or safe mode
On Tue, Feb 24, 2004 at 03:38:35AM +0800, Stephen Liu wrote: This one is fine... # fsck /dev/ad4s1a (I suppose boot) but these two aren't: # fsck /dev/ad4s1b (I suppose swap) # fsck /dev/ad4s1c (I suppose /) You can only run fsck(8) on partitions containing filesystems. The 'b' partition is usually a swap area, which doesn't use any sort of filesystem at all. The 'c' partition usually maps to the whole slice -- that is, it overlaps all of the actual partitions you're using for your file systems. You very rarely need to access the 'c' partition specifically -- commands that affect the whole slice nowadays tend to take ad4s1 or the equivalent as an argument. Your /var and /usr partitions probably live on partitions 'e' and 'f' -- possibly 'g' or 'h' as well if you have any other partitions. disklabel(8) will show you what partitions have been allocated. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK pgp0.pgp Description: PGP signature