I replaced the HDD from my machine by an SSD, and I'm trying to use the old HDD for other purposes, without reformatting it. My new SSD is booting as C:\ and the old HDD (which used to be C:\) is now under E:\. The first thing is to get rid of all reparse points that point to C:\. For that, I'm using fsutil reparsepoint delete on every reparse point under E:\ that points to C:\.
Everything was working magically, until I hit E:\Users\myname\OneDrive. It turns out that it's a special reparse point, because although it does show up under dir /al, it's not <JUNCTION> neither <SYMLINK>. It's listed as <DIR> only:
E:\Users\myname> dir /al
Volume in drive E is OS
Volume Serial Number is 72E7-C9BC
Directory of F:\Users\myname
05/26/2022 02:20 PM <DIR> OneDrive
0 File(s) 0 bytes
1 Dir(s) 119,188,217,856 bytes free
I can confirm that it's a reparse point using fsutil reparsepoint query:
E:\Users\myname> fsutil reparsepoint query "OneDrive"
Reparse Tag Value : <redacted>
Reparse Data Length: 0x6c
Reparse Data:
0000: <redacted>
0010: <redacted>
0020: <redacted>
0030: <redacted>
0040: <redacted>
0050: <redacted>
0060: <redacted>
E:\Users\myname> rem Running again for a directory that is not a reparse point:
E:\Users\myname> fsutil reparsepoint query "Contacts"
Error: The file or directory is not a reparse point.
Now if I try to delete that reparse point, I get this error:
E:\Users\myname> fsutil reparsepoint delete "OneDrive"
Error: Access to the cloud file is denied.
I've seen other posts saying to simply delete the OneDrive directory with rd /s or Remove-Item, however I do have files on the cloud OneDrive, and I'm afraid that if I delete from my HDD, I would delete my files.
I have attempted to quit OneDrive and pause sync, but that does not get rid of error Access to the cloud file is denied.
Is there a way to force-delete the reparse point to OneDrive on E:\ without sorting to a backup of my OneDrive files? Maybe editing directory permissions or changing some configuration such as a registry setting?