From owner-freebsd-current@FreeBSD.ORG Thu Jan 18 14:43:17 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4140116A40F for ; Thu, 18 Jan 2007 14:43:17 +0000 (UTC) (envelope-from infofarmer@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.239]) by mx1.freebsd.org (Postfix) with ESMTP id DEB5B13C4B9 for ; Thu, 18 Jan 2007 14:43:16 +0000 (UTC) (envelope-from infofarmer@gmail.com) Received: by wr-out-0506.google.com with SMTP id 71so185572wri for ; Thu, 18 Jan 2007 06:43:16 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=CM1ZIaHEYDletkS0zFuIe+I8fm0u9eDLBCxKg8jYWWaOvSKfhUt7k9ZGxhs6swPi3MEndBljtQoGf32EPB0e7dD1g3Om439HGVLSfb/vpujdjDgzOdVBLzM6vemZx3Wj+dUp8uyNSdT7ch1w+0oFUNDkkst99dzd7jawPH1UXrA= Received: by 10.78.123.4 with SMTP id v4mr839939huc.1169129689470; Thu, 18 Jan 2007 06:14:49 -0800 (PST) Received: by 10.78.164.20 with HTTP; Thu, 18 Jan 2007 06:14:49 -0800 (PST) Message-ID: Date: Thu, 18 Jan 2007 17:14:49 +0300 From: "Andrew Pantyukhin" Sender: infofarmer@gmail.com To: "Craig Rodrigues" In-Reply-To: <20070118134936.GA7391@crodrigues.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070118134936.GA7391@crodrigues.org> X-Google-Sender-Auth: 5fe0465356a9b5cb Cc: freebsd-current@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [RFC] mount(8) can figure out fstype X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2007 14:43:17 -0000 On 1/18/07, Craig Rodrigues wrote: > Hi, > > This is a different version of the patch I posted here: > http://lists.freebsd.org/pipermail/freebsd-arch/2006-July/005439.html > > 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. > > In this patch, I only modified the userland mount program. > If the user does not specify "-t vfstype" to mount, > the mount program gets a list of local filesystems from the vfs.conflist > sysctl. It then tries to mount the filesystem, always > starting with "ufs", and then iterating through the list if > the nmount() fails with EINVAL. > > Using this patch, I have been able to do: > mount /dev/blah /mnt > > and mount a UFS, cd9660, or FAT filesystem, depending on what filesystem > is on the /dev/blah device. > > Comments? I would love to have this usability enhancement around! 1. Are there any (what are the) security implications? 2. "mount -t auto" might be closer to POLA I might have other comments later :) Thanks Craig!