From owner-freebsd-arch@FreeBSD.ORG Sat Jul 8 16:05:53 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 B362016A4DA; Sat, 8 Jul 2006 16:05:53 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6568F43D45; Sat, 8 Jul 2006 16:05:53 +0000 (GMT) (envelope-from sam@errno.com) Received: from [10.0.0.199] ([10.0.0.199]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id k68G5oV6075714 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 8 Jul 2006 09:05:51 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <44AFD7DF.8090002@errno.com> Date: Sat, 08 Jul 2006 09:05:51 -0700 From: Sam Leffler Organization: Errno Consulting User-Agent: Thunderbird 1.5.0.4 (Macintosh/20060530) MIME-Version: 1.0 To: Craig Rodrigues References: <20060708152801.GA3671@crodrigues.org> In-Reply-To: <20060708152801.GA3671@crodrigues.org> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 16:05:53 -0000 Craig Rodrigues wrote: > Hi, > > One of the pet peeves I have with FreeBSD is that > if I have a device with a local filesystem that I want to mount, > I need to explicitly know what type of filesystem is on the > device in order to mount it from the command-line. > > For example, > > mount -t cd9660 > mount -t udf > mount -t ext2fs > mount -t msdosfs > > Where this is particularly annoying is if I have multiple > USB thumb drives with different filesystems on them. > > What I usually end up doing is something like: > file - < /dev/ad0s4 > > to figure out the filesystem type, and then mount -t [whatever] to mount it. > > What I would like to do is: > > mount /dev/ad0s4 /mnt > > and if I do not specify a filesystem type with -t, the mount > program should "magically" figure out how to mount the disk. > This is closer to how the mount program behaves on Linux for example. > > I've come up with a patch that does this, by interpreting > an fstype of "" as: > - starting with "ufs", iterate over all the local filesystem types > that we know about, and try to mount the device > > Comments? <...patch deleted...> Linux has -t auto; haven't looked at how it works. It appears you just try a series of fs types; can't you read the device to infer the filesystem? Sam