"mount" may fail when more than one file system type is specified, and the
requested access mode is read/write, but the device is read-only. The error
message is: "mount: wrong fs type, bad option, bad superblock on...".
It works only if the correct file system type is the last item in the comma
separated list. This is because when it tries to mount the file system again
in read-only mode, the "types" parameter passed to the "try_mount_one"
function contains only the last item instead of the entire list.
For example, you cannot mount a UDF CD/DVD with "-t udf,iso9660" if you
don't also add the read-only option. This means that some Linux distributions
with the default configuration may not be able to mount UDF disks
automatically (e.g. Ubuntu Dapper - Gutsy Tribe 3).
Signed-off-by: Attila Áfra <attila.afra@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
bd, spec);
break;
} else {
- if (loop) {
- opts = opts0;
- types = types0;
- }
+ opts = opts0;
+ types = types0;
+
if (opts) {
char *opts2 = append_opt(xstrdup(opts), "ro", NULL);
my_free(opts1);