Re: mount error message

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

 



On Sun, Sep 07, 2014 at 01:19:05PM -0500, Bruce Dubbs wrote:
> I have a user that complains that mount is giving an incorrect error message
> under some circumstances.  For instance if mtab is symlinked to
> /proc/self/mounts the command and /run is not in fstab:
> 
> $ mount /run
> 
> returns an error message:
> 
>   mount: /run: No such file or directory
> 
> However if mtab is a regular file, the error message is:
> 
>   mount: can't find /run in /etc/fstab


$ test -d /mnt/test && echo "yes" || echo "no"
yes
$ test -d /nothing && echo "yes" || echo "no"
no


$ ls -l  /etc/mtab 
lrwxrwxrwx 1 root root 12 Jun 17 15:42 /etc/mtab -> /proc/mounts

$ mount /mnt/test
mount: can't find /mnt/test in /etc/fstab

$ mount /nothing
mount: /nothing: No such file or directory


$ ls -l  /etc/mtab 
-r--r--r-- 1 root root 2693 Sep 10 10:16 /etc/mtab

$ mount /mnt/test
mount: can't find /mnt/test in /etc/fstab
$ mount /nothing 
mount: /nothing: No such file or directory


All works as expected.

Note that mount(8) sanitize paths specified by non-root users on
command line, so the message "No such file or directory" is really
expected and it's far before libmount starts to evaluate things in
mtab/fstab.

    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