Mklink - Symbolic Link with NAS & Onedrive

14,165

Solution 1

Ok... I've managed to answer my own question lol... but this might be of help to someone else trying to sync onedrive files that are actually stored on a NAS... because onedrive won't let you relocate its folder to the NAS.

So your Onedrive folder is located here:

C:\Onedrive

and you have a mapped drive from your NAS

W:\Work

And inside the "Work" folder you have a "Documents" folder (the folder you want synced to Onedrive)

W:\Work\Documents

What you need to do next is run "command" as administrator and goto your onedrive folder (C:\Onedrive)

Then use the following command..

mklink /d Documents W:\Work\Documents

This will then create a symbolic link to your onedrive folder and start to sync :)

Thank you all!

Solution 2

This does work, and I used it to point OneDrive to my Synology NAS. However, there is a caveat.

If (when) your OneDrive account becomes disconnected and you reconnect, it will look to the directory with your symbolic links in it and decide if the local drive the links are located on has sufficient space for the files in your NAS location. If not, it will present you with a message about negative disk space - see image Negative Disk Space and won't allow you to 'Next' .

You can, of course, deselect files and folders to sync, and continue. You will be able to access the files through the OneDrive folder, but new or changed files won't sync, which does rather defeat the purpose of OneDrive!

For you to recover from a disconnect, your locally declared OneDrive location must be larger than the file space occupied by your files in your actual NAS location.

I overcame this problem by moving my local OneDrive location to a drive that had more empty space than the files occupying my NAS. To do this I created a OneDrive directory on a 2 terabyte internal drive and recreated the Symbolic Links from my original OneDrive location in it (I didn’t want to risk a copy or move of the existing symbolic links in case something untoward happened as a result). Then I unlinked OneDrive from the PC via the Settings in the OneDrive app.

Restarting the app prompted me to log in and then accept or alter the default location for OneDrive. I selected the OneDrive directory I had created on the 2 terabyte drive and away it went. OneDrive did the math on the local drive disk space vs the space taken on the NAS via the symbolic links, concluded there was now sufficient for synchronisation and signed me in.

After a short while, OneDrive confirms the local data (on the NAS) is synced with the cloud and we are good to go.

Hope my experience is helpful to others.

Share:
14,165

Related videos on Youtube

djsupersain
Author by

djsupersain

Updated on September 18, 2022

Comments

  • djsupersain
    djsupersain almost 2 years

    I have a NAS Storage drive on the network and want to link files from that to my onedrive account... details below..

    W:\FILES\SUPERUSER (MAPPED DRIVE FROM NAS)

    linked to

    C:\ONEDRIVE\FILES (LOCAL DRIVE)

    Can this be done? I've tried mklink with not much success, haven't even managed to create a single link.

    OS. Windows 10.

    • Frank Thomas
      Frank Thomas over 7 years
      on my NAS (synology DS415), you can remotely mount a share on another box on the NAS. synology.com/en-global/knowledgebase/DSM/help/DSM/FileBrowse‌​r/… so you could theoretically share the onedrive folder, mount it on your NAS, and then access the NAS mapped disk to hit both directories.
    • djsupersain
      djsupersain over 7 years
      Hi, thank you, in a nut shell my trouble would be solved being able to do that, I tried to relocate the OneDrive folder to the NAS but onedrive won't let me... i have a WD MyCloud 2TB..
  • David.P
    David.P about 2 years
    I wish this would work, but it doesn't (anymore). See also information from Microsoft about that: support.microsoft.com/en-us/office/…
  • David.P
    David.P about 2 years
    I wish this would work, but it doesn't (anymore). See also information from Microsoft about that: support.microsoft.com/en-us/office/…