Re: [RFC] mount(8) can figure out fstype



On Thu, Jan 18, 2007 at 04:15:00PM +0100, Dag-Erling Smrgrav wrote:
Didn't somebody mention ordering issues back then? Your revised patch
still doesn't even try to address those. If we ever get ext3 support,
for instance, mounting an ext2 file system as ext3 might cause it to
be silently upgraded to ext3.

Since FreeBSD doesn't have any ext3 support right now, I think a more concrete
example of ordering issues is to look at cd9660 vs. udf, which FreeBSD
currently supports. In my patch, the mount_fs_try() function
does deal with one ordering issue.....no matter what is in the
vfs.conflist sysctl, it always tries to mount "ufs" first. This approximates
the existing mount(8) behavior. It would not be hard to modify
mount_fs_try() to deal with ordering of ext3 vs. ext2, udf vs. cd9660,
or whatever. Not the most elegant solution, but workable for
the limited subset of file systems that FreeBSD supports.

Not to mention the slew of error messages this will result in as you
walk the list of filesystems trying to find the right one...

This is true, but in my tests, the "slew of error messages" is not too bad.
Also, with my patch, if you specify the "-t" parameter, mount_fs_try()
is not used, so things like mounting via /etc/fstab, where the fstype
is specified, will behave the same way as now, and not iterate through
a list of file systems.

A better way would be to have a userland utility attempt to identify
the file system, and if necessary load the appropriate module, before
mounting it.

I disagree. To go down this road, instead of a separate utility,
I think the best approach would be to put all this logic inside mount(8),
the way Linux does, as Christoph Hellwig mentioned here:
http://lists.freebsd.org/pipermail/freebsd-arch/2006-July/005447.html

I've looked at the Linux mount utility source.....it maintains a table
of magic numbers and offsets and tries them in a well defined order.
The logic is quite involved, but it does work. The Linux code
is under GPL though....

The other suggestion that someone had was to use libmagic in mount(8).
libmagic is good, but using it in mount(8) would introduce link dependencies on
libmagic and libz, and also introduce dependencies on files in
/usr/share/misc/magic.

--
Craig Rodrigues
rodrigc@xxxxxxxxxxxxxx
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: [RFC] mount(8) can figure out fstype
    ... If we ever get ext3 support, ... mounting an ext2 file system as ext3 might cause it to ... is not used, so things like mounting via /etc/fstab, where the fstype ... the file system, and if necessary load the appropriate module, before ...
    (freebsd-current)
  • How to convert ext2 -> ext3
    ... How do I convert an ext2 file system to ext3? ... I just put a new disk in a PII machine, and when I got to the ...
    (Fedora)
  • Re: [RFC] mount(8) can figure out fstype
    ... Your revised patch ... If we ever get ext3 support, ... mounting an ext2 file system as ext3 might cause it to ... the file system, and if necessary load the appropriate module, before ...
    (freebsd-arch)
  • Re: [RFC] mount(8) can figure out fstype
    ... Your revised patch ... If we ever get ext3 support, ... mounting an ext2 file system as ext3 might cause it to ... the file system, and if necessary load the appropriate module, before ...
    (freebsd-current)
  • Re: want to speed up laptop
    ... Nearly hit all points on my laptop, ext3 plus ... But I'm not good at tuning the file system. ... There are several factors which combine to hurt overall disk ... Assuming the laptop is reliable, ...
    (Debian-User)