Skip to contentSkip to conversation

Filesystem specific mount options mixed with auto fs type

DISCUSSION Phillip Susi 3 participants 8 messages Oct 10, 2013 – Oct 11, 2013 Util-Linux package

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I came across an old bug report where the user had set the utf8 mount option in /etc/fstab on a floppy, presumably to apply to a fat filesystem, but when a disk formatted with ext2 was used, the mount failed sine ext2 doesn't support this option.

That got me wondering, how are you supposed to specify mount options with the auto fs type? Certainly you don't just have to limit the options to ones that are universal to all filesystems? But how to specify that these options are for fs A, and these for fs B?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEbBAEBAgAGBQJSVrfPAAoJEJrBOlT6nu75SeEH+KPG9gTtbp7tkrbOtgKNRi7l W3sGIRMBKh47Ddl9AaX1K3gANVedcAQ5chPtCH6ANGXung2RSOkUDFfeZQsWe59C gyuhwUwxH6NHq/4k0NR4IS0pUjRtiM1uwLL9VyYiDHr+Nx/edoMPiHRlo4c/M8oA iYm2EEbHG147tfoZQ0cSUurdF4Hnh+mnVgWMt6/jcaL7AQTcZwY72GIHIrUMq/r5 dkwMiXF46GUxUGa8ToDbZWETbuToFv+wlL0+K8JDZaUvuYjKzdhawuM6Jb73kCtJ 1whHnnCQnzHm08fhB38kTDuCMOSVICU0FqQjtYY8c9nLI6fLL/+r9g2ycN+sqA== =/BVh
-----END PGP SIGNATURE-----

#1 lore raw
Quoted 10 lines · Phillip Susi

I came across an old bug report where the user had set the utf8 mount option in /etc/fstab on a floppy, presumably to apply to a fat filesystem, but when a disk formatted with ext2 was used, the mount failed sine ext2 doesn't support this option.

That got me wondering, how are you supposed to specify mount options with the auto fs type? Certainly you don't just have to limit the options to ones that are universal to all filesystems? But how to specify that these options are for fs A, and these for fs B?

AFAIK "mount -s" is just for that case:

- man mount -
-s Tolerate sloppy mount options rather than failing. This will
ignore mount options not supported by a filesystem type. Not all filesystems support this option. This option exists for support of the Linux autofs-based automounter.
- man mount -

Signature · 1 line
Matthias
#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 6 lines · Matthias Schniedermeyer

AFAIK "mount -s" is just for that case:

- man mount - -s Tolerate sloppy mount options rather than failing. This will ignore mount options not supported by a filesystem type. Not all filesystems support this option. This option exists for support of the Linux autofs-based automounter. - man mount -

This doesn't seem to actually work. Trying to mount an ext2 fs with the utf8 option still fails with an unknown option error.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSVuPqAAoJEJrBOlT6nu75svUH/0zi7revng47Q7PUWkV7g1qq nMqwYyRYlC2txaBoote53gKxGoRuppvp43f2IvrMgGNTpnwPgoJdGKHSPA/wW7b6 5jzLanmozlWBvmEOOZD9HLR1RYmb/sexQAaRL99zHy5q2Bk9L+81fDp0AsK8lnNl rHn3CJ1iKGLTTcB0CSvjayrs7r1zdIRNF31NVgV83CN9LaMdrtYGuY8bLgi9+3RF aedqpR9PZztXPhf3lQz1CR/EToJO6fDX2IxJ0KuThCtUvT1aq1r++eJTNjHgp2mm iwGj/b4GeEMYKtyIdzp4RPOjLL4LvuhKL2SKw6TytDiOwfzBCp5WDIJod6KA1WA= =XX4w
-----END PGP SIGNATURE-----

maintainer
#3 lore raw
Quoted 6 lines · Phillip Susi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 2 lines · Matthias Schniedermeyer

AFAIK "mount -s" is just for that case:

Quoted 7 lines
Quoted 4 lines

- man mount - -s Tolerate sloppy mount options rather than failing. This will ignore mount options not supported by a filesystem type. Not all filesystems support this option. This option exists for support of the Linux autofs-based automounter. - man mount -

This doesn't seem to actually work. Trying to mount an ext2 fs with the utf8 option still fails with an unknown option error.

"sloppy" is userspace command line option and I guess it was introduced for NFS (nfs4, nfs, ...) and if I good remember nothing else uses this option.

There is also "silent" (MS_SILENT) kernel mount flag, but it's usually used to avoid unwanted printk() when superblok not found.

Notes:

* the "auto" fs type is usually used with generic mount options or with no options at all ("default" options)

* well designed filesystems allows to save the filesystem specific options to the FS superblock by some tune util (e.g. tune2fs)

* for removable media users usually use udisks based solutions

* mount by FS identifier

        LABEL=FOO       /mnt/floppy     vfat    utf8
        LABEL=BAR       /mnt/floppy     ext2    default

and then "mount LABEL= ... "

* for example NFS has nfsmount.conf where you can specify additional options, but I don't think it's a good idea to introduce this for all filesystems

Maybe we can improve mount(8) to test all entries from /etc/fstab with the same mountpoint (if you want to mount-by-mountpoint) until the filesystem will be mounted successfully. But I have doubts that we really need to resolve this very old disadvantage.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#4 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 2 lines · Karel Zak

* well designed filesystems allows to save the filesystem specific options to the FS superblock by some tune util (e.g. tune2fs)

Unfortunately, fat isn't well designed.

Quoted 1 line

* for removable media users usually use udisks based solutions

That works as long as udisks picks the defaults they want, but then if they want a non default mount option ( or location ), they have to specify it in fstab.

Quoted 4 lines

* mount by FS identifier

LABEL=FOO /mnt/floppy vfat utf8 LABEL=BAR
/mnt/floppy ext2 default

That ties it to the specific volume.

Quoted 4 lines

Maybe we can improve mount(8) to test all entries from /etc/fstab with the same mountpoint (if you want to mount-by-mountpoint) until the filesystem will be mounted successfully. But I have doubts that we really need to resolve this very old disadvantage.

Maybe something like:

/dev/fd0 /mnt/floppy auto,vfat utf8
/dev/fd0 /mnt/floppy auto generic-options

The auto would trigger blkid to identify the filesystem, and then only if it matches one of the additional listed filesystems would that line be applied.

I suppose that would also require changing other utilities like udisks to understand it?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSWADrAAoJEJrBOlT6nu75bRYIAKF5CFzLr8hChG6+VoFvWSMY 1O5W8unfYSL4JH86OVuj14w9LaWWxbYaIwzhbAXp5X9Y96ZLXPNxcHaytyoBSmYg xfDNpgj/Nm6Y8Zg2LM+qwFi+oO4qOb8RetD0uxz3uVBzxVC/PoV4W3AwoCsK3bQ9 xGjxDpMSi9lq3jA/pa8TtJnkUC8cL8vX8AWrGcSd/bBtxVZjM/mpxn4UhoBLSfOE ICGijygUP+NUbZ7yvBb5LE2B0nqaXlpg8qqrGENhJuUGchhyd45MASzOP+I1030H AgpMKgfg85qVneRiKl+/PmKKhrefqBkBbrWhXzjCpMNJH7H/BdupOIS+0DfQ/MI= =QAmw
-----END PGP SIGNATURE-----

maintainer
#5 lore raw
Quoted 8 lines · Phillip Susi
Quoted 4 lines

Maybe we can improve mount(8) to test all entries from /etc/fstab with the same mountpoint (if you want to mount-by-mountpoint) until the filesystem will be mounted successfully. But I have doubts that we really need to resolve this very old disadvantage.

Maybe something like:

/dev/fd0 /mnt/floppy auto,vfat utf8

                       ^^^^^^^^^

This is unacceptable, fstab is de-facto standard. We have to be backwardly compatible.

Quoted 5 lines

/dev/fd0 /mnt/floppy auto generic-options

The auto would trigger blkid to identify the filesystem, and then only if it matches one of the additional listed filesystems would that line be applied.

I thought something like:

        /dev/fd0 /mnt/floppy    vfat    utf8
        /dev/fd0 /mnt/floppy    auto    default

and then try in loop all the filesystem types for the mountpoint (or make it smart and ask blkid for the type).

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#6 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 7 lines · Karel Zak

I thought something like:

/dev/fd0 /mnt/floppy vfat utf8 /dev/fd0 /mnt/floppy auto
default

and then try in loop all the filesystem types for the mountpoint (or make it smart and ask blkid for the type).

What would this do to other utilities? Would this confuse udisks or systemd or upstart's mountall?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSWA35AAoJEJrBOlT6nu75d/cH/Rqe9m5Ttw1hdnG9+e636vkE YNBxfBnJKV2Ob7YywnxZdIxO/fj5YCnydW+68YDR0+okJAO2p0PPPzyRhHJw+H5T lohuBuRKfeRTuDwEKfAeIsAIOji9ed5BwHUOH2A+abd/fysiyG+ZTuet8vuXBv/Y 3Rzjh5jvkYBT+gwY9aiBoA69ChHsU9HKLQGJXd7S/UDmshqNYxhH7n3kDFiNxU3m tzoQdSIDYRk4VTKrRp0X5kF6OtQnW7askF6RYWrMJnOYInGPFQ+WKVftx3sgw/OW vNmKR1zrVBD+DpYSzzgG95SUQVlnoL4eZr7Ri20HQpT+bSj8opPd9IFffMX8hws= =dA7m
-----END PGP SIGNATURE-----

maintainer
#7 lore raw
In reply to Phillip Susi
Quoted 3 lines · Phillip Susi

Maybe something like:

/dev/fd0 /mnt/floppy auto,vfat utf8

                       ^^^^^^^^

Note that I wasn't right in the previous email, the list of the fs-types in fstab is also supported by mount(8), but it's very rarely used (in last 10 years a remember only one report with this setup). It works like "-t fs1,fs2" on mount(8) command line.

I have doubts that anything else than mount(8) support this syntax.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com