Subject: bin/2006: fsck(8) is FFS-specific; transition away from that should start
To: None <gnats-bugs@NetBSD.ORG>
From: Chris G. Demetriou <cgd@sun-lamp.pc.cs.cmu.edu>
List: netbsd-bugs
Date: 01/31/1996 18:00:35
>Number:         2006
>Category:       bin
>Synopsis:       fsck_ffs(8) should be ffs check program, fsck(8) for compat.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 31 18:35:02 1996
>Last-Modified:
>Originator:     Chris G. Demetriou
>Organization:
Kernel Hackers 'r' Us
>Release:        NetBSD-current as of 1/31/96
>Environment:
System: NetBSD sun-lamp.pc.cs.cmu.edu 1.1A NetBSD 1.1A (SUN_LAMP) #34: Thu Jan 18 20:53:30 EST 1996 cgd@sun-lamp.pc.cs.cmu.edu:/usr/src/sys/arch/i386/compile/SUN_LAMP i386


>Description:
	As noted in PRs 1211, 1212, and 1213, only the Fast File System
	("ffs") can be checked at boot time.  That problem can be broken
	down into two parts:
		(1) the other file systems don't have check programs,
		(2) fsck(8) (/sbin/fsck) supports only FFS, and has
		    no way to invoke other file systems' check programs.

	(1) is addressed by the above-mentioned problem reports.
	(2) is hard to address, for the issues outlined below.  However,
		this problem report begins to address those issues, so that
		/sbin/fsck can eventually be made a wrapper that invokes
		the appropriate file system check programs.

	There are two issues involved in making fsck(8) a wrapper that
	invokes other file system check program:
		(1) the code must be written to make it do so,
		(2) enough time must be given when phasing that code
		    in so that there are no problems when people try
		    to integrate it.

	I propose (and have included diffs and instructions below, to
	implement my suggestion), that 'fsck' be renamed 'fsck_ffs'.
	Until a large period of time has passed (at least one release),
	fsck should be a link to fsck_ffs (similar for manual pages).
	That way, at some point in the future, fsck(8) may be replaced
	painlessly with a wrapper that invokes the appropriate code.

>How-To-Repeat:
	Write a checker for another file system, try to get fsck(8) to run
	it, then think about what order changes to fsck(8) should be made in,
	in order to make integration safe for the rest of the world.

>Fix:
	To make the change proposed in this problem report, do the following:
		(1) apply the following patch from /usr/src,
		(2) move sbin/fsck/fsck.8 to sbin/fsck/fsck_ffs.8
		(3) move sbin/fsck to sbin/fsck_ffs
		(4) rename 'fsck' in sbin/Makefile to 'fsck_ffs'.

	At some point in the future (hopefully at least one real release
	after this code is integrated), fsck should be replaced as described
	above.  (I'll work on that later.  8-)  However, this patch gives
	the fsck/fsck_ffs split plenty of time to settle, so that nobody
	gets screwed when updating fsck and fsck_ffs (and ends up with no
	file system checker for ffs).

	I suggest this patch be applied ASAP.

Index: sbin/fsck/Makefile
===================================================================
RCS file: /cvsroot/src/sbin/fsck/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1996/01/20 06:59:51	1.1.1.1
--- Makefile	1996/01/31 22:17:47
***************
*** 1,8 ****
  #	$NetBSD: Makefile,v 1.10 1995/03/18 14:55:39 cgd Exp $
  #	@(#)Makefile	8.1 (Berkeley) 6/5/93
  
! PROG=	fsck
! MAN=	fsck.8
  SRCS=	dir.c inode.c main.c pass1.c pass1b.c pass2.c pass3.c pass4.c \
  	pass5.c preen.c setup.c utilities.c ffs_subr.c ffs_tables.c
  .PATH:	${.CURDIR}/../../sys/ufs/ffs
--- 1,8 ----
  #	$NetBSD: Makefile,v 1.10 1995/03/18 14:55:39 cgd Exp $
  #	@(#)Makefile	8.1 (Berkeley) 6/5/93
  
! PROG=	fsck_ffs
! MAN=	fsck_ffs.8
  SRCS=	dir.c inode.c main.c pass1.c pass1b.c pass2.c pass3.c pass4.c \
  	pass5.c preen.c setup.c utilities.c ffs_subr.c ffs_tables.c
  .PATH:	${.CURDIR}/../../sys/ufs/ffs
***************
*** 10,14 ****
--- 10,17 ----
  .if make(install)
  SUBDIR+= SMM.doc
  .endif
+ 
+ LINKS=	fsck_ffs fsck
+ MLINKS=	fsck_ffs.8 fsck.8
  
  .include <bsd.prog.mk>
Index: sbin/fsck/fsck.8
===================================================================
RCS file: /cvsroot/src/sbin/fsck/fsck.8,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 fsck.8
*** fsck.8	1996/01/20 06:59:54	1.1.1.1
--- fsck.8	1996/01/31 22:21:59
***************
*** 34,50 ****
  .\"	@(#)fsck.8	8.3 (Berkeley) 11/29/94
  .\"
  .Dd November 29, 1994
! .Dt FSCK 8
  .Os BSD 4
  .Sh NAME
! .Nm fsck
! .Nd filesystem consistency check and interactive repair
  .Sh SYNOPSIS
! .Nm fsck
  .Fl p
  .Op Fl f
  .Op Fl m Ar mode
! .Nm fsck
  .Op Fl f
  .Op Fl b Ar block#
  .Op Fl c Ar level
--- 34,50 ----
  .\"	@(#)fsck.8	8.3 (Berkeley) 11/29/94
  .\"
  .Dd November 29, 1994
! .Dt FSCK_FFS 8
  .Os BSD 4
  .Sh NAME
! .Nm fsck_ffs, fsck
! .Nd Fast File System consistency check and interactive repair
  .Sh SYNOPSIS
! .Nm fsck_ffs
  .Fl p
  .Op Fl f
  .Op Fl m Ar mode
! .Nm fsck_ffs
  .Op Fl f
  .Op Fl b Ar block#
  .Op Fl c Ar level
***************
*** 56,68 ****
  .Ar ...
  .Sh DESCRIPTION
  The first form of
! .Nm fsck
  preens a standard set of filesystems or the specified filesystems.
  It is normally used in the script
  .Pa /etc/rc
  during automatic reboot.
  Here
! .Nm fsck
  reads the table
  .Pa /etc/fstab
  to determine which filesystems to check.
--- 56,68 ----
  .Ar ...
  .Sh DESCRIPTION
  The first form of
! .Nm fsck_ffs
  preens a standard set of filesystems or the specified filesystems.
  It is normally used in the script
  .Pa /etc/rc
  during automatic reboot.
  Here
! .Nm fsck_ffs
  reads the table
  .Pa /etc/fstab
  to determine which filesystems to check.
***************
*** 93,99 ****
  .El
  .Pp
  These are the only inconsistencies that
! .Nm fsck
  with the
  .Fl p
  option will correct; if it encounters other inconsistencies, it exits
--- 93,99 ----
  .El
  .Pp
  These are the only inconsistencies that
! .Nm fsck_ffs
  with the
  .Fl p
  option will correct; if it encounters other inconsistencies, it exits
***************
*** 101,107 ****
  For each corrected inconsistency one or more lines will be printed
  identifying the filesystem on which the correction will take place,
  and the nature of the correction.  After successfully correcting a filesystem,
! .Nm fsck
  will print the number of files on that filesystem,
  the number of used and free blocks,
  and the percentage of fragmentation.
--- 101,107 ----
  For each corrected inconsistency one or more lines will be printed
  identifying the filesystem on which the correction will take place,
  and the nature of the correction.  After successfully correcting a filesystem,
! .Nm fsck_ffs
  will print the number of files on that filesystem,
  the number of used and free blocks,
  and the percentage of fragmentation.
***************
*** 109,115 ****
  If sent a
  .Dv QUIT
  signal,
! .Nm fsck
  will finish the filesystem checks, then exit with an abnormal
  return status that causes an automatic reboot to fail.
  This is useful when you want to finish the filesystem checks during an
--- 109,115 ----
  If sent a
  .Dv QUIT
  signal,
! .Nm fsck_ffs
  will finish the filesystem checks, then exit with an abnormal
  return status that causes an automatic reboot to fail.
  This is useful when you want to finish the filesystem checks during an
***************
*** 119,125 ****
  Without the
  .Fl p
  option,
! .Nm fsck
  audits and interactively repairs inconsistent conditions for filesystems. 
  If the filesystem is inconsistent the operator is prompted for concurrence
  before each correction is attempted.
--- 119,125 ----
  Without the
  .Fl p
  option,
! .Nm fsck_ffs
  audits and interactively repairs inconsistent conditions for filesystems. 
  If the filesystem is inconsistent the operator is prompted for concurrence
  before each correction is attempted.
***************
*** 135,141 ****
  or
  .Li no .
  If the operator does not have write permission on the filesystem
! .Nm fsck
  will default to a 
  .Fl n
  action.
--- 135,141 ----
  or
  .Li no .
  If the operator does not have write permission on the filesystem
! .Nm fsck_ffs
  will default to a 
  .Fl n
  action.
***************
*** 149,155 ****
  combined.
  .Pp
  The following flags are interpreted by
! .Nm fsck .
  .Bl -tag -width indent
  .It Fl f
  Force checking of file systems.  Normally, if a file system is cleanly
--- 149,155 ----
  combined.
  .Pp
  The following flags are interpreted by
! .Nm fsck_ffs .
  .Bl -tag -width indent
  .It Fl f
  Force checking of file systems.  Normally, if a file system is cleanly
***************
*** 180,191 ****
  set of permissions such as 700.
  .It Fl y
  Assume a yes response to all questions asked by 
! .Nm fsck ;
  this should be used with great caution as this is a free license
  to continue after essentially unlimited trouble has been encountered.
  .It Fl n
  Assume a no response to all questions asked by 
! .Nm fsck
  except for
  .Ql CONTINUE? ,
  which is assumed to be affirmative;
--- 180,191 ----
  set of permissions such as 700.
  .It Fl y
  Assume a yes response to all questions asked by 
! .Nm fsck_ffs ;
  this should be used with great caution as this is a free license
  to continue after essentially unlimited trouble has been encountered.
  .It Fl n
  Assume a no response to all questions asked by 
! .Nm fsck_ffs
  except for
  .Ql CONTINUE? ,
  which is assumed to be affirmative;
***************
*** 210,216 ****
  .El
  .Pp
  In interactive mode,
! .Nm fsck
  will list the conversion to be made
  and ask whether the conversion should be done.
  If a negative answer is given,
--- 210,216 ----
  .El
  .Pp
  In interactive mode,
! .Nm fsck_ffs
  will list the conversion to be made
  and ask whether the conversion should be done.
  If a negative answer is given,
***************
*** 226,232 ****
  .El
  .Pp
  If no filesystems are given to 
! .Nm fsck
  then a default list of filesystems is read from
  the file
  .Pa /etc/fstab .
--- 226,232 ----
  .El
  .Pp
  If no filesystems are given to 
! .Nm fsck_ffs
  then a default list of filesystems is read from
  the file
  .Pa /etc/fstab .
***************
*** 294,300 ****
  .El
  .Sh DIAGNOSTICS
  The diagnostics produced by 
! .Nm fsck
  are fully enumerated and explained in Appendix A of
  .Rs
  .%T "Fsck \- The UNIX File System Check Program"
--- 294,300 ----
  .El
  .Sh DIAGNOSTICS
  The diagnostics produced by 
! .Nm fsck_ffs
  are fully enumerated and explained in Appendix A of
  .Rs
  .%T "Fsck \- The UNIX File System Check Program"
Index: sbin/fsck/setup.c
===================================================================
RCS file: /cvsroot/src/sbin/fsck/setup.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 setup.c
*** setup.c	1996/01/20 07:00:02	1.1.1.1
--- setup.c	1996/01/31 22:26:20
***************
*** 135,144 ****
  			printf("%s %s\n%s %s\n%s %s\n",
  				"SEARCH FOR ALTERNATE SUPER-BLOCK",
  				"FAILED. YOU MUST USE THE",
! 				"-b OPTION TO FSCK TO SPECIFY THE",
  				"LOCATION OF AN ALTERNATE",
  				"SUPER-BLOCK TO SUPPLY NEEDED",
! 				"INFORMATION; SEE fsck(8).");
  			return(0);
  		}
  		doskipclean = 0;
--- 135,144 ----
  			printf("%s %s\n%s %s\n%s %s\n",
  				"SEARCH FOR ALTERNATE SUPER-BLOCK",
  				"FAILED. YOU MUST USE THE",
! 				"-b OPTION TO FSCK_FFS TO SPECIFY THE",
  				"LOCATION OF AN ALTERNATE",
  				"SUPER-BLOCK TO SUPPLY NEEDED",
! 				"INFORMATION; SEE fsck_ffs(8).");
  			return(0);
  		}
  		doskipclean = 0;
Index: sbin/fsck/utilities.c
===================================================================
RCS file: /cvsroot/src/sbin/fsck/utilities.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 utilities.c
*** utilities.c	1996/01/20 07:00:04	1.1.1.1
--- utilities.c	1996/01/31 22:20:36
***************
*** 568,574 ****
  		printf("%s: ", cdevname);
  		printf(s, a1, a2, a3);
  		printf("\n");
! 		printf("%s: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.\n",
  			cdevname);
  		exit(8);
  	}
--- 568,574 ----
  		printf("%s: ", cdevname);
  		printf(s, a1, a2, a3);
  		printf("\n");
! 		printf("%s: UNEXPECTED INCONSISTENCY; RUN fsck_ffs MANUALLY.\n",
  			cdevname);
  		exit(8);
  	}
Index: sbin/fsck/SMM.doc/0.t
===================================================================
RCS file: /cvsroot/src/sbin/fsck/SMM.doc/0.t,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 0.t
*** 0.t	1996/01/20 07:00:08	1.1.1.1
--- 0.t	1996/01/31 22:24:47
***************
*** 35,41 ****
  .\"
  .if n .ND
  .TL
! Fsck \- The UNIX\(dg File System Check Program
  .EH 'SMM:3-%''The \s-2UNIX\s+2 File System Check Program'
  .OH 'The \s-2UNIX\s+2 File System Check Program''SMM:3-%'
  .AU
--- 35,41 ----
  .\"
  .if n .ND
  .TL
! Fsck_ffs \- The UNIX\(dg File System Check Program
  .EH 'SMM:3-%''The \s-2UNIX\s+2 File System Check Program'
  .OH 'The \s-2UNIX\s+2 File System Check Program''SMM:3-%'
  .AU
***************
*** 63,77 ****
  Contract No. N00039-82-C-0235.
  .FE
  This document reflects the use of
! .I fsck
  with the 4.2BSD and 4.3BSD file system organization.  This
  is a revision of the
  original paper written by
  T. J. Kowalski.
  .PP
! File System Check Program (\fIfsck\fR)
  is an interactive file system check and repair program.
! .I Fsck
  uses the redundant structural information in the
  UNIX file system to perform several consistency checks.
  If an inconsistency is detected, it is reported
--- 63,77 ----
  Contract No. N00039-82-C-0235.
  .FE
  This document reflects the use of
! .I fsck_ffs
  with the 4.2BSD and 4.3BSD file system organization.  This
  is a revision of the
  original paper written by
  T. J. Kowalski.
  .PP
! File System Check Program (\fIfsck_ffs\fR)
  is an interactive file system check and repair program.
! .I Fsck_ffs
  uses the redundant structural information in the
  UNIX file system to perform several consistency checks.
  If an inconsistency is detected, it is reported
***************
*** 81,87 ****
  of the file system updates, which are performed every
  time a file is modified.
  Unless there has been a hardware failure,
! .I fsck
  is able to repair corrupted file systems
  using procedures based upon the order in which UNIX honors
  these file system update requests.
--- 81,87 ----
  of the file system updates, which are performed every
  time a file is modified.
  Unless there has been a hardware failure,
! .I fsck_ffs
  is able to repair corrupted file systems
  using procedures based upon the order in which UNIX honors
  these file system update requests.
***************
*** 91,97 ****
  to discuss the possible causes of file system corruption,
  and to present the corrective actions implemented
  by
! .I fsck.
  Both the program and the interaction between the
  program and the operator are described.
  .sp 2
--- 91,97 ----
  to discuss the possible causes of file system corruption,
  and to present the corrective actions implemented
  by
! .I fsck_ffs.
  Both the program and the interaction between the
  program and the operator are described.
  .sp 2
Index: sbin/fsck/SMM.doc/1.t
===================================================================
RCS file: /cvsroot/src/sbin/fsck/SMM.doc/1.t,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 1.t
*** 1.t	1996/01/20 07:00:08	1.1.1.1
--- 1.t	1996/01/31 22:24:51
***************
*** 38,44 ****
  Introduction
  .PP
  This document reflects the use of
! .I fsck
  with the 4.2BSD and 4.3BSD file system organization.  This
  is a revision of the
  original paper written by
--- 38,44 ----
  Introduction
  .PP
  This document reflects the use of
! .I fsck_ffs
  with the 4.2BSD and 4.3BSD file system organization.  This
  is a revision of the
  original paper written by
***************
*** 51,57 ****
  a reliable environment for file storage on disk.
  If an inconsistency is discovered,
  corrective action must be taken.
! .I Fsck
  runs in two modes.
  Normally it is run non-interactively by the system after 
  a normal boot.
--- 51,57 ----
  a reliable environment for file storage on disk.
  If an inconsistency is discovered,
  corrective action must be taken.
! .I Fsck_ffs
  runs in two modes.
  Normally it is run non-interactively by the system after 
  a normal boot.
***************
*** 59,69 ****
  it will only make changes to the file system that are known
  to always be correct.
  If an unexpected inconsistency is found
! .I fsck
  will exit with a non-zero exit status, 
  leaving the system running single-user.
  Typically the operator then runs 
! .I fsck
  interactively.
  When running in this mode,
  each problem is listed followed by a suggested corrective action.
--- 59,69 ----
  it will only make changes to the file system that are known
  to always be correct.
  If an unexpected inconsistency is found
! .I fsck_ffs
  will exit with a non-zero exit status, 
  leaving the system running single-user.
  Typically the operator then runs 
! .I fsck_ffs
  interactively.
  When running in this mode,
  each problem is listed followed by a suggested corrective action.
***************
*** 79,85 ****
  Finally,
  the set of deterministic corrective actions
  used by
! .I fsck
  (the Coast Guard
  to the rescue) is presented.
  .ds RH Overview of the File System
--- 79,85 ----
  Finally,
  the set of deterministic corrective actions
  used by
! .I fsck_ffs
  (the Coast Guard
  to the rescue) is presented.
  .ds RH Overview of the File System
Index: sbin/fsck/SMM.doc/3.t
===================================================================
RCS file: /cvsroot/src/sbin/fsck/SMM.doc/3.t,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 3.t
*** 3.t	1996/01/20 07:00:10	1.1.1.1
--- 3.t	1996/01/31 22:24:57
***************
*** 68,86 ****
  Detecting and correcting corruption
  .PP
  Normally
! .I fsck
  is run non-interactively.
  In this mode it will only fix
  corruptions that are expected to occur from an unclean halt.
  These actions are a proper subset of the actions that 
! .I fsck
  will take when it is running interactively.
  Throughout this paper we assume that 
! .I fsck 
  is being run interactively,
  and all possible errors can be encountered.
  When an inconsistency is discovered in this mode,
! .I fsck
  reports the inconsistency for the operator to
  chose a corrective action.
  .PP
--- 68,86 ----
  Detecting and correcting corruption
  .PP
  Normally
! .I fsck_ffs
  is run non-interactively.
  In this mode it will only fix
  corruptions that are expected to occur from an unclean halt.
  These actions are a proper subset of the actions that 
! .I fsck_ffs
  will take when it is running interactively.
  Throughout this paper we assume that 
! .I fsck_ffs 
  is being run interactively,
  and all possible errors can be encountered.
  When an inconsistency is discovered in this mode,
! .I fsck_ffs
  reports the inconsistency for the operator to
  chose a corrective action.
  .PP
***************
*** 97,106 ****
  The file system
  .B must
  be in a quiescent state when
! .I fsck
  is run,
  since
! .I fsck
  is a multi-pass program.
  .PP
  In the following sections,
--- 97,106 ----
  The file system
  .B must
  be in a quiescent state when
! .I fsck_ffs
  is run,
  since
! .I fsck_ffs
  is a multi-pass program.
  .PP
  In the following sections,
***************
*** 128,181 ****
  and the number of blocks used by the list of inodes.
  The file-system size and layout information
  are the most critical pieces of information for
! .I fsck .
  While there is no way to actually check these sizes,
  since they are statically determined by
  .I newfs ,
! .I fsck
  can check that these sizes are within reasonable bounds.
  All other file system checks require that these sizes be correct.
  If
! .I fsck 
  detects corruption in the static parameters of the default super-block,
! .I fsck
  requests the operator to specify the location of an alternate super-block.
  .NH 2
  Free block checking
  .PP
! .I Fsck
  checks that all the blocks
  marked as free in the cylinder group block maps
  are not claimed by any files.
  When all the blocks have been initially accounted for,
! .I fsck
  checks that
  the number of free blocks
  plus the number of blocks claimed by the inodes
  equals the total number of blocks in the file system.
  .PP
  If anything is wrong with the block allocation maps,
! .I fsck
  will rebuild them,
  based on the list it has computed of allocated blocks.
  .PP
  The summary information associated with the super-block
  counts the total number of free blocks within the file system.
! .I Fsck
  compares this count to the
  number of free blocks it found within the file system.
  If the two counts do not agree, then
! .I fsck
  replaces the incorrect count in the summary information
  by the actual free-block count.
  .PP
  The summary information
  counts the total number of free inodes within the file system.
! .I Fsck
  compares this count to the number
  of free inodes it found within the file system.
  If the two counts do not agree, then
! .I fsck
  replaces the incorrect count in the
  summary information by the actual free-inode count.
  .NH 2
--- 128,181 ----
  and the number of blocks used by the list of inodes.
  The file-system size and layout information
  are the most critical pieces of information for
! .I fsck_ffs .
  While there is no way to actually check these sizes,
  since they are statically determined by
  .I newfs ,
! .I fsck_ffs
  can check that these sizes are within reasonable bounds.
  All other file system checks require that these sizes be correct.
  If
! .I fsck_ffs 
  detects corruption in the static parameters of the default super-block,
! .I fsck_ffs
  requests the operator to specify the location of an alternate super-block.
  .NH 2
  Free block checking
  .PP
! .I Fsck_ffs
  checks that all the blocks
  marked as free in the cylinder group block maps
  are not claimed by any files.
  When all the blocks have been initially accounted for,
! .I fsck_ffs
  checks that
  the number of free blocks
  plus the number of blocks claimed by the inodes
  equals the total number of blocks in the file system.
  .PP
  If anything is wrong with the block allocation maps,
! .I fsck_ffs
  will rebuild them,
  based on the list it has computed of allocated blocks.
  .PP
  The summary information associated with the super-block
  counts the total number of free blocks within the file system.
! .I Fsck_ffs
  compares this count to the
  number of free blocks it found within the file system.
  If the two counts do not agree, then
! .I fsck_ffs
  replaces the incorrect count in the summary information
  by the actual free-block count.
  .PP
  The summary information
  counts the total number of free inodes within the file system.
! .I Fsck_ffs
  compares this count to the number
  of free inodes it found within the file system.
  If the two counts do not agree, then
! .I fsck_ffs
  replaces the incorrect count in the
  summary information by the actual free-inode count.
  .NH 2
***************
*** 209,215 ****
  An inode can get in this state if
  bad data is written into the inode list.
  The only possible corrective action is for
! .I fsck
  is to clear the inode.
  .NH 2
  Inode links
--- 209,215 ----
  An inode can get in this state if
  bad data is written into the inode list.
  The only possible corrective action is for
! .I fsck_ffs
  is to clear the inode.
  .NH 2
  Inode links
***************
*** 217,223 ****
  Each inode counts the
  total number of directory entries
  linked to the inode.
! .I Fsck
  verifies the link count of each inode
  by starting at the root of the file system,
  and descending through the directory structure.
--- 217,223 ----
  Each inode counts the
  total number of directory entries
  linked to the inode.
! .I Fsck_ffs
  verifies the link count of each inode
  by starting at the root of the file system,
  and descending through the directory structure.
***************
*** 228,234 ****
  link count is zero,
  then no directory entry appears for the inode.
  If this happens,
! .I fsck
  will place the disconnected file in the
  .I lost+found
  directory.
--- 228,234 ----
  link count is zero,
  then no directory entry appears for the inode.
  If this happens,
! .I fsck_ffs
  will place the disconnected file in the
  .I lost+found
  directory.
***************
*** 236,242 ****
  a directory entry may have been added or removed without the inode being
  updated.
  If this happens,
! .I fsck
  replaces the incorrect stored link count by the actual link count.
  .PP
  Each inode contains a list,
--- 236,242 ----
  a directory entry may have been added or removed without the inode being
  updated.
  If this happens,
! .I fsck_ffs
  replaces the incorrect stored link count by the actual link count.
  .PP
  Each inode contains a list,
***************
*** 247,253 ****
  inconsistencies in indirect blocks directly
  affect the inode that owns it.
  .PP
! .I Fsck
  compares each block number claimed by an inode
  against a list of already allocated blocks.
  If another inode already claims a block number,
--- 247,253 ----
  inconsistencies in indirect blocks directly
  affect the inode that owns it.
  .PP
! .I Fsck_ffs
  compares each block number claimed by an inode
  against a list of already allocated blocks.
  If another inode already claims a block number,
***************
*** 257,263 ****
  is updated to include the block number.
  .PP
  If there are any duplicate blocks,
! .I fsck
  will perform a partial second
  pass over the inode list
  to find the inode of the duplicated block.
--- 257,263 ----
  is updated to include the block number.
  .PP
  If there are any duplicate blocks,
! .I fsck_ffs
  will perform a partial second
  pass over the inode list
  to find the inode of the duplicated block.
***************
*** 272,283 ****
  modify time is usually incorrect,
  and should be cleared.
  If this happens,
! .I fsck
  prompts the operator to clear both inodes.
  The operator must decide which one should be kept
  and which one should be cleared.
  .PP
! .I Fsck
  checks the range of each block number claimed by an inode.
  If the block number is
  lower than the first data block in the file system,
--- 272,283 ----
  modify time is usually incorrect,
  and should be cleared.
  If this happens,
! .I fsck_ffs
  prompts the operator to clear both inodes.
  The operator must decide which one should be kept
  and which one should be cleared.
  .PP
! .I Fsck_ffs
  checks the range of each block number claimed by an inode.
  If the block number is
  lower than the first data block in the file system,
***************
*** 288,294 ****
  an indirect block that was not written to the file system,
  a condition which can only occur if there has been a hardware failure.
  If an inode contains bad block numbers,
! .I fsck
  prompts the operator to clear it.
  .NH 2
  Inode data size
--- 288,294 ----
  an indirect block that was not written to the file system,
  a condition which can only occur if there has been a hardware failure.
  If an inode contains bad block numbers,
! .I fsck_ffs
  prompts the operator to clear it.
  .NH 2
  Inode data size
***************
*** 298,309 ****
  The number of actual data blocks
  is the sum of the allocated data blocks
  and the indirect blocks.
! .I Fsck
  computes the actual number of data blocks
  and compares that block count against
  the actual number of blocks the inode claims.
  If an inode contains an incorrect count
! .I fsck
  prompts the operator to fix it.
  .PP
  Each inode contains a thirty-two bit size field.
--- 298,309 ----
  The number of actual data blocks
  is the sum of the allocated data blocks
  and the indirect blocks.
! .I Fsck_ffs
  computes the actual number of data blocks
  and compares that block count against
  the actual number of blocks the inode claims.
  If an inode contains an incorrect count
! .I fsck_ffs
  prompts the operator to fix it.
  .PP
  Each inode contains a thirty-two bit size field.
***************
*** 327,333 ****
  symbolic link data blocks
  contain the path name stored in a link.
  Directory data blocks contain directory entries.
! .I Fsck
  can only check the validity of directory data blocks.
  .PP
  Each directory data block is checked for
--- 327,333 ----
  symbolic link data blocks
  contain the path name stored in a link.
  Directory data blocks contain directory entries.
! .I Fsck_ffs
  can only check the validity of directory data blocks.
  .PP
  Each directory data block is checked for
***************
*** 341,354 ****
  If the inode number in a directory data block
  references an unallocated inode,
  then
! .I fsck
  will remove that directory entry.
  Again,
  this condition can only arise when there has been a hardware failure.
  .PP
  If a directory entry inode number references
  outside the inode list, then
! .I fsck
  will remove that directory entry.
  This condition occurs if bad data is written into a directory data block.
  .PP
--- 341,354 ----
  If the inode number in a directory data block
  references an unallocated inode,
  then
! .I fsck_ffs
  will remove that directory entry.
  Again,
  this condition can only arise when there has been a hardware failure.
  .PP
  If a directory entry inode number references
  outside the inode list, then
! .I fsck_ffs
  will remove that directory entry.
  This condition occurs if bad data is written into a directory data block.
  .PP
***************
*** 368,386 ****
  root directory).
  If the directory inode numbers are
  incorrect,
! .I fsck
  will replace them with the correct values.
  If there are multiple hard links to a directory,
  the first one encountered is considered the real parent
  to which ``\fB..\fP'' should point;
! \fIfsck\fP recommends deletion for the subsequently discovered names.
  .NH 2
  File system connectivity
  .PP
! .I Fsck
  checks the general connectivity of the file system.
  If directories are not linked into the file system, then
! .I fsck
  links the directory back into the file system in the
  .I lost+found
  directory.
--- 368,386 ----
  root directory).
  If the directory inode numbers are
  incorrect,
! .I fsck_ffs
  will replace them with the correct values.
  If there are multiple hard links to a directory,
  the first one encountered is considered the real parent
  to which ``\fB..\fP'' should point;
! \fIfsck_ffs\fP recommends deletion for the subsequently discovered names.
  .NH 2
  File system connectivity
  .PP
! .I Fsck_ffs
  checks the general connectivity of the file system.
  If directories are not linked into the file system, then
! .I fsck_ffs
  links the directory back into the file system in the
  .I lost+found
  directory.
***************
*** 401,409 ****
  .PP
  I would like to thank Larry A. Wehr for advice that lead
  to the first version of
! .I fsck
  and Rick B. Brandt for adapting
! .I fsck
  to
  UNIX/TS. (T. Kowalski, July 1979)
  .sp 2
--- 401,409 ----
  .PP
  I would like to thank Larry A. Wehr for advice that lead
  to the first version of
! .I fsck_ffs
  and Rick B. Brandt for adapting
! .I fsck_ffs
  to
  UNIX/TS. (T. Kowalski, July 1979)
  .sp 2
***************
*** 437,441 ****
  .I "The Bell System Technical Journal\^"
  .B 57 ,
  6 (July-August 1978, Part 2), pp. 1931-46.
! .ds RH Appendix A \- Fsck Error Conditions
  .bp
--- 437,441 ----
  .I "The Bell System Technical Journal\^"
  .B 57 ,
  6 (July-August 1978, Part 2), pp. 1931-46.
! .ds RH Appendix A \- Fsck_ffs Error Conditions
  .bp
Index: sbin/fsck/SMM.doc/4.t
===================================================================
RCS file: /cvsroot/src/sbin/fsck/SMM.doc/4.t,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 4.t
*** 4.t	1996/01/20 07:00:12	1.1.1.1
--- 4.t	1996/01/31 22:26:06
***************
*** 33,52 ****
  .\"
  .\"	@(#)4.t	8.1 (Berkeley) 6/5/93
  .\"
! .ds RH Appendix A \- Fsck Error Conditions
  .NH
! Appendix A \- Fsck Error Conditions
  .NH 2 
  Conventions
  .PP
! .I Fsck
  is
  a multi-pass file system check program.
  Each file system pass invokes a different Phase of the
! .I fsck
  program.
  After the initial setup,
! .I fsck
  performs successive Phases over each file system,
  checking blocks and sizes,
  path-names,
--- 33,52 ----
  .\"
  .\"	@(#)4.t	8.1 (Berkeley) 6/5/93
  .\"
! .ds RH Appendix A \- Fsck_ffs Error Conditions
  .NH
! Appendix A \- Fsck_ffs Error Conditions
  .NH 2 
  Conventions
  .PP
! .I Fsck_ffs
  is
  a multi-pass file system check program.
  Each file system pass invokes a different Phase of the
! .I fsck_ffs
  program.
  After the initial setup,
! .I fsck_ffs
  performs successive Phases over each file system,
  checking blocks and sizes,
  path-names,
***************
*** 57,63 ****
  and performs some cleanup.
  .LP
  Normally
! .I fsck
  is run non-interactively to
  .I preen
  the file systems after an unclean halt.
--- 57,63 ----
  and performs some cleanup.
  .LP
  Normally
! .I fsck_ffs
  is run non-interactively to
  .I preen
  the file systems after an unclean halt.
***************
*** 65,79 ****
  it will only fix corruptions that are expected
  to occur from an unclean halt.
  These actions are a proper subset of the actions that 
! .I fsck
  will take when it is running interactively.
  Throughout this appendix many errors have several options
  that the operator can take.
  When an inconsistency is detected,
! .I fsck
  reports the error condition to the operator.
  If a response is required,
! .I fsck
  prints a prompt message and
  waits for a response.
  When preen'ing most errors are fatal.
--- 65,79 ----
  it will only fix corruptions that are expected
  to occur from an unclean halt.
  These actions are a proper subset of the actions that 
! .I fsck_ffs
  will take when it is running interactively.
  Throughout this appendix many errors have several options
  that the operator can take.
  When an inconsistency is detected,
! .I fsck_ffs
  reports the error condition to the operator.
  If a response is required,
! .I fsck_ffs
  prints a prompt message and
  waits for a response.
  When preen'ing most errors are fatal.
***************
*** 85,91 ****
  The error conditions are organized by the
  .I Phase
  of the
! .I fsck
  program in which they can occur.
  The error conditions that may occur
  in more than one Phase
--- 85,91 ----
  The error conditions are organized by the
  .I Phase
  of the
! .I fsck_ffs
  program in which they can occur.
  The error conditions that may occur
  in more than one Phase
***************
*** 111,122 ****
  .B "\fIC\fP option?"
  .br
  \fIC\fP is not a legal option to
! .I fsck ;
  legal options are \-b, \-c, \-y, \-n, and \-p.
! .I Fsck
  terminates on this error condition.
  See the
! .I fsck (8)
  manual entry for further detail.
  .sp
  .LP
--- 111,122 ----
  .B "\fIC\fP option?"
  .br
  \fIC\fP is not a legal option to
! .I fsck_ffs ;
  legal options are \-b, \-c, \-y, \-n, and \-p.
! .I Fsck_ffs
  terminates on this error condition.
  See the
! .I fsck_ffs (8)
  manual entry for further detail.
  .sp
  .LP
***************
*** 128,138 ****
  .br
  .B "cannot alloc NNN bytes for lncntp"
  .br
! .I Fsck 's
  request for memory for its virtual
  memory tables failed.
  This should never happen.
! .I Fsck
  terminates on this error condition.
  See a guru.
  .sp
--- 128,138 ----
  .br
  .B "cannot alloc NNN bytes for lncntp"
  .br
! .I Fsck_ffs 's
  request for memory for its virtual
  memory tables failed.
  This should never happen.
! .I Fsck_ffs
  terminates on this error condition.
  See a guru.
  .sp
***************
*** 143,159 ****
  \fIF\fP (usually
  .I /etc/fstab )
  can not be opened for reading.
! .I Fsck
  terminates on this error condition.
  Check access modes of \fIF\fP.
  .sp
  .LP
  .B "Can't stat root"
  .br
! .I Fsck 's
  request for statistics about the root directory ``/'' failed.
  This should never happen.
! .I Fsck
  terminates on this error condition.
  See a guru.
  .sp
--- 143,159 ----
  \fIF\fP (usually
  .I /etc/fstab )
  can not be opened for reading.
! .I Fsck_ffs
  terminates on this error condition.
  Check access modes of \fIF\fP.
  .sp
  .LP
  .B "Can't stat root"
  .br
! .I Fsck_ffs 's
  request for statistics about the root directory ``/'' failed.
  This should never happen.
! .I Fsck_ffs
  terminates on this error condition.
  See a guru.
  .sp
***************
*** 162,168 ****
  .br
  .B "Can't make sense out of name \fIF\fP"
  .br
! .I Fsck 's
  request for statistics about the file system \fIF\fP failed.
  When running manually,
  it ignores this file system
--- 162,168 ----
  .br
  .B "Can't make sense out of name \fIF\fP"
  .br
! .I Fsck_ffs 's
  request for statistics about the file system \fIF\fP failed.
  When running manually,
  it ignores this file system
***************
*** 172,178 ****
  .LP
  .B "Can't open \fIF\fP"
  .br
! .I Fsck 's
  request attempt to open the file system \fIF\fP failed.
  When running manually, it ignores this file system
  and continues checking the next file system given.
--- 172,178 ----
  .LP
  .B "Can't open \fIF\fP"
  .br
! .I Fsck_ffs 's
  request attempt to open the file system \fIF\fP failed.
  When running manually, it ignores this file system
  and continues checking the next file system given.
***************
*** 182,188 ****
  .B "\fIF\fP: (NO WRITE)"
  .br
  Either the \-n flag was specified or
! .I fsck 's
  attempt to open the file system \fIF\fP for writing failed.
  When running manually,
  all the diagnostics are printed out,
--- 182,188 ----
  .B "\fIF\fP: (NO WRITE)"
  .br
  Either the \-n flag was specified or
! .I fsck_ffs 's
  attempt to open the file system \fIF\fP for writing failed.
  When running manually,
  all the diagnostics are printed out,
***************
*** 192,198 ****
  .B "file is not a block or character device; OK"
  .br
  You have given
! .I fsck
  a regular file name by mistake.
  Check the type of the file specified.
  .LP
--- 192,198 ----
  .B "file is not a block or character device; OK"
  .br
  You have given
! .I fsck_ffs
  a regular file name by mistake.
  Check the type of the file specified.
  .LP
***************
*** 274,282 ****
  .br
  .B "\fIF\fP: BAD SUPER BLOCK: \fIB\fP"
  .br
! .B "USE -b OPTION TO FSCK TO SPECIFY LOCATION OF AN ALTERNATE"
  .br
! .B "SUPER-BLOCK TO SUPPLY NEEDED INFORMATION; SEE fsck(8)."
  .br
  The super block has been corrupted. 
  An alternative super block must be selected from among those
--- 274,282 ----
  .br
  .B "\fIF\fP: BAD SUPER BLOCK: \fIB\fP"
  .br
! .B "USE -b OPTION TO FSCK_FFS TO SPECIFY LOCATION OF AN ALTERNATE"
  .br
! .B "SUPER-BLOCK TO SUPPLY NEEDED INFORMATION; SEE fsck_ffs(8)."
  .br
  The super block has been corrupted. 
  An alternative super block must be selected from among those
***************
*** 289,295 ****
  .LP
  .B "INTERNAL INCONSISTENCY: \fIM\fP"
  .br
! .I Fsck 's
  has had an internal panic, whose message is specified as \fIM\fP.
  This should never happen.
  See a guru.
--- 289,295 ----
  .LP
  .B "INTERNAL INCONSISTENCY: \fIM\fP"
  .br
! .I Fsck_ffs 's
  has had an internal panic, whose message is specified as \fIM\fP.
  This should never happen.
  See a guru.
***************
*** 297,303 ****
  .LP
  .B "CAN NOT SEEK: BLK \fIB\fP (CONTINUE)"
  .br
! .I Fsck 's
  request for moving to a specified block number \fIB\fP in
  the file system failed.
  This should never happen.
--- 297,303 ----
  .LP
  .B "CAN NOT SEEK: BLK \fIB\fP (CONTINUE)"
  .br
! .I Fsck_ffs 's
  request for moving to a specified block number \fIB\fP in
  the file system failed.
  This should never happen.
***************
*** 310,320 ****
  however the problem will persist.
  This error condition will not allow a complete check of the file system.
  A second run of
! .I fsck
  should be made to re-check this file system.
  If the block was part of the virtual memory buffer
  cache,
! .I fsck
  will terminate with the message ``Fatal I/O error''.
  .IP NO
  terminate the program.
--- 310,320 ----
  however the problem will persist.
  This error condition will not allow a complete check of the file system.
  A second run of
! .I fsck_ffs
  should be made to re-check this file system.
  If the block was part of the virtual memory buffer
  cache,
! .I fsck_ffs
  will terminate with the message ``Fatal I/O error''.
  .IP NO
  terminate the program.
***************
*** 322,328 ****
  .LP
  .B "CAN NOT READ: BLK \fIB\fP (CONTINUE)"
  .br
! .I Fsck 's
  request for reading a specified block number \fIB\fP in
  the file system failed.
  This should never happen.
--- 322,328 ----
  .LP
  .B "CAN NOT READ: BLK \fIB\fP (CONTINUE)"
  .br
! .I Fsck_ffs 's
  request for reading a specified block number \fIB\fP in
  the file system failed.
  This should never happen.
***************
*** 337,343 ****
  .br
  where \fIN\fP indicates the sectors that could not be read.
  If 
! .I fsck
  ever tries to write back one of the blocks on which the read failed
  it will print the message:
  .br
--- 337,343 ----
  .br
  where \fIN\fP indicates the sectors that could not be read.
  If 
! .I fsck_ffs
  ever tries to write back one of the blocks on which the read failed
  it will print the message:
  .br
***************
*** 347,357 ****
  If the disk is experiencing hardware problems, the problem will persist.
  This error condition will not allow a complete check of the file system.
  A second run of
! .I fsck
  should be made to re-check this file system.
  If the block was part of the virtual memory buffer
  cache,
! .I fsck
  will terminate with the message ``Fatal I/O error''.
  .IP NO
  terminate the program.
--- 347,357 ----
  If the disk is experiencing hardware problems, the problem will persist.
  This error condition will not allow a complete check of the file system.
  A second run of
! .I fsck_ffs
  should be made to re-check this file system.
  If the block was part of the virtual memory buffer
  cache,
! .I fsck_ffs
  will terminate with the message ``Fatal I/O error''.
  .IP NO
  terminate the program.
***************
*** 359,365 ****
  .LP
  .B "CAN NOT WRITE: BLK \fIB\fP (CONTINUE)"
  .br
! .I Fsck 's
  request for writing a specified block number \fIB\fP
  in the file system failed.
  The disk is write-protected;
--- 359,365 ----
  .LP
  .B "CAN NOT WRITE: BLK \fIB\fP (CONTINUE)"
  .br
! .I Fsck_ffs 's
  request for writing a specified block number \fIB\fP
  in the file system failed.
  The disk is write-protected;
***************
*** 378,388 ****
  If the disk is experiencing hardware problems, the problem will persist.
  This error condition will not allow a complete check of the file system.
  A second run of
! .I fsck
  should be made to re-check this file system.
  If the block was part of the virtual memory buffer
  cache,
! .I fsck
  will terminate with the message ``Fatal I/O error''.
  .IP NO
  terminate the program.
--- 378,388 ----
  If the disk is experiencing hardware problems, the problem will persist.
  This error condition will not allow a complete check of the file system.
  A second run of
! .I fsck_ffs
  should be made to re-check this file system.
  If the block was part of the virtual memory buffer
  cache,
! .I fsck_ffs
  will terminate with the message ``Fatal I/O error''.
  .IP NO
  terminate the program.
***************
*** 392,398 ****
  .br
  An internal error has attempted to read non-existent inode \fIDDD\fP.
  This error causes 
! .I fsck
  to exit.
  See a guru.
  .NH 2 
--- 392,398 ----
  .br
  An internal error has attempted to read non-existent inode \fIDDD\fP.
  This error causes 
! .I fsck_ffs
  to exit.
  See a guru.
  .NH 2 
***************
*** 430,442 ****
  .LP
  .B "PARTIALLY TRUNCATED INODE I=\fII\fP (SALVAGE)"
  .br
! .I Fsck
  has found inode \fII\fP whose size is shorter than the number of
  blocks allocated to it.
  This condition should only occur if the system crashes while in the
  midst of truncating a file.
  When preen'ing the file system, 
! .I fsck
  completes the truncation to the specified size.
  .LP
  Possible responses to SALVAGE are:
--- 430,442 ----
  .LP
  .B "PARTIALLY TRUNCATED INODE I=\fII\fP (SALVAGE)"
  .br
! .I Fsck_ffs
  has found inode \fII\fP whose size is shorter than the number of
  blocks allocated to it.
  This condition should only occur if the system crashes while in the
  midst of truncating a file.
  When preen'ing the file system, 
! .I fsck_ffs
  completes the truncation to the specified size.
  .LP
  Possible responses to SALVAGE are:
***************
*** 449,466 ****
  .B "LINK COUNT TABLE OVERFLOW (CONTINUE)"
  .br
  An internal table for
! .I fsck
  containing allocated inodes with a link count of
  zero cannot allocate more memory.
  Increase the virtual memory for
! .I fsck .
  .LP
  Possible responses to the CONTINUE prompt are:
  .IP YES
  continue with the program.
  This error condition will not allow a complete check of the file system.
  A second run of
! .I fsck
  should be made to re-check this file system.
  If another allocated inode with a zero link count is found,
  this error condition is repeated.
--- 449,466 ----
  .B "LINK COUNT TABLE OVERFLOW (CONTINUE)"
  .br
  An internal table for
! .I fsck_ffs
  containing allocated inodes with a link count of
  zero cannot allocate more memory.
  Increase the virtual memory for
! .I fsck_ffs .
  .LP
  Possible responses to the CONTINUE prompt are:
  .IP YES
  continue with the program.
  This error condition will not allow a complete check of the file system.
  A second run of
! .I fsck_ffs
  should be made to re-check this file system.
  If another allocated inode with a zero link count is found,
  this error condition is repeated.
***************
*** 495,501 ****
  and continue checking with the next inode in the file system.
  This error condition will not allow a complete check of the file system.
  A second run of
! .I fsck
  should be made to re-check this file system.
  .IP NO
  terminate the program.
--- 495,501 ----
  and continue checking with the next inode in the file system.
  This error condition will not allow a complete check of the file system.
  A second run of
! .I fsck_ffs
  should be made to re-check this file system.
  .IP NO
  terminate the program.
***************
*** 504,512 ****
  .B "BAD STATE DDD TO BLKERR"
  .br
  An internal error has scrambled 
! .I fsck 's
  state map to have the impossible value \fIDDD\fP.
! .I Fsck
  exits immediately. 
  See a guru.
  .sp
--- 504,512 ----
  .B "BAD STATE DDD TO BLKERR"
  .br
  An internal error has scrambled 
! .I fsck_ffs 's
  state map to have the impossible value \fIDDD\fP.
! .I Fsck_ffs
  exits immediately. 
  See a guru.
  .sp
***************
*** 535,541 ****
  and continue checking with the next inode in the file system.
  This error condition will not allow a complete check of the file system.
  A second run of
! .I fsck
  should be made to re-check this file system.
  .IP NO
  terminate the program.
--- 535,541 ----
  and continue checking with the next inode in the file system.
  This error condition will not allow a complete check of the file system.
  A second run of
! .I fsck_ffs
  should be made to re-check this file system.
  .IP NO
  terminate the program.
***************
*** 544,560 ****
  .B "DUP TABLE OVERFLOW (CONTINUE)"
  .br
  An internal table in
! .I fsck
  containing duplicate block numbers cannot allocate any more space.
  Increase the amount of virtual memory available to
! .I fsck .
  .LP
  Possible responses to the CONTINUE prompt are:
  .IP YES
  continue with the program.
  This error condition will not allow a complete check of the file system.
  A second run of
! .I fsck
  should be made to re-check this file system.
  If another duplicate block is found, this error condition will repeat.
  .IP NO
--- 544,560 ----
  .B "DUP TABLE OVERFLOW (CONTINUE)"
  .br
  An internal table in
! .I fsck_ffs
  containing duplicate block numbers cannot allocate any more space.
  Increase the amount of virtual memory available to
! .I fsck_ffs .
  .LP
  Possible responses to the CONTINUE prompt are:
  .IP YES
  continue with the program.
  This error condition will not allow a complete check of the file system.
  A second run of
! .I fsck_ffs
  should be made to re-check this file system.
  If another duplicate block is found, this error condition will repeat.
  .IP NO
***************
*** 629,640 ****
  in Phase 3 and put into
  .I lost+found .
  If the attempt to allocate the root fails,
! .I fsck
  will exit with the message:
  .br
  .B "CANNOT ALLOCATE ROOT INODE" .
  .IP NO
! .I fsck
  will exit.
  .sp
  .LP
--- 629,640 ----
  in Phase 3 and put into
  .I lost+found .
  If the attempt to allocate the root fails,
! .I fsck_ffs
  will exit with the message:
  .br
  .B "CANNOT ALLOCATE ROOT INODE" .
  .IP NO
! .I fsck_ffs
  will exit.
  .sp
  .LP
***************
*** 651,662 ****
  in Phase 3 and put into
  .I lost+found .
  If the attempt to allocate the root fails,
! .I fsck
  will exit with the message:
  .br
  .B "CANNOT ALLOCATE ROOT INODE" .
  .IP NO
! .I fsck
  will then prompt with
  .B "FIX"
  .LP
--- 651,662 ----
  in Phase 3 and put into
  .I lost+found .
  If the attempt to allocate the root fails,
! .I fsck_ffs
  will exit with the message:
  .br
  .B "CANNOT ALLOCATE ROOT INODE" .
  .IP NO
! .I fsck_ffs
  will then prompt with
  .B "FIX"
  .LP
***************
*** 682,693 ****
  in Phase 3 and put into
  .I lost+found .
  If the attempt to allocate the root fails,
! .I fsck
  will exit with the message:
  .br
  .B "CANNOT ALLOCATE ROOT INODE" .
  .IP NO
! .I fsck
  will then prompt with
  .B "CONTINUE" .
  .LP
--- 682,693 ----
  in Phase 3 and put into
  .I lost+found .
  If the attempt to allocate the root fails,
! .I fsck_ffs
  will exit with the message:
  .br
  .B "CANNOT ALLOCATE ROOT INODE" .
  .IP NO
! .I fsck_ffs
  will then prompt with
  .B "CONTINUE" .
  .LP
***************
*** 836,847 ****
  .B "CANNOT FIX, FIRST ENTRY IN DIRECTORY CONTAINS \fIF\fP"
  .br
  A directory \fII\fP has been found whose first entry is \fIF\fP.
! .I Fsck
  cannot resolve this problem. 
  The file system should be mounted and the offending entry \fIF\fP
  moved elsewhere.
  The file system should then be unmounted and
! .I fsck
  should be run again.
  .sp
  .LP
--- 836,847 ----
  .B "CANNOT FIX, FIRST ENTRY IN DIRECTORY CONTAINS \fIF\fP"
  .br
  A directory \fII\fP has been found whose first entry is \fIF\fP.
! .I Fsck_ffs
  cannot resolve this problem. 
  The file system should be mounted and the offending entry \fIF\fP
  moved elsewhere.
  The file system should then be unmounted and
! .I fsck_ffs
  should be run again.
  .sp
  .LP
***************
*** 850,856 ****
  .B "CANNOT FIX, INSUFFICIENT SPACE TO ADD `.'"
  .br
  A directory \fII\fP has been found whose first entry is not `.'.
! .I Fsck
  cannot resolve this problem as it should never happen.
  See a guru.
  .sp
--- 850,856 ----
  .B "CANNOT FIX, INSUFFICIENT SPACE TO ADD `.'"
  .br
  A directory \fII\fP has been found whose first entry is not `.'.
! .I Fsck_ffs
  cannot resolve this problem as it should never happen.
  See a guru.
  .sp
***************
*** 896,907 ****
  .B "CANNOT FIX, SECOND ENTRY IN DIRECTORY CONTAINS \fIF\fP"
  .br
  A directory \fII\fP has been found whose second entry is \fIF\fP.
! .I Fsck
  cannot resolve this problem. 
  The file system should be mounted and the offending entry \fIF\fP
  moved elsewhere.
  The file system should then be unmounted and
! .I fsck
  should be run again.
  .sp
  .LP
--- 896,907 ----
  .B "CANNOT FIX, SECOND ENTRY IN DIRECTORY CONTAINS \fIF\fP"
  .br
  A directory \fII\fP has been found whose second entry is \fIF\fP.
! .I Fsck_ffs
  cannot resolve this problem. 
  The file system should be mounted and the offending entry \fIF\fP
  moved elsewhere.
  The file system should then be unmounted and
! .I fsck_ffs
  should be run again.
  .sp
  .LP
***************
*** 910,921 ****
  .B "CANNOT FIX, INSUFFICIENT SPACE TO ADD `..'"
  .br
  A directory \fII\fP has been found whose second entry is not `..'.
! .I Fsck
  cannot resolve this problem.
  The file system should be mounted and the second entry in the directory
  moved elsewhere.
  The file system should then be unmounted and
! .I fsck
  should be run again.
  .sp
  .LP
--- 910,921 ----
  .B "CANNOT FIX, INSUFFICIENT SPACE TO ADD `..'"
  .br
  A directory \fII\fP has been found whose second entry is not `..'.
! .I Fsck_ffs
  cannot resolve this problem.
  The file system should be mounted and the second entry in the directory
  moved elsewhere.
  The file system should then be unmounted and
! .I fsck_ffs
  should be run again.
  .sp
  .LP
***************
*** 932,938 ****
  .LP
  .B "\fIN\fP IS AN EXTRANEOUS HARD LINK TO A DIRECTORY \fID\fP (REMOVE)
  .br
! .I Fsck
  has found a hard link, \fIN\fP, to a directory, \fID\fP.
  When preen'ing the extraneous links are ignored.
  .LP
--- 932,938 ----
  .LP
  .B "\fIN\fP IS AN EXTRANEOUS HARD LINK TO A DIRECTORY \fID\fP (REMOVE)
  .br
! .I Fsck_ffs
  has found a hard link, \fIN\fP, to a directory, \fID\fP.
  When preen'ing the extraneous links are ignored.
  .LP
***************
*** 947,953 ****
  .br
  An internal error has caused an impossible state \fIS\fP to be passed to the
  routine that descends the file system directory structure.
! .I Fsck
  exits.
  See a guru.
  .sp
--- 947,953 ----
  .br
  An internal error has caused an impossible state \fIS\fP to be passed to the
  routine that descends the file system directory structure.
! .I Fsck_ffs
  exits.
  See a guru.
  .sp
***************
*** 956,962 ****
  .br
  An internal error has caused an impossible state \fIS\fP to be returned
  from the routine that descends the file system directory structure.
! .I Fsck
  exits.
  See a guru.
  .sp
--- 956,962 ----
  .br
  An internal error has caused an impossible state \fIS\fP to be returned
  from the routine that descends the file system directory structure.
! .I Fsck_ffs
  exits.
  See a guru.
  .sp
***************
*** 965,971 ****
  .br
  An internal error has caused an impossible state \fIS\fP to be assigned
  to the root inode.
! .I Fsck
  exits.
  See a guru.
  .NH 2 
--- 965,971 ----
  .br
  An internal error has caused an impossible state \fIS\fP to be assigned
  to the root inode.
! .I Fsck_ffs
  exits.
  See a guru.
  .NH 2 
***************
*** 1010,1016 ****
  .I lost+found
  directory in the root directory of the file system;
  When preen'ing
! .I fsck
  tries to create a \fIlost+found\fP directory.
  .LP
  Possible responses to the CREATE prompt are:
--- 1010,1016 ----
  .I lost+found
  directory in the root directory of the file system;
  When preen'ing
! .I fsck_ffs
  tries to create a \fIlost+found\fP directory.
  .LP
  Possible responses to the CREATE prompt are:
***************
*** 1071,1077 ****
  .I lost+found
  directory is expanded to make room for the new entry.
  If the attempted expansion fails
! .I fsck
  prints the message:
  .br
  .B "SORRY. NO SPACE IN lost+found DIRECTORY"
--- 1071,1077 ----
  .I lost+found
  directory is expanded to make room for the new entry.
  If the attempted expansion fails
! .I fsck_ffs
  prints the message:
  .br
  .B "SORRY. NO SPACE IN lost+found DIRECTORY"
***************
*** 1118,1124 ****
  .br
  An internal error has caused an impossible state \fIS\fP to be passed to the
  routine that descends the file system directory structure.
! .I Fsck
  exits.
  See a guru.
  .NH 2 
--- 1118,1124 ----
  .br
  An internal error has caused an impossible state \fIS\fP to be passed to the
  routine that descends the file system directory structure.
! .I Fsck_ffs
  exits.
  See a guru.
  .NH 2 
***************
*** 1182,1188 ****
  .I lost+found
  directory in the root directory of the file system;
  When preen'ing
! .I fsck
  tries to create a \fIlost+found\fP directory.
  .LP
  Possible responses to the CREATE prompt are:
--- 1182,1188 ----
  .I lost+found
  directory in the root directory of the file system;
  When preen'ing
! .I fsck_ffs
  tries to create a \fIlost+found\fP directory.
  .LP
  Possible responses to the CREATE prompt are:
***************
*** 1243,1249 ****
  .I lost+found
  directory is expanded to make room for the new entry.
  If the attempted expansion fails
! .I fsck
  prints the message:
  .br
  .B "SORRY. NO SPACE IN lost+found DIRECTORY"
--- 1243,1249 ----
  .I lost+found
  directory is expanded to make room for the new entry.
  If the attempted expansion fails
! .I fsck_ffs
  prints the message:
  .br
  .B "SORRY. NO SPACE IN lost+found DIRECTORY"
***************
*** 1268,1274 ****
  is increasing, a condition that should never occur unless precipitated
  by a hardware failure.
  When the number of references is increasing under preen mode,
! .I fsck
  exits with the message:
  .br
  .B "LINK COUNT INCREASING"
--- 1268,1274 ----
  is increasing, a condition that should never occur unless precipitated
  by a hardware failure.
  When the number of references is increasing under preen mode,
! .I fsck_ffs
  exits with the message:
  .br
  .B "LINK COUNT INCREASING"
***************
*** 1398,1411 ****
  .br
  This is an advisory message indicating that
  the root file system has been modified by
! .I fsck.
  If UNIX is not rebooted immediately,
  the work done by
! .I fsck
  may be undone by the in-core copies of tables
  UNIX keeps.
  When preen'ing,
! .I fsck
  will exit with a code of 4.
  The standard auto-reboot script distributed with 4.3BSD 
  interprets an exit code of 4 by issuing a reboot system call.
--- 1398,1411 ----
  .br
  This is an advisory message indicating that
  the root file system has been modified by
! .I fsck_ffs.
  If UNIX is not rebooted immediately,
  the work done by
! .I fsck_ffs
  may be undone by the in-core copies of tables
  UNIX keeps.
  When preen'ing,
! .I fsck_ffs
  will exit with a code of 4.
  The standard auto-reboot script distributed with 4.3BSD 
  interprets an exit code of 4 by issuing a reboot system call.
***************
*** 1415,1426 ****
  .br
  This is an advisory message indicating that
  the current file system was modified by
! .I fsck.
  If this file system is mounted or is the current root file system,
! .I fsck
  should be halted and UNIX rebooted.
  If UNIX is not rebooted immediately,
  the work done by
! .I fsck
  may be undone by the in-core copies of tables
  UNIX keeps.
--- 1415,1426 ----
  .br
  This is an advisory message indicating that
  the current file system was modified by
! .I fsck_ffs.
  If this file system is mounted or is the current root file system,
! .I fsck_ffs
  should be halted and UNIX rebooted.
  If UNIX is not rebooted immediately,
  the work done by
! .I fsck_ffs
  may be undone by the in-core copies of tables
  UNIX keeps.
Index: sbin/fsck/SMM.doc/Makefile
===================================================================
RCS file: /cvsroot/src/sbin/fsck/SMM.doc/Makefile,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile
*** Makefile	1996/01/20 07:00:12	1.1.1.1
--- Makefile	1996/01/31 22:19:34
***************
*** 1,7 ****
  #	$NetBSD: Makefile,v 1.2 1995/03/18 14:56:15 cgd Exp $
  #	@(#)Makefile	8.1 (Berkeley) 6/8/93
  
! DIR=	smm/03.fsck
  SRCS=	0.t 1.t 2.t 3.t 4.t
  MACROS=	-ms
  
--- 1,7 ----
  #	$NetBSD: Makefile,v 1.2 1995/03/18 14:56:15 cgd Exp $
  #	@(#)Makefile	8.1 (Berkeley) 6/8/93
  
! DIR=	smm/03.fsck_ffs
  SRCS=	0.t 1.t 2.t 3.t 4.t
  MACROS=	-ms
  
Index: sbin/etc/mtree/4.4BSD.dist
===================================================================
RCS file: /cvsroot/src/etc/mtree/4.4BSD.dist,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 4.4BSD.dist
*** 4.4BSD.dist	1996/01/20 04:04:20	1.1.1.1
--- 4.4BSD.dist	1996/01/31 22:44:15
***************
*** 489,497 ****
  # ./usr/share/doc/smm/02.config
  ..
  
! # ./usr/share/doc/smm/03.fsck
! 03.fsck
! # ./usr/share/doc/smm/03.fsck
  ..
  
  # ./usr/share/doc/smm/04.quotas
--- 489,497 ----
  # ./usr/share/doc/smm/02.config
  ..
  
! # ./usr/share/doc/smm/03.fsck_ffs
! 03.fsck_ffs
! # ./usr/share/doc/smm/03.fsck_ffs
  ..
  
  # ./usr/share/doc/smm/04.quotas
>Audit-Trail:
>Unformatted: