From owner-freebsd-questions@FreeBSD.ORG Wed Apr 2 17:01:52 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 283C679D for ; Wed, 2 Apr 2014 17:01:52 +0000 (UTC) Received: from mail.cyberleo.net (mtumishi.cyberleo.net [216.226.128.201]) by mx1.freebsd.org (Postfix) with ESMTP id 05FD4BE3 for ; Wed, 2 Apr 2014 17:01:51 +0000 (UTC) Received: from [172.16.44.4] (vitani.den.cyberleo.net [216.80.73.130]) by mail.cyberleo.net (Postfix) with ESMTPSA id EA4543CED; Wed, 2 Apr 2014 12:54:17 -0400 (EDT) Message-ID: <533C40BF.2010907@cyberleo.net> Date: Wed, 02 Apr 2014 11:54:23 -0500 From: CyberLeo Kitsana User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: "Ronald F. Guilmette" , freebsd-questions@freebsd.org Subject: Re: A question about fsck and the -t option References: <85383.1396427621@server1.tristatelogic.com> In-Reply-To: <85383.1396427621@server1.tristatelogic.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 17:01:52 -0000 On 04/02/2014 03:33 AM, Ronald F. Guilmette wrote: > > If fsck is invoked upon a /dev device node which is a hard disk > partition containing a valid file system, and if this invocation > of fcsk _does not_ include any -t or -T options, then does fsck > make any sort of attempt to automagically determine or intuit what > sort of file system exists upon and within the given partition? > > Previous to today, I had always believed that either (a) fsck looked > at the magic number in the first word of the partition in order to > automagically determine the file system type or else (b) that fsck, > on FreeBSD at least, defaulted (in the absence of any explicit -t or > -T options) to assuming that the file system type was ufs. But as of > this moment it appears to me that neither of these assumptions were or > are true, and that in the absence of all -t and/or -T options, fsck on > FreeBSD simply throws up its hands and says "Could not determine > filesystem type". > > Is this the intended outcome in such cases? A glance at the source code[1] suggests that it attempts to infer the type from the fstab, and then the BSD disklabel. It does not appear to attempt a guess from the filesystem magic itself. [1] http://git.cyberleo.net/?p=FreeBSD/releng/10.0.git;a=blob;f=sbin/fsck/fsck.c;h=6bc702e9028001cc7e9a3410214970658d162b6b;hb=HEAD#l203 -- Fuzzy love, -CyberLeo Technical Administrator CyberLeo.Net Webhosting http://www.CyberLeo.Net Furry Peace! - http://www.fur.com/peace/