Linux-CIFS Archive on lore.kernel.org
 help / color / Atom feed
* Proper mounting Windows DFS Namespace in Linux / Object is remote
@ 2020-03-02  7:49 Mathieu Malaterre
       [not found] ` <CAH2r5mtd-WbXbTG6bgT9EfZyXCC2Qr-TB8QszOy+oFRu5CrerQ@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Mathieu Malaterre @ 2020-03-02  7:49 UTC (permalink / raw)
  To: linux-cifs

I am struggling to mount a remote CIFS directory on a Ubuntu system at
work. The remote folder appears to be working just fine from my
Windows 8.1 session (also at work).

I could not get normal mounting to work:

    $ sudo mount -v -t cifs //1.2.3.4/network ~/z -o
username=malat,domain=MY,uid=$(id -u),gid=$(id -g),iocharset=utf8
    Password for malat@//1.2.3.4/network:  *********
    mount.cifs kernel mount options:
ip=1.2.3.4,unc=\\1.2.3.4\network,iocharset=utf8,uid=1002,gid=1002,user=mmalaterre,domain=MY,pass=********
    mount error(2): No such file or directory
    Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

But I eventually stumble upon this ref[1]:

    $ sudo mount -v -t cifs //1.2.3.4/network ~/z -o
username=malat,domain=MY,uid=$(id -u),gid=$(id
-g),iocharset=utf8,nodfs
    Password for malat@//1.2.3.4/network:  *********
    mount.cifs kernel mount options:
ip=1.2.3.4,unc=\\1.2.3.4\network,iocharset=utf8,nodfs,uid=1002,gid=1002,user=malat,domain=MY,pass=********

At least I have something working now, so AFAIK the option 'nodfs' is
a required option for me:

    $ mount | grep network
    //1.2.3.4/network on /home/malat/z type cifs
(rw,relatime,vers=2.1,cache=strict,username=malat,domain=MY,uid=1002,forceuid,gid=1002,forcegid,addr=1.2.3.4,file_mode=0755,dir_mode=0755,soft,nounix,nodfs,mapposix,rsize=1048576,wsize=1048576,bsize=1048576,echo_interval=60,actimeo=1)

However there seems to be something not working (related to 'nodfs'
option I guess). Here are the symptoms:

    $ cd ~/z
    $ ls
    folder1 folder2
    $ ls folder1
    subfolder1
    $ ls folder2
    ls: cannot access 'folder2': Invalid argument

If I add `vers=1.0` to the mount command, the symptoms are slightly different:

    $ cd ~/z
    $ cd folder2
    $ ls
    subfolder2
    $ cd subfolder2/
    bash: cd: subfolder2/: Object is remote

I can access the folder `folder2` just fine from my Windows 8.1
session, so this is not a permission issue.

For instance I have a work around : use the DFS Referral list. So from
my windows box I navigate to the problematic "subfolder2" (symlink
icon), right click get the properties (third tab is named 'DFS'), then
go back to my Linux session, and mount using instead:

    $ sudo mount -t cifs //xyzclus01-cifs.mydoma.acme.corp/Disk12
~/disk12 -v -o username=malat,domain=MY,uid=$(id -u),gid=$(id
-g),iocharset=utf8,nodfs,vers=1.0
    Password for malat@//xyzclus01-cifs.mydoma.acme.corp/Disk12:  *********
    mount.cifs kernel mount options:
ip=5.6.7.8,unc=\\xyzclus01-cifs.mydoma.acme.corp\Disk12,iocharset=utf8,nodfs,vers=1.0,uid=1002,gid=1002,user=malat,domain=MY,pass=********
    $ cd folder2/subfolder2/

I can (finally!) access the content of subfolder2. This is quite
cumbersome and counter-intuitive. So this qualify at best as
work-around and not as real solution.

How can I access `folder2` from my Linux session ? Or at least how can
I find the magic value "//xyzclus01-cifs.mydoma.acme.corp/Disk12"
directly from my running Linux system ?

---

For reference:

Here is the tail of `dmesg`:

    [1927958.534353] CIFS: Attempting to mount //1.2.3.4/network
    [1927958.534403] No dialect specified on mount. Default has
changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from
CIFS (SMB1). To use the less secure SMB1 dialect to access old servers
which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
    [1927960.069018] CIFS VFS: DFS capability contradicts DFS flag
    [1927960.375111] CIFS VFS: Autodisabling the use of server inode
numbers on new server.
    [1927960.375115] CIFS VFS: The server doesn't seem to support them
properly or the files might be on different servers (DFS).
    [1927960.375117] CIFS VFS: Hardlinks will not be recognized on
this mount. Consider mounting with the "noserverino" option to silence
this message.

    $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 19.04
    Release:        19.04
    Codename:       disco

kernel version:

    $ uname -rvo
    5.0.0-38-generic #41-Ubuntu SMP Tue Dec 3 00:27:35 UTC 2019 GNU/Linux

and

    $ cat /etc/request-key.d/cifs.spnego.conf
    create  cifs.spnego    * * /usr/sbin/cifs.upcall %k

  [1]: https://unix.stackexchange.com/questions/164037/mount-cifs-error2-no-such-file-or-directory-when-using-a-prefixpath

-- 
Mathieu

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Proper mounting Windows DFS Namespace in Linux / Object is remote
       [not found] ` <CAH2r5mtd-WbXbTG6bgT9EfZyXCC2Qr-TB8QszOy+oFRu5CrerQ@mail.gmail.com>
@ 2020-03-03  7:25   ` Mathieu Malaterre
  2020-03-06 13:58   ` Mathieu Malaterre
  1 sibling, 0 replies; 4+ messages in thread
From: Mathieu Malaterre @ 2020-03-03  7:25 UTC (permalink / raw)
  To: Steve French; +Cc: CIFS, Paulo Alcantara

Well not on that specific system. I'll install a newer ubuntu under
virtualbox and give it a try at least for the curiosity.

On Mon, Mar 2, 2020 at 10:12 PM Steve French <smfrench@gmail.com> wrote:
>
> Can you try an experiment with Ubuntu's newer kernel:
>
> https://wiki.ubuntu.com/Kernel/MainlineBuilds
> Or
>
> https://github.com/pimlie/ubuntu-mainline-kernel.sh
>
> On Mon, Mar 2, 2020, 01:50 Mathieu Malaterre <mathieu.malaterre@gmail.com> wrote:
>>
>> I am struggling to mount a remote CIFS directory on a Ubuntu system at
>> work. The remote folder appears to be working just fine from my
>> Windows 8.1 session (also at work).
>>
>> I could not get normal mounting to work:
>>
>>     $ sudo mount -v -t cifs //1.2.3.4/network ~/z -o
>> username=malat,domain=MY,uid=$(id -u),gid=$(id -g),iocharset=utf8
>>     Password for malat@//1.2.3.4/network:  *********
>>     mount.cifs kernel mount options:
>> ip=1.2.3.4,unc=\\1.2.3.4\network,iocharset=utf8,uid=1002,gid=1002,user=mmalaterre,domain=MY,pass=********
>>     mount error(2): No such file or directory
>>     Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
>>
>> But I eventually stumble upon this ref[1]:
>>
>>     $ sudo mount -v -t cifs //1.2.3.4/network ~/z -o
>> username=malat,domain=MY,uid=$(id -u),gid=$(id
>> -g),iocharset=utf8,nodfs
>>     Password for malat@//1.2.3.4/network:  *********
>>     mount.cifs kernel mount options:
>> ip=1.2.3.4,unc=\\1.2.3.4\network,iocharset=utf8,nodfs,uid=1002,gid=1002,user=malat,domain=MY,pass=********
>>
>> At least I have something working now, so AFAIK the option 'nodfs' is
>> a required option for me:
>>
>>     $ mount | grep network
>>     //1.2.3.4/network on /home/malat/z type cifs
>> (rw,relatime,vers=2.1,cache=strict,username=malat,domain=MY,uid=1002,forceuid,gid=1002,forcegid,addr=1.2.3.4,file_mode=0755,dir_mode=0755,soft,nounix,nodfs,mapposix,rsize=1048576,wsize=1048576,bsize=1048576,echo_interval=60,actimeo=1)
>>
>> However there seems to be something not working (related to 'nodfs'
>> option I guess). Here are the symptoms:
>>
>>     $ cd ~/z
>>     $ ls
>>     folder1 folder2
>>     $ ls folder1
>>     subfolder1
>>     $ ls folder2
>>     ls: cannot access 'folder2': Invalid argument
>>
>> If I add `vers=1.0` to the mount command, the symptoms are slightly different:
>>
>>     $ cd ~/z
>>     $ cd folder2
>>     $ ls
>>     subfolder2
>>     $ cd subfolder2/
>>     bash: cd: subfolder2/: Object is remote
>>
>> I can access the folder `folder2` just fine from my Windows 8.1
>> session, so this is not a permission issue.
>>
>> For instance I have a work around : use the DFS Referral list. So from
>> my windows box I navigate to the problematic "subfolder2" (symlink
>> icon), right click get the properties (third tab is named 'DFS'), then
>> go back to my Linux session, and mount using instead:
>>
>>     $ sudo mount -t cifs //xyzclus01-cifs.mydoma.acme.corp/Disk12
>> ~/disk12 -v -o username=malat,domain=MY,uid=$(id -u),gid=$(id
>> -g),iocharset=utf8,nodfs,vers=1.0
>>     Password for malat@//xyzclus01-cifs.mydoma.acme.corp/Disk12:  *********
>>     mount.cifs kernel mount options:
>> ip=5.6.7.8,unc=\\xyzclus01-cifs.mydoma.acme.corp\Disk12,iocharset=utf8,nodfs,vers=1.0,uid=1002,gid=1002,user=malat,domain=MY,pass=********
>>     $ cd folder2/subfolder2/
>>
>> I can (finally!) access the content of subfolder2. This is quite
>> cumbersome and counter-intuitive. So this qualify at best as
>> work-around and not as real solution.
>>
>> How can I access `folder2` from my Linux session ? Or at least how can
>> I find the magic value "//xyzclus01-cifs.mydoma.acme.corp/Disk12"
>> directly from my running Linux system ?
>>
>> ---
>>
>> For reference:
>>
>> Here is the tail of `dmesg`:
>>
>>     [1927958.534353] CIFS: Attempting to mount //1.2.3.4/network
>>     [1927958.534403] No dialect specified on mount. Default has
>> changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from
>> CIFS (SMB1). To use the less secure SMB1 dialect to access old servers
>> which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
>>     [1927960.069018] CIFS VFS: DFS capability contradicts DFS flag
>>     [1927960.375111] CIFS VFS: Autodisabling the use of server inode
>> numbers on new server.
>>     [1927960.375115] CIFS VFS: The server doesn't seem to support them
>> properly or the files might be on different servers (DFS).
>>     [1927960.375117] CIFS VFS: Hardlinks will not be recognized on
>> this mount. Consider mounting with the "noserverino" option to silence
>> this message.
>>
>>     $ lsb_release -a
>>     No LSB modules are available.
>>     Distributor ID: Ubuntu
>>     Description:    Ubuntu 19.04
>>     Release:        19.04
>>     Codename:       disco
>>
>> kernel version:
>>
>>     $ uname -rvo
>>     5.0.0-38-generic #41-Ubuntu SMP Tue Dec 3 00:27:35 UTC 2019 GNU/Linux
>>
>> and
>>
>>     $ cat /etc/request-key.d/cifs.spnego.conf
>>     create  cifs.spnego    * * /usr/sbin/cifs.upcall %k
>>
>>   [1]: https://unix.stackexchange.com/questions/164037/mount-cifs-error2-no-such-file-or-directory-when-using-a-prefixpath
>>
>> --
>> Mathieu



-- 
Mathieu

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Proper mounting Windows DFS Namespace in Linux / Object is remote
       [not found] ` <CAH2r5mtd-WbXbTG6bgT9EfZyXCC2Qr-TB8QszOy+oFRu5CrerQ@mail.gmail.com>
  2020-03-03  7:25   ` Mathieu Malaterre
@ 2020-03-06 13:58   ` Mathieu Malaterre
  2020-03-09 10:10     ` Mathieu Malaterre
  1 sibling, 1 reply; 4+ messages in thread
From: Mathieu Malaterre @ 2020-03-06 13:58 UTC (permalink / raw)
  To: Steve French; +Cc: CIFS, Paulo Alcantara

Steve,

On Mon, Mar 2, 2020 at 10:12 PM Steve French <smfrench@gmail.com> wrote:
>
> Can you try an experiment with Ubuntu's newer kernel:
>
> https://wiki.ubuntu.com/Kernel/MainlineBuilds
> Or
>
> https://github.com/pimlie/ubuntu-mainline-kernel.sh

I picked latest Debian bullseye installer. Here is what I have:

$ uname -rvo
5.4.0-4-amd64 #1 SMP Debian 5.4.19-1 (2020-02-13) GNU/Linux

I am observing the same behavior with regard to 'nodfs' option. I am
required to use this option to get the first mount working.

$ mount
[...]
//mydoma01.acme.corp/network on /tmp/z type cifs
(rw,relatime,vers=default,cache=strict,username=mmalaterre,domain=MY,uid=0,noforceuid,gid=0,noforcegid,addr=1.2.3.4,file_mode=0755,dir_mode=0755,soft,nounix,nodfs,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1)

For some reason I am getting vers=1.0 behavior (described previously):

    $ cd /tmp/z
    $ cd folder2
    $ ls
    subfolder2
    $ cd subfolder2/
    bash: cd: subfolder2/: Object is remote

Ref:

$ apt-cache policy cifs-utils
cifs-utils:
  Installed: 2:6.9-1
  Candidate: 2:6.9-1
  Version table:
 *** 2:6.9-1 500
        500 http://deb.debian.org/debian bullseye/main amd64 Packages
        100 /var/lib/dpkg/status

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Proper mounting Windows DFS Namespace in Linux / Object is remote
  2020-03-06 13:58   ` Mathieu Malaterre
@ 2020-03-09 10:10     ` Mathieu Malaterre
  0 siblings, 0 replies; 4+ messages in thread
From: Mathieu Malaterre @ 2020-03-09 10:10 UTC (permalink / raw)
  To: Steve French; +Cc: CIFS, Paulo Alcantara

On Fri, Mar 6, 2020 at 2:58 PM Mathieu Malaterre
<mathieu.malaterre@gmail.com> wrote:
>
> Steve,
>
> On Mon, Mar 2, 2020 at 10:12 PM Steve French <smfrench@gmail.com> wrote:
> >
> > Can you try an experiment with Ubuntu's newer kernel:
> >
> > https://wiki.ubuntu.com/Kernel/MainlineBuilds
> > Or
> >
> > https://github.com/pimlie/ubuntu-mainline-kernel.sh
>
> I picked latest Debian bullseye installer. Here is what I have:
>
> $ uname -rvo
> 5.4.0-4-amd64 #1 SMP Debian 5.4.19-1 (2020-02-13) GNU/Linux
>
> I am observing the same behavior with regard to 'nodfs' option. I am
> required to use this option to get the first mount working.
>
> $ mount
> [...]
> //mydoma01.acme.corp/network on /tmp/z type cifs
> (rw,relatime,vers=default,cache=strict,username=mmalaterre,domain=MY,uid=0,noforceuid,gid=0,noforcegid,addr=1.2.3.4,file_mode=0755,dir_mode=0755,soft,nounix,nodfs,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1)
>
> For some reason I am getting vers=1.0 behavior (described previously):
>
>     $ cd /tmp/z
>     $ cd folder2
>     $ ls
>     subfolder2
>     $ cd subfolder2/
>     bash: cd: subfolder2/: Object is remote
>
> Ref:
>
> $ apt-cache policy cifs-utils
> cifs-utils:
>   Installed: 2:6.9-1
>   Candidate: 2:6.9-1
>   Version table:
>  *** 2:6.9-1 500
>         500 http://deb.debian.org/debian bullseye/main amd64 Packages
>         100 /var/lib/dpkg/status

I eventually stumble upon:

* https://wiki.samba.org/index.php/LinuxCIFS_troubleshooting

Which gave me a more verbose error log I found out that:

[...]
[  687.037593] fs/cifs/dns_resolve.c: dns_resolve_server_name_to_ip:
unable to resolve: MYSERV13
[  687.037606] fs/cifs/cifs_dfs_ref.c: cifs_compose_mount_options:
Failed to resolve server part of //MYSERV13/network to IP: -2
[...]

Updating my resolve.conf from:

search acme.corp

to:

search acme.corp mydoma01.acme.corp

I was finally able to call mount -t cifs without the 'nodfs' option.
The symptoms are no longer an error and simply informative:

$ cd subfolder2
CIFS VFS: BAD_NETWORK_NAME: \\MYSERV13\network
[...]

I can finally access the content of subfolder2 without issue.

-- 
Mathieu

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-02  7:49 Proper mounting Windows DFS Namespace in Linux / Object is remote Mathieu Malaterre
     [not found] ` <CAH2r5mtd-WbXbTG6bgT9EfZyXCC2Qr-TB8QszOy+oFRu5CrerQ@mail.gmail.com>
2020-03-03  7:25   ` Mathieu Malaterre
2020-03-06 13:58   ` Mathieu Malaterre
2020-03-09 10:10     ` Mathieu Malaterre

Linux-CIFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-cifs/0 linux-cifs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-cifs linux-cifs/ https://lore.kernel.org/linux-cifs \
		linux-cifs@vger.kernel.org
	public-inbox-index linux-cifs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-cifs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git