path: root/sbin/fsck_ffs/fsck_ffs.8
diff options
authorDavid Bright <dab@FreeBSD.org>2018-01-15 19:25:11 +0000
committerDavid Bright <dab@FreeBSD.org>2018-01-15 19:25:11 +0000
commit469759f8e4bec7897f7d1802d534f8f82d36b898 (patch)
tree2409b275c5936f9cd11b5e783d290f0e3a10fe76 /sbin/fsck_ffs/fsck_ffs.8
parent91fe5fe7e7e46b4045ce75a2087fa149fae8cbda (diff)
Exit fsck_ffs with non-zero status when file system is not repaired.
When the fsck_ffs program cannot fully repair a file system, it will output the message PLEASE RERUN FSCK. However, it does not exit with a non-zero status in this case (contradicting the man page claim that it "exits with 0 on success, and >0 if an error occurs." The fsck rc-script (when running "fsck -y") tests the status from fsck (which passes along the exit status from fsck_ffs) and issues a "stop_boot" if the status fails. However, this is not effective since fsck_ffs can return zero even on (some) errors. Effectively, it is left to a later step in the boot process when the file systems are mounted to detect the still-unclean file system and stop the boot. This change modifies fsck_ffs so that when it cannot fully repair the file system and issues the PLEASE RERUN FSCK message it also exits with a non-zero status. While here, the fsck_ffs man page has also been updated to document the failing exit status codes used by fsck_ffs. Previously, only exit status 7 was documented. Some of these exit statuses are tested for in the fsck rc-script, so they are clearly depended upon and deserve documentation. Reviewed by: mckusick, vangyzen, jilles (manpages) MFC after: 1 week Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D13862
Notes: svn path=/head/; revision=328013
Diffstat (limited to 'sbin/fsck_ffs/fsck_ffs.8')
1 files changed, 36 insertions, 4 deletions
diff --git a/sbin/fsck_ffs/fsck_ffs.8 b/sbin/fsck_ffs/fsck_ffs.8
index 0d29a9aebd5a..a1b2cdda70a3 100644
--- a/sbin/fsck_ffs/fsck_ffs.8
+++ b/sbin/fsck_ffs/fsck_ffs.8
@@ -29,7 +29,7 @@
.\" @(#)fsck.8 8.4 (Berkeley) 5/9/95
.\" $FreeBSD$
-.Dd February 14, 2017
+.Dd January 13, 2018
@@ -376,11 +376,43 @@ contains default list of file systems to check.
.Ex -std
-If the option
+Specific non-zero exit status values used are:
+.Bl -tag -width indent
+.It 1
+Usage error (missing or invalid command arguments).
+.It 2
+.Fl p
+option was used and a
+was received, indicating that the system should be returned to single
+user mode after the file system check.
+.It 3
+The file system superblock cannot be read.
+This could indicate that the file system device does not exist or is not yet
+.It 4
+A mounted file system was modified; the system should be rebooted.
+.It 5
+.Fl B
+option was used and soft updates are not enabled on the file system.
+.It 6
+.Fl B
+option was used and the kernel lacks needed support.
+.It 7
.Fl F
-is used,
+option was used and the file system is clean.
+.It 8
+General error exit.
+.It 16
+The file system could not be completely repaired.
+The file system may be able to be repaired by running
-exits 7 if the file system is clean.
+on the file system again.
The diagnostics produced by