Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Feb 2009 21:24:25 -0400 (AST)
From:      "A. Wright" <andrew@qemg.org>
To:        Tim Judd <tajudd@gmail.com>
Cc:        Jerry McAllister <jerrymc@msu.edu>, David Newman <dnewman@networktest.com>, freebsd-questions@freebsd.org
Subject:   Re: recovering from a power outage
Message-ID:  <alpine.BSF.2.00.0902122114260.12848@qemg.org>
In-Reply-To: <4994C74C.3060906@gmail.com>
References:  <4994B999.1090307@networktest.com> <20090213004128.GA79335@gizmo.acns.msu.edu> <4994C29E.3020506@networktest.com> <4994C74C.3060906@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

 	 [ 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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.0902122114260.12848>