locked
Symbolic Linking RRS feed

  • Question

  • I have 5 x HDD with Drives lettered C: through to G:.

    On drive D: and F: are folders that contain Data files, both of which are not identical. I want to create a symbolic link that will display the contents of both D: and F: in one "folder". In this case the symbolic link name C:\DataCombined.

    From command prompt I have tried:

    "mklink /D C:\DataCombined D:\DataSet1". This works as I am able to access "C:\DataCombined" which points to the D:\DataSet1, as it should.

    But when I next try to add the second folder via "mklink /J C:\DataCombined F:\Dataset2", this fails with "Cannot create a file when that file already exists."

    I had thought the correct way to do this was via symbolic links. Why cannot mklink allow additional links to the same namespace?


    Monday, December 1, 2008 3:34 AM

Answers

  • Hi

     

    This isn't just a limitation of mklink, it's a limitation of a soft link. It just isn't possible to use a Symbolic Link, Junction, or a Standard Shortcut with the same name that points to multiple targets in Windows.

     

    The only way to do this would be to create the C:\DataCombined Folder.

     

    Create a symbolic link, in that folder, named Dataset1 that points to D:\dataset1.

    ( C:\DataCombined>mklink /D Dataset1 D:\Dataset1 )

     

    Create another symbolic link, in that folder, named Dataset2 that points to F:\Dataset2.

    ( C:\DataCombined>mklink /D Dataset2 F:\Dataset2 )

     

    Hope this helps.

     


    If this post helps to resolve your issue, click the Mark as Answer button at the top of this message.


    Ronnie Vernon
    Microsoft MVP
    Windows Desktop Experience

    Tuesday, December 2, 2008 5:08 PM
    Moderator

All replies

  •  

    Hi ManMountain, you have used the following two commands:

     

    mklink /D C:\DataCombined D:\DataSet1

     

    mklink /J C:\DataCombined F:\Dataset2

     

    Both of them are trying to create "shortcut" under C:\, with the same name "DataCombined" which cannot be done. I consider we need to use C:\DataCombined1 or other different name to avoid this kind of situation.

    Tuesday, December 2, 2008 4:57 AM
    Moderator
  • Thanks for taking the time to reply.

    Just to clarify, I want two folders from two seperate hard drives to appear combined as one via symbolic linking. So by clicking this virtual symbolically linked folder, the contents of two folders on two seperate hard drives would appear as one listing. If I were to do as you suggest, I would still have two unjoined seperate symbolic links, much the same as having two seperate physical folders Smile

    Firstly, I do understand that this is a limitation of mklink by constraining the use of symbolic link names. What I was wondering, is why.

    Secondly, if symbolic linking is not the answer, what alternatives within Vista are there?

    Thanks.

    Tuesday, December 2, 2008 10:09 AM
  • Hi

     

    This isn't just a limitation of mklink, it's a limitation of a soft link. It just isn't possible to use a Symbolic Link, Junction, or a Standard Shortcut with the same name that points to multiple targets in Windows.

     

    The only way to do this would be to create the C:\DataCombined Folder.

     

    Create a symbolic link, in that folder, named Dataset1 that points to D:\dataset1.

    ( C:\DataCombined>mklink /D Dataset1 D:\Dataset1 )

     

    Create another symbolic link, in that folder, named Dataset2 that points to F:\Dataset2.

    ( C:\DataCombined>mklink /D Dataset2 F:\Dataset2 )

     

    Hope this helps.

     


    If this post helps to resolve your issue, click the Mark as Answer button at the top of this message.


    Ronnie Vernon
    Microsoft MVP
    Windows Desktop Experience

    Tuesday, December 2, 2008 5:08 PM
    Moderator
  • Thank you also for your reply.

    Unfortunately, it would seem symbolic linking is not the method to use. The above merely creates two virtual symbolic name links in the folder, much the same if I were to create shortcuts to the folders on each drive.

    Is it impossible to view two seperate folders contents as one in Vista? Would using DFS allow this?
    Wednesday, December 3, 2008 3:52 AM
  • Hi

     

    The difference between a standard shortcut and a symbolic link is that the shortcut would change the focus to the other volume and open the actual folder where the data exists. The point of using symbolic links is that it allows you to work remotely on files and negates the need to move to different volumes so that you can stay in one location to do all your work.

     

    My knowledge of DFS is limited, so I really cannot comment on whether this would be possible or not?

     

    However, here are some links that may answer your question.

     

    The Storage Team at Microsoft - File Cabinet Blog : DFS Replication:
    http://blogs.technet.com/filecab/archive/category/10475.aspx


     

    The Storage Team at Microsoft - File Cabinet Blog : What does DFSDiag do?:
    http://blogs.technet.com/filecab/archive/2008/10/24/what-does-dfsdiag-do.aspx

     

    Hope this helps.

     


    If this post helps to resolve your issue, click the Mark as Answer button at the top of this message.

    Ronnie Vernon
    Microsoft MVP
    Windows Desktop Experience
    Wednesday, December 3, 2008 5:22 AM
    Moderator