From owner-freebsd-questions@FreeBSD.ORG Fri Feb 13 01:23:08 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3879A1065677 for ; Fri, 13 Feb 2009 01:23:08 +0000 (UTC) (envelope-from andrew@qemg.org) Received: from mailserv.mta.ca (mailserv.mta.ca [138.73.1.1]) by mx1.freebsd.org (Postfix) with ESMTP id 0981D8FC17 for ; Fri, 13 Feb 2009 01:23:07 +0000 (UTC) (envelope-from andrew@qemg.org) Received: from [138.73.29.51] (helo=qemg.org) by mailserv.mta.ca with esmtp (Exim 4.61) (envelope-from ) id 1LXmlj-0005PI-VP; Thu, 12 Feb 2009 21:23:04 -0400 Date: Thu, 12 Feb 2009 21:24:25 -0400 (AST) From: "A. Wright" To: Tim Judd In-Reply-To: <4994C74C.3060906@gmail.com> Message-ID: References: <4994B999.1090307@networktest.com> <20090213004128.GA79335@gizmo.acns.msu.edu> <4994C29E.3020506@networktest.com> <4994C74C.3060906@gmail.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Jerry McAllister , David Newman , freebsd-questions@freebsd.org Subject: Re: recovering from a power outage X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 01:23:08 -0000 [ deletia introducing discussion of fsck ] On Thu, 12 Feb 2009, Tim Judd wrote: > It's part of the bootup scripts now. It runs in the background 60 seconds > after the login prompt shows up (not exactly, but close to 60 secs) > > it's the background_fsck option that defaults to YES in /etc/rc startup. > only if there's major problems will it bail out, screaming for help. it'll > drop you into a shell telling you that the filesystems need repair. If you are paranoid (like I am) and want to watch everything happen, then it is nice that fsck will read /etc/fstab (if still present) and correlate filesystem names with devices, so you can just follow a sequence like this: (boot single user) fsck / fsck /usr fsck /var ...etc Once you have run fsck on /, you can mount it using mount -u -o rw / so that you can then run ed (which is in /bin). I am assuming that the reason you cannot use ed to look at a file until this point is because it wants to write the temporary buffer somewhere, even if there are no changes, and if / is readonly and nothing else is mounted, then /tmp is unavailable for this purpose. Can anyone corroborate that? If so, does anyone know when ed started wanting to make a temp file even before any edits are made? I am sure that ed has gotten me out of similar jams in the past, when I wanted to see part of a file in an unchecked root fs, and cat wouldn't fit the bill because the file was too long (and more and friends are far away on /usr, and therefore not available if still patching up the root). Anyone? Andrew.