Is that possible follow symbol link location which point with full location

Steve French smfrench at gmail.com
Mon Aug 29 16:20:11 UTC 2016


Do you want the Linux client to follow a DFS-like link in a Windows symlink?

It seems like a conflation of distinct types of reparse points (the
Windows link or junction and DFS).

But the obvious question though is - does it work from Windows (or
Mac) client to Windows server (ie creating a link from a local path to
a UNC name that is not in a DFS junction but rather an NTFS link)?

(and adding samba-technical to the cc: )

On Mon, Aug 29, 2016 at 11:04 AM, Cong Monkey <congzhangzh at gmail.com> wrote:
> Thanks for your reply, but as cm use this technology for file symbol link
> and directory symbol link, it's very hard to change.
>
> Maybe I can use a Windows client work as SSH server and then use sshfs on
> Linux side?
>
>
> 2016年8月29日 23:57,"Steve French" <smfrench at gmail.com>写道:
>
> It sounds like you should be using DFS, and a tool like dfscmd (or
> equivalent) not mklink to create this type of reparse point on
> Windows.   The linux client will recognize links to UNC names if
> created with the DFS tools.
>
> Creating a link (e.g. with mklink) on the Windows server side only
> makes sense for relative paths (unless the server is following the
> paths and hiding the existence of the link) since absolute paths (e.g.
> mapping a link to "c:\users\test\target") only make sense to the
> server (and the client may not have a "c:\" so following them on any
> other system than the server could end up with an invalid path).   If
> you are trying to map (on the Windows server) a link to a UNC name
> then it seems much easier and safer to use their DFS tools (since
> Windows uses reparse points in a similar fashion for DFS, as for
> links, to map one path to another, but for DFS the target path is a
> UNC name rather than a traditional path name).  See
>
> https://technet.microsoft.com/en-us/library/cc771134(v=ws.11).aspx
>
> On Mon, Aug 29, 2016 at 10:35 AM, Cong Monkey <congzhangzh at gmail.com> wrote:
>> HI Steve,
>>
>>    Thanks for your reply, but it's not work for symbol link which
>> create on windows server side and point to full unc (which is itself
>> sub dir).
>>
>> for the windows server side, I do:
>>
>> mklink /d def abc # this create a dir symbol link and works well for
>> linux client
>>
>> mklink /d ghi \\winip\linktest\abc # this create a unc symbol link and
>> not work with linux client.
>>
>> and the I share the current dir ( named linktest).
>>
>> the linux result:
>>
>> root at linuxworker:/mnt# mount.cifs -o
>> vers=3.0,username=abc,password=abc1abc,domain=myhostname,
>> nounix,mfsymlinks //winip/linktest linktest
>>
>> root at linuxworker:/mnt# ls linktest/ # dir list well
>> abc/     def/     def.txt  ghi
>>
>> root at linuxworker:/mnt# ls linktest/ghi    # nothing be show here!
>> linktest/ghi
>>
>> root at linuxworker:/mnt# LANG=C ls -l linktest/ghi  # the ghi point a
>> unc which create on windows server by mklink /D ghi
>> \\winip\linktest\abc, and work right with windows client
>> l--------- 1 root root 0 Aug 29 23:17 linktest/ghi ->
>> /??/UNC/winip/linktest/abc
>> root at linuxworker:/mnt# LANG=C ls -l linktest  # all detail about the
>> linktest share content
>> total 1
>> drwxr-xr-x 2 root root 0 Aug 29 23:17 abc
>> l--------- 1 root root 0 Aug 29 23:16 def -> abc
>> -rwxr-xr-x 1 root root 3 Aug 29 23:15 def.txt
>> l--------- 1 root root 0 Aug 29 23:17 ghi -> /??/UNC/winip/linktest/abc
>>
>> Thanks for reply:)
>>
>> On Mon, Aug 29, 2016 at 10:54 PM, Steve French <smfrench at gmail.com> wrote:
>>> If you want to create a symbolic link with a target of UNC name
>>> ("\\server\share\path") instead of "path" you should configure it as a
>>> DFS link (if it is Samba server you can see instructions at
>>> https://wiki.samba.org/index.php/Distributed_File_System_(DFS) and if
>>> the server is Windows there are lots of walkthroughs explaining DFS
>>> setup
>>> (https://mizitechinfo.wordpress.com/2013/08/21/step-by-step-deploy-dfs-in-windows-server-2012-r2/)
>>>
>>> cifs.ko in Linux (whether mounted with cifs or smb3) will expect a
>>> pathname in a normal symlink.    Also note that since symbolic links
>>> are typically not supported by Windows servers (with some exceptions
>>> for admin created symlinks), the mount option "mfsymlinks" on the
>>> client may be needed - to ensure that symlinks are being emulated.
>>>
>>> On Mon, Aug 29, 2016 at 9:42 AM, Cong Monkey <congzhangzh at gmail.com>
>>> wrote:
>>>> HI All,
>>>>     I try to mount.cifs a windows server share on debian, it works well.
>>>>     But, I have trobule with symbol directory which create with mklink
>>>> /D
>>>> abc  \\thesameserver\ddd\eee, and it works if the link create with
>>>> mklink
>>>> /D abc  ddd\eee.
>>>>     My question is, is mount.cifs possible to work full path symbol
>>>> link?
>>>>     Thanks,
>>>> Cong
>>>> --
>>>> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
>>>> the body of a message to majordomo at vger.kernel.org
>>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>>
>>>
>>>
>>> --
>>> Thanks,
>>>
>>> Steve
>
>
>
> --
> Thanks,
>
> Steve
>
>



-- 
Thanks,

Steve



More information about the samba-technical mailing list