Re: [PATCH] libmount: special treatment for auto in fstype pattern

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jun 22, 2014 at 09:44:50PM +0200, Andreas Henriksson wrote:
> 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'

 Interesting use case.

> 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 hope libblkid is able to detect minix ;-)

> 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);

 This is insufficient solution, the code has to call an FS detection
 code. I have applied a little different solution.

 Thanks!

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux