Date: Sat, 08 Jul 2006 10:38:40 -0700 From: Sam Leffler <sam@errno.com> To: Craig Rodrigues <rodrigc@crodrigues.org> Cc: freebsd-current@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [RFC] mount can figure out fstype automatically Message-ID: <44AFEDA0.7040308@errno.com> In-Reply-To: <20060708161719.GB3871@crodrigues.org> References: <20060708152801.GA3671@crodrigues.org> <44AFD7DF.8090002@errno.com> <20060708161719.GB3871@crodrigues.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 "". Oh, I stupidly assumed "auto" meant something similar to what you were doing :) > >> 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. I wouldn't expect a program like mount to fork+exec file; I'd expect it to either read directly or use a kernel facility. Sounds like something is missing to do this right. Sam
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44AFEDA0.7040308>