Bug 35992

Summary: /etc/rc has no way to force fsck -y at next boot, corrupt filesystems with soft updates required manual intervention
Product: Base System Reporter: Roy Hooper <rhooper>
Component: miscAssignee: Crist J. Clark <cjc>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.5-RELEASE   
Hardware: Any   
OS: Any   

Description Roy Hooper 2002-03-17 02:00:04 UTC
/etc/rc performs fsck -p then only fsck -y if fsck_y_enable="YES"

with softupdates, I managed to end up with a corrupt filesytem (in /usr/lib of all places!) causing the following kinds of error messages:
Mar 13 01:17:16 plumber /kernel: dscheck(#ad/0x20006): negative b_blkno -300154849
/usr/lib/compat/aout/libalias.so.2.4: Bad file descriptor

Fix: 

The solution was to force a fsck -y at boot time by modifying /etc/rc so that I could remotely reboot the machine.
Adding the ability to touch a temporary file such as /force-fsck-y would be very useful for remote maintenance.
How-To-Repeat: Actually corrupt your FFS filesystem with softupdates (somehow).  I think the combination of multiple hard poweroffs during compiles should do the trick.
Comment 1 Crist J. Clark freebsd_committer freebsd_triage 2002-03-17 04:49:14 UTC
On Sat, Mar 16, 2002 at 05:57:48PM -0800, Roy Hooper wrote:
[snip]

> >Fix:
> The solution was to force a fsck -y at boot time by modifying /etc/rc so that I could remotely reboot the machine.
> Adding the ability to touch a temporary file such as /force-fsck-y would be very useful for remote maintenance.

I'm confused. What does,

  # touch /force-fsck-y

Do for you that,

  # echo 'fsck_y_enable="YES"' >> /etc/rc.conf

Doesn't?
-- 
Crist J. Clark                     |     cjclark@alum.mit.edu
                                   |     cjclark@jhu.edu
http://people.freebsd.org/~cjc/    |     cjc@freebsd.org
Comment 2 Roy Hooper 2002-03-17 06:17:29 UTC
fsck_y_enable="YES" might not trigger fsck-y at the next reboot as it relies
on fsck -p to make it's decision.  In my case, it wasn't triggering fsck -y
ever at reboot beacuse it thought the filesystem was clean when it was not.

Roy
--
Roy Hooper
Project Manager & Senior UNIX Consultant
Decisive Technologies Inc.


----- Original Message -----
From: "Crist J. Clark" <cjc@FreeBSD.ORG>
To: "Roy Hooper" <rhooper@toybox.ca>
Cc: <freebsd-gnats-submit@FreeBSD.ORG>
Sent: Saturday, March 16, 2002 11:49 PM
Subject: Re: misc/35992: /etc/rc has no way to force fsck -y at next boot,
corrupt filesystems with soft updates required manual intervention


> On Sat, Mar 16, 2002 at 05:57:48PM -0800, Roy Hooper wrote:
> [snip]
>
> > >Fix:
> > The solution was to force a fsck -y at boot time by modifying /etc/rc so
that I could remotely reboot the machine.
> > Adding the ability to touch a temporary file such as /force-fsck-y would
be very useful for remote maintenance.
>
> I'm confused. What does,
>
>   # touch /force-fsck-y
>
> Do for you that,
>
>   # echo 'fsck_y_enable="YES"' >> /etc/rc.conf
>
> Doesn't?
> --
> Crist J. Clark                     |     cjclark@alum.mit.edu
>                                    |     cjclark@jhu.edu
> http://people.freebsd.org/~cjc/    |     cjc@freebsd.org
>
Comment 3 crist.clark 2002-03-17 06:34:31 UTC
On Sun, Mar 17, 2002 at 01:17:29AM -0500, Roy Hooper wrote:
> fsck_y_enable="YES" might not trigger fsck-y at the next reboot as it relies
> on fsck -p to make it's decision.  In my case, it wasn't triggering fsck -y
> ever at reboot beacuse it thought the filesystem was clean when it was not.

  # echo 'fsck -y' >> /etc/rc.early

-- 
Crist J. Clark                     |     cjclark@alum.mit.edu
                                   |     cjclark@jhu.edu
http://people.freebsd.org/~cjc/    |     cjc@freebsd.org
Comment 4 Roy Hooper 2002-03-17 06:39:03 UTC
Cool, sounds like a Handbook entry to me

Roy

--
Roy Hooper
Project Manager & Senior UNIX Consultant
Decisive Technologies Inc.

----- Original Message -----
From: "Crist J. Clark" <crist.clark@attbi.com>
To: "Roy Hooper" <rhooper@toybox.ca>
Cc: <freebsd-gnats-submit@FreeBSD.ORG>
Sent: Sunday, March 17, 2002 1:34 AM
Subject: Re: misc/35992: /etc/rc has no way to force fsck -y at next boot,
corrupt filesystems with soft updates required manual intervention


> On Sun, Mar 17, 2002 at 01:17:29AM -0500, Roy Hooper wrote:
> > fsck_y_enable="YES" might not trigger fsck-y at the next reboot as it
relies
> > on fsck -p to make it's decision.  In my case, it wasn't triggering
fsck -y
> > ever at reboot beacuse it thought the filesystem was clean when it was
not.
>
>   # echo 'fsck -y' >> /etc/rc.early
>
> --
> Crist J. Clark                     |     cjclark@alum.mit.edu
>                                    |     cjclark@jhu.edu
> http://people.freebsd.org/~cjc/    |     cjc@freebsd.org
>
Comment 5 crist.clark 2002-03-17 07:26:15 UTC
On Sun, Mar 17, 2002 at 01:39:03AM -0500, Roy Hooper wrote:
> Cool, sounds like a Handbook entry to me

rc.early probably should just be documented in rc(5).
-- 
Crist J. Clark                     |     cjclark@alum.mit.edu
                                   |     cjclark@jhu.edu
http://people.freebsd.org/~cjc/    |     cjc@freebsd.org
Comment 6 Crist J. Clark freebsd_committer freebsd_triage 2002-03-17 09:34:42 UTC
State Changed
From-To: open->analyzed

Added documentation for the rc.early(8) script to -CURRENT. 


Comment 7 Crist J. Clark freebsd_committer freebsd_triage 2002-03-17 09:34:42 UTC
Responsible Changed
From-To: freebsd-bugs->cjc

I'll MFC to -STABLE in a few days.
Comment 8 Crist J. Clark freebsd_committer freebsd_triage 2002-03-31 17:36:37 UTC
State Changed
From-To: analyzed->closed

The documentation mentioned in the audit trail was MFCed. As for 
possible fsck(8) problems, there was insufficient information to 
determine if there was a problem and what it might be. Sumbitter can 
submit a new PR if there are problems in the future. Thanks.