I have a problem with OneDrive. I have a junction which points to another folder on the same drive as the junction; the problem is the junction is taking up space. I want to remove the junction but keep the original folder location but yet still have OneDrive sync the files from the original file location.
This page mentions two points which I don't understand.

  • I suggest moving your data out of the folder you are creating the link to, so the folder is initially empty. Then on each machine linked to the same OneDrive account, run the mklink command and wait for OneDrive status to say “Files are up to date”.

  • Then you can copy the files into the folder on one machine and let OneDrive upload them to the cloud storage. Then OneDrive on the other machines should bring the files down again. This should avoid the issue where OneDrive creates duplicates of the files when it finds files already existing.

The first suggestion to remove the data out of the folder you're creating the link too, it sound as if too remove all the data from the original folder, instead of the Junction folder, then I'm strictly relying on the Junction folder instead of my original folder ?

Recommended Answers

All 21 Replies

I've yet to see this effect. However I have run into folk that swear that a junction takes up space. I've yet to find this to be true. Well, yes a junction is in entry in the file system which could take a few hundred bytes but after that you run into other user issues.

https://social.technet.microsoft.com/Forums/windows/en-US/97d2a170-21a8-4cd6-b77a-1accd68d626e/junction-to-2nd-drive-still-gets-calculated-as-used-space?forum=w7itproui for example is another back and forth.

OneDrive content is usually cached local and on the cloud for reasons. I use DropBox as I opted out of a microsoft account. For dropbox I like what they did since the content is on my PC, my backup PC and the dropbox cloud. You could debate if that's 3 copies and you only needed one?

I think as you mentioned, OneDrive is storing a cache verion on the PC which leaves duplicate copies on my system. I have to find if there is a way to prevent this and rather move the contents via a Junction to the cloud and only store one local copy which I originally created, skipping the cache backup.

I didn't explain it well. For DropBox the local sync dir is the cache. There is no other space used so no duplication.

OneDrive uses a junction so it "looks" like a duplcate but is not. I showed a person long ago a test I used for this. I dropped a 1GB file in the junction and it shows in 2 folders. But the disk space only dropped 1GB. Delete the file in either folder and both directory entries vanish and you get back 1GB not 2.

I'm not an OneDrive user but have run into folk with junction questions where they swear it was creating duplicates and eating space.

Thanks for the insight in that I'm not alone in this; I'm going to do my own experiments, once again; then try to hunt down a solution.

I created a Junction but when copying a file to the linked folder, the target folder doesn't update with the file ?

This is partly why I know to tap F5 on Windows Explorer or just open a command line and DIR.

rproffitt, I don't follow ?

I can't know how you are looking at those folders. We know Windows Explorer might not show a file or folder instantly. That's a long standing issue. No reason to dive into that. That's why I know to tap F5.

Also, since Explorer is buggy (even on W10) I always revert to the old ways. Command line, DIR. I'm sure you follow that.

My link folder and target folder are of both different names and the junction worked as the linked folder is the Junction as listed in prompt. What I don't understand is why when I copy a file to the linked folder does the target folder not show the file as well ?

Something doesn't sound right. The linked folder is throwing me a curve here. The link is just that. If the link folder exists before you make a link, I hope the link command would fail. Something smells off here.

The command is mklink <link> <target>. Whatever I copy to the link should update in the target ? When prompt lists a folder path as the Junction that is the link, correct ?

I'd like to follow along here. Did the <link> folder exist prior to the mklink command? If so, I don't know what would happen.

Yes, the link folder existed prior to the mklink command.

So link and target existed before mklink. Time to think about that again. Try a <link> that doesn't exist, as the mklink creates the new connection to the target.

The link existed before mklink, the target didn't; the target is a folder within OneDrive. The link has to exist that is the main location for the folders, otherwise when files are copied to the link the target wouldn't update.

I switched it around, what formally was the link is now the target; and what was the target is now the link. When I create a file and save it on either the link or target; neither the target or link has a duplicate of the same file ?

When "neither the target or link has a duplicate of the same file" then it sounds like there is no link at all. Just a pair of folders.

The link is the junction. If I do a listing in command the link, not the target is a junction.

I'd like to try this but it works fine here. The <fake> does not exist before I mklink to the <target> (re-read the article?) So for what I'm reading here there's no link, just 2 folders.

Something does not make sense. The joined folder is throwing American state a curve here. The link is simply that. If the link folder exists before you create a link, I hope the link command would fail. one thing smells off here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.