Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jan 2007 17:14:49 +0300
From:      "Andrew Pantyukhin" <infofarmer@FreeBSD.org>
To:        "Craig Rodrigues" <rodrigc@crodrigues.org>
Cc:        freebsd-current@freebsd.org, freebsd-arch@freebsd.org
Subject:   Re: [RFC] mount(8) can figure out fstype
Message-ID:  <cb5206420701180614n3eb5bb6cla6c9fdf9ee6f1a9@mail.gmail.com>
In-Reply-To: <20070118134936.GA7391@crodrigues.org>
References:  <20070118134936.GA7391@crodrigues.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 1/18/07, Craig Rodrigues <rodrigc@crodrigues.org> 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!



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?cb5206420701180614n3eb5bb6cla6c9fdf9ee6f1a9>