From rfg@tristatelogic.com  Thu Apr  3 03:38:24 2014
Return-Path: <rfg@tristatelogic.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 94A6CB39
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  3 Apr 2014 03:38:24 +0000 (UTC)
Received: from outgoing.tristatelogic.com (segfault.tristatelogic.com [69.62.255.118])
	by mx1.freebsd.org (Postfix) with ESMTP id 76399F93
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  3 Apr 2014 03:38:23 +0000 (UTC)
Received: by segfault.tristatelogic.com (Postfix, from userid 1237)
	id BDBAC3AE0E; Wed,  2 Apr 2014 20:38:23 -0700 (PDT)
Message-Id: <20140403033823.BDBAC3AE0E@segfault.tristatelogic.com>
Date: Wed,  2 Apr 2014 20:38:23 -0700 (PDT)
From: Ronald F.Guilmette <rfg@tristatelogic.com>
Reply-To: Ronald F.Guilmette <rfg@tristatelogic.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc: rfg@tristatelogic.com
Subject: Manpage for fsck(8) doesn't say what happens when no -t or -T
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         188214
>Category:       docs
>Synopsis:       Manpage for fsck(8) doesn't say what happens when no -t or -T
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 03 03:40:00 UTC 2014
>Closed-Date:    
>Last-Modified:  Sun May 25 05:20:02 UTC 2014
>Originator:     Ronald F. Guilmette
>Release:        FreeBSD 9.1-RELEASE amd64
>Organization:
entr0py
>Environment:

9.1-RELEASE amd64

>Description:

It has been suggested to me that if and when fsck(8) is invoked _without_
any explicitly provided -t or -T options, fsck will, in such cases, attempt
to intuit the type of the filesystem on its own, perhaps based upon
information/clues gleened from the local /etc/fstab file and/or from some
relevant BSD disk label.

If true, then this behavior does not appear to be documented at all within
the fsck(8) manpage.

This is an important aspect of the behavior of fsck(8).  If verified, then
it should be documented in the manpage.

>How-To-Repeat:

man 8 fsck

>Fix:

Sorry, I do not have any suggested replacement text for the relevant manpage
at this time.
>Release-Note:
>Audit-Trail:

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/188214: commit references a PR
Date: Fri, 23 May 2014 14:33:01 +0000 (UTC)

 Author: trhodes
 Date: Fri May 23 14:32:57 2014
 New Revision: 266586
 URL: http://svnweb.freebsd.org/changeset/base/266586
 
 Log:
   If called without -T or -t, fsck attempts to detect the
   file system type.  If this fails, fsck will fail with
   "unknown file system type" message.
   
   PR:		188214
 
 Modified:
   head/sbin/fsck/fsck.8
 
 Modified: head/sbin/fsck/fsck.8
 ==============================================================================
 --- head/sbin/fsck/fsck.8	Fri May 23 11:56:32 2014	(r266585)
 +++ head/sbin/fsck/fsck.8	Fri May 23 14:32:57 2014	(r266586)
 @@ -29,7 +29,7 @@
  .\"
  .\" $FreeBSD$
  .\"
 -.Dd January 25, 2009
 +.Dd May 23, 2014
  .Dt FSCK 8
  .Os
  .Sh NAME
 @@ -111,6 +111,18 @@ The disk drive containing each file syst
  of the device name that ends in a digit; the remaining characters are assumed
  to be the partition and slice designators.
  .Pp
 +If the
 +.Fl t
 +or
 +.Fl T
 +flags are not specified,
 +.Nm
 +will attempt to determine the file system type and call the
 +appropriated file system check utility.
 +Failure to detect the file system type will cause
 +.Nm
 +to fail with a message that the partition has an unknown file system type.
 +.Pp
  The options are as follows:
  .Bl -tag -width indent
  .It Fl C
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: Allan Jude <allanjude@freebsd.org>
To: bug-followup@FreeBSD.org, rfg@tristatelogic.com, 
 Tom Rhodes <trhodes@FreeBSD.org>
Cc:  
Subject: Re: docs/188214: Manpage for fsck(8) doesn&#39;t say what happens
 when no -t or -T
Date: Fri, 23 May 2014 11:39:24 -0400

 I have not checked the code to be sure, but from general usage I have
 noticed that fsck(8) doesn't actually try to detect, or 'taste' the
 partition, but only looks at /etc/fstab and if the type is not
 specified, then returns the error.
 
 Suggesting that it 'attempts to detect' may give the wrong impression.
 Someone would have to look at the source of fsck(8) to be sure.
 
 -- 
 Allan Jude

From: Mark Linimon <linimon@lonesome.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/188214: Manpage for fsck(8) doesn&#39;t say what happens
 when no -t or -T
Date: Sat, 24 May 2014 12:11:17 -0500

 ----- Forwarded message from Tom Rhodes <trhodes@FreeBSD.org> -----
 
 Date: Sat, 24 May 2014 12:32:04 -0400
 From: Tom Rhodes <trhodes@FreeBSD.org>
 To: Allan Jude <allanjude@freebsd.org>
 Cc: freebsd-doc@FreeBSD.org
 Subject: Re: docs/188214: Manpage for fsck(8) doesn&#39;t say what happens when no -t or -T
 X-Mailer: Sylpheed version 1.0.6 (GTK+ 1.2.10; x86_64-unknown-freebsd9.2)
 
 >  Suggesting that it 'attempts to detect' may give the wrong impression.
 >  Someone would have to look at the source of fsck(8) to be sure.
 
 So, in theory, an attempt to parse /etc/fstab would be
 an attempt to detect the type; however, my quick glance
 at the code showed no real parsing of fstab.  But in
 my case, I followed to both the T and t flags, and just
 glanced at what was done would they not be specified.
 That was really as far as I got, and I attempted to use
 very generic language in case it only does one, or the
 other, or both.  :)
 
 Reasonable?
 
 -- 
 Tom Rhodes
 _______________________________________________
 freebsd-doc@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-doc
 To unsubscribe, send any mail to "freebsd-doc-unsubscribe@freebsd.org"
 
 ----- End forwarded message -----

From: Benjamin Kaduk <bjk@freebsd.org>
To: Tom Rhodes <trhodes@freebsd.org>
Cc: Allan Jude <allanjude@freebsd.org>, bug-followup@freebsd.org
Subject: Re: docs/188214: Manpage for fsck(8) doesn&#39;t say what happens
 when no -t or -T
Date: Sat, 24 May 2014 17:42:47 -0400 (EDT)

 On Sat, 24 May 2014, Tom Rhodes wrote:
 
 > So, in theory, an attempt to parse /etc/fstab would be
 > an attempt to detect the type; however, my quick glance
 > at the code showed no real parsing of fstab.  But in
 > my case, I followed to both the T and t flags, and just
 > glanced at what was done would they not be specified.
 > That was really as far as I got, and I attempted to use
 > very generic language in case it only does one, or the
 > other, or both.  :)
 
 When passed no device or path arguments, fsck just checks everything from 
 the fstab; that's not very interesting for this question.
 
 Given a path argument and no type argument to use, fstab is parsed using 
 getfsfile() or getfsspec() around line 204 of fsck.c.  This will fail 
 (well, barring special circumstances) if the argument is instead a device 
 name.
 
 Given a device name argument and no type argument to use, after the fstab 
 check above, fsck opens the device and uses ioctl() to get the disklabel 
 and does some magic to grab the fstype from it.  (See getfslab(), in 
 fsck.c)
 
 
 So, I think there is a fair bit of autodetection that is attempted.
 
 -Ben

From: Tom Rhodes <trhodes@FreeBSD.org>
To: Benjamin Kaduk <bjk@freebsd.org>
Cc: trhodes@freebsd.org, allanjude@freebsd.org, bug-followup@freebsd.org
Subject: Re: docs/188214: Manpage for fsck(8) doesn&#39;t say what happens
 when no -t or -T
Date: Sun, 25 May 2014 01:16:52 -0400

 Hi Benjamin,
 
 On Sat, 24 May 2014 17:42:47 -0400 (EDT)
 Benjamin Kaduk <bjk@freebsd.org> wrote:
 
 > On Sat, 24 May 2014, Tom Rhodes wrote:
 > 
 > > So, in theory, an attempt to parse /etc/fstab would be
 > > an attempt to detect the type; however, my quick glance
 > > at the code showed no real parsing of fstab.  But in
 > > my case, I followed to both the T and t flags, and just
 > > glanced at what was done would they not be specified.
 > > That was really as far as I got, and I attempted to use
 > > very generic language in case it only does one, or the
 > > other, or both.  :)
 > 
 > When passed no device or path arguments, fsck just checks everything from 
 > the fstab; that's not very interesting for this question.
 > 
 > Given a path argument and no type argument to use, fstab is parsed using 
 > getfsfile() or getfsspec() around line 204 of fsck.c.  This will fail 
 > (well, barring special circumstances) if the argument is instead a device 
 > name.
 > 
 > Given a device name argument and no type argument to use, after the fstab 
 > check above, fsck opens the device and uses ioctl() to get the disklabel 
 > and does some magic to grab the fstype from it.  (See getfslab(), in 
 > fsck.c)
 > 
 > 
 > So, I think there is a fair bit of autodetection that is attempted.
 
 Thanks for the deep dive - I was going to revisit this later
 (i.e.: actually step through the code more) if there was a real
 issue.  Thanks for saving me the time!  :)
 
 -- 
 Tom Rhodes
>Unformatted:
