From owner-freebsd-arch@FreeBSD.ORG Sat Jul 8 18:58:34 2006 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5279F16A4DD; Sat, 8 Jul 2006 18:58:34 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id B75BB43D45; Sat, 8 Jul 2006 18:58:31 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.14] (imini.samsco.home [192.168.254.14]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id k68IwIUA035170; Sat, 8 Jul 2006 12:58:23 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <44B00011.9050902@samsco.org> Date: Sat, 08 Jul 2006 12:57:21 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.7) Gecko/20050416 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Craig Rodrigues References: <20060708152801.GA3671@crodrigues.org> <44AFD7DF.8090002@errno.com> <20060708161719.GB3871@crodrigues.org> In-Reply-To: <20060708161719.GB3871@crodrigues.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.1.1 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on pooker.samsco.org Cc: freebsd-current@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [RFC] mount can figure out fstype automatically X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jul 2006 18:58:34 -0000 Craig Rodrigues wrote: > On Sat, Jul 08, 2006 at 09:05:51AM -0700, Sam Leffler wrote: > >>Linux has -t auto; haven't looked at how it works. > > > I didn't want to implement -t auto, in > case that would confuse things in case someone gets around > to implementing autofs for FreeBSD, so I just used -t "". > > >>It appears you just try a series of fs types; can't you read the device >>to infer the filesystem? > > > I was thinking of doing something like that. You can basically > get the same info by doing something like: > > file - < /dev/ad0s1e > /dev/stdin: Unix Fast File system (little-endian) > > file - < /dev/ad0s4 > /dev/stdin: SGI XFS filesystem > > > I leaned away from this approach in mount(8) because: > - I didn't want to tie mount(8) to file(1) > - I didn't want to build up a table of known superblocks > inside mount(8) because every time a new filesystem is > added to FreeBSD, mount(8) would need to be updated > > If there was a way, maybe at the GEOM or filesystem level to > "taste" what type of filesystem existed on a device, and/or > have a filesystem advertise what type of superblock it has, > then that would be a nice way to do it, but I couldn't figure > out a way to easily do it. > > Well, by running through a list of possible filesystems and trying each one, you are effectively 'tasting' them. In a brute force way, but still the exact same idea. But really, it's not like filesystems are sprouting up every day, so I don't see the need to spend a lot of time making this elegant and highly extensible. Scott