Quoting from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=506695 :

according to mount(8), mount tries to guess a filesystem type when given
fstype `auto' and it tries multiple filesystems if a list of fstypes is
given.

A single fstype `auto' works as expected:
        mount -t auto /dev/sde /media/stick
mounts /dev/sde as vfat, which is correct.
However, merging `auto' with other types doesn't work as expected:
        mount -t ext2,auto /dev/sde /media/stick
does not mount /dev/sde but returns:
        mount: unknown filesystem type 'auto'

Trying multiple fstypes before allowing mount to guess makes sense in
different scenarios, for example to prefer specific fstypes (ext2
instead of ext3) or to try fstypes that mount doesn't guess (minix).
I'm not sure if the Debian installer still sets CDROM fstab entries to
`udf,iso9660,auto' but I remember it did once. This wouldn't work then
either.

Reported-by: "Mario 'BitKoenig' Holbe" <mario.ho...@tu-ilmenau.de>
Signed-off-by: Andreas Henriksson <andr...@fatal.se>
---
 libmount/src/context_mount.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
index dcfdabf..d07fa02 100644
--- a/libmount/src/context_mount.c
+++ b/libmount/src/context_mount.c
@@ -782,6 +782,8 @@ static int do_mount_by_pattern(struct libmnt_context *cxt, 
const char *pattern)
                        char *end = strchr(p, ',');
                        if (end)
                                *end = '\0';
+                       if (strcmp(p, "auto") == 0)
+                               p = NULL;
                        rc = do_mount(cxt, p);
                        p = end ? end + 1 : NULL;
 
-- 
2.0.0


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to