OneDrive on mac is keeping two copies of all downloaded files

Anonymous
2022-07-14T09:40:57+00:00

Environment:

MacOS: 12.4 (21F79)

Mac filesystem type hosting OneDrive folder: APFS Data Volume: /dev/disk1s1 on /System/Volumes/Data (apfs, local, journaled, nobrowse)
OneDrive: 22.131.0619.0001 (Standalone)
OneDrive home account as part of Microsoft 365 Personal subscription
OneDrive folder: ~/OneDrive, symlink to /Users/mikaelkjaerulff/Library/CloudStorage/OneDrive-Personal
OneDrive “Files On-Demand” is off by selecting “Download all OneDrive files now”
OneDrive “File collaboration” is off
OneDrive status is “Your files are synced” and there are no warnings/errors
OneDrive storage: 134 GB used of 1.01 TB (as reported by https://onedrive.live.com/?v=managestorage)

I have discovered that OneDrive keeps 2 local copies of all the synced files.  So instead of taking up 134 GB of disk space it uses 268 GB – that can’t be right!  The (I assume) primary copy is in the OneDrive folder:

~/Library/CloudStorage/OneDrive-Personal/

And then there is the (I assume) secondary (or internal?) copy in:

~/Library/Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/

This is true copies of the files, not hard-linked files – I checked that it is different inodes:

> cd ~/Library

> ls -i CloudStorage/OneDrive-Personal/Gravhund/ActivitiesData.xlsx Group\ Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Gravhund/ActivitiesData.xlsx
8965664803 CloudStorage/OneDrive-Personal/Gravhund/ActivitiesData.xlsx
8965664807 Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Gravhund/ActivitiesData.xlsx

There are some differences. If I run a diff on the two locations, like:

> cd ~/Library

> diff -rq CloudStorage/OneDrive-Personal/ Group\ Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive | grep -v .DS_Store > ~/tmp/diff.txt

Note that I exclude Mac Spotlight files (.DS_Store) – Spotlight does not run on the secondary copy. I get:

> cat -v ~/tmp/diff.txt

Only in CloudStorage/OneDrive-Personal/: .Trash

Only in Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Ejerforeningen matr. nr. 146 Hareskov By, Værløse/Billag/2021: 2021-01-14 ?M-^Ersoversigt.PDF
Only in CloudStorage/OneDrive-Personal/Ejerforeningen matr. nr. 146 Hareskov By, Værløse/Billag/2021: 2021-01-14 A?M-^Jrsoversigt.PDF
Only in Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Ejerforeningen matr. nr. 146 Hareskov By, Værløse/Billag/2021: 2021-02-17 SEAS-NVE - årsopgørelse.pdf
Only in CloudStorage/OneDrive-Personal/Ejerforeningen matr. nr. 146 Hareskov By, Værløse/Billag/2021: 2021-02-17 SEAS-NVE - a?M-^Jrsopgørelse.pdf
Only in Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Ejerforeningen matr. nr. 146 Hareskov By, Værløse/Billag/2021: 2021-03-22 Novafos - årsregning 2020.pdf
Only in CloudStorage/OneDrive-Personal/Ejerforeningen matr. nr. 146 Hareskov By, Værløse/Billag/2021: 2021-03-22 Novafos - a?M-^Jrsregning 2020.pdf
Only in Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Ejerforeningen matr. nr. 146 Hareskov By, Værløse/Billag/2021: 2021-12-31 ?M-^Ersoversigt.PDF
Only in CloudStorage/OneDrive-Personal/Ejerforeningen matr. nr. 146 Hareskov By, Værløse/Billag/2021: 2021-12-31 A?M-^Jrsoversigt.PDF
Files CloudStorage/OneDrive-Personal/Gravhund/GravDB/ETL/IMPO/sed0.txt and Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Gravhund/GravDB/ETL/IMPO/sed0.txt differ
Files CloudStorage/OneDrive-Personal/Gravhund/GravDB/ETL/IMPO/sed2.txt and Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Gravhund/GravDB/ETL/IMPO/sed2.txt differ
Files CloudStorage/OneDrive-Personal/Gravhund/GravDB/ETL/KULD/sed0.txt and Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Gravhund/GravDB/ETL/KULD/sed0.txt differ
Files CloudStorage/OneDrive-Personal/Gravhund/GravDB/ETL/KULD/sed2.txt and Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Gravhund/GravDB/ETL/KULD/sed2.txt differ
Files CloudStorage/OneDrive-Personal/Gravhund/GravDB/ETL/PROV/sed2.txt and Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Gravhund/GravDB/ETL/PROV/sed2.txt differ
Files CloudStorage/OneDrive-Personal/Gravhund/GravDB/ETL/PROV.KRITIK/sed0.txt and Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Gravhund/GravDB/ETL/PROV.KRITIK/sed0.txt differ
Files CloudStorage/OneDrive-Personal/Gravhund/GravDB/ETL/PROV.PRID/sed2.txt and Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Gravhund/GravDB/ETL/PROV.PRID/sed2.txt differ
Files CloudStorage/OneDrive-Personal/Gravhund/GravDB/ETL/RYGI/sed0.txt and Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Gravhund/GravDB/ETL/RYGI/sed0.txt differ
Files CloudStorage/OneDrive-Personal/Gravhund/GravDB/ETL/RYGI/sed2.txt and Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Gravhund/GravDB/ETL/RYGI/sed2.txt differ
Files CloudStorage/OneDrive-Personal/Gravhund/GravDB/ETL/RYGS/sed2.txt and Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Gravhund/GravDB/ETL/RYGS/sed2.txt differ
Files CloudStorage/OneDrive-Personal/Gravhund/GravDB/ETL/UDST/sed1.txt and Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Gravhund/GravDB/ETL/UDST/sed1.txt differ
Files CloudStorage/OneDrive-Personal/Gravhund/GravDB/ETL/UDST/sed2.txt and Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Gravhund/GravDB/ETL/UDST/sed2.txt differ
Only in CloudStorage/OneDrive-Personal/Gravhund/WWW/nsdgk: index.htm~
Only in CloudStorage/OneDrive-Personal/Gravhund/WWW/nsdgk: tilmeld.htm~
Only in CloudStorage/OneDrive-Personal/Gravhund/WWW/nsdgk: tilmeld_ver.htm~
Only in CloudStorage/OneDrive-Personal/Gravhund/WWW/nsdgk/traen: lydighed.htm~
Only in CloudStorage/OneDrive-Personal/Gravhund/WWW/nsdgk/traen: ring.htm~
Only in CloudStorage/OneDrive-Personal/Gravhund/WWW/nsdgk/traen: spor.htm~

I see the following main differences:

  1. Symlinks in primary are converted into normal files with content of the symlink in the secondary.
  2. Some file names are converted (like ?M-^Ersoversigt.PDF to årsregning 2020.pdf).
  3. Looks like some emacs backup-files are not copied to the secondary location and not uploaded to the cloud.

(1)

 Symlinks are converted to normal files:

> ls -l "CloudStorage/OneDrive-Personal/Gravhund/GravDB/ETL/IMPO/sed0.txt" "Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Gravhund/GravDB/ETL/IMPO/sed0.txt"
lrwxrwxr-x  1 mikaelkjaerulff  staff  18 Jun 17 20:01 CloudStorage/OneDrive-Personal/Gravhund/GravDB/ETL/IMPO/sed0.txt -> ../common/sed0.txt
-rwxr-xr-x@ 1 mikaelkjaerulff  staff  18 Jun 17 20:01 Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Gravhund/GravDB/ETL/IMPO/sed0.txt
> cat -v "Group Containers/UBF8T346G9.OneDriveStandaloneSuite/OneDrive.noindex/OneDrive/Gravhund/GravDB/ETL/IMPO/sed0.txt"
../common/sed0.txt

I do understand that it often makes little to no sense synchronizing symbolic links to a remote location as-is – they will often point to an invalid location.  But if the symlink is relative (like above), then it might work (if the remote filesystem supports the concept of symbolic links).  The real annoyance is that if you do a fresh download from the OneDrive cloud the symlinks are “lost” – which is the case when you do a reset of OneDrive.  The symlinks are restored as normal files with the content of the symlink.  As far as I can tell there is no easy way to find just these files and convert them back to symlinks.

(2)

Apple’s APFS file system encodes file and directory names using Unicode but is not a “normalizing file system”. I assume the secondary OneDrive copy does some normalization (from NFC to NFD) of file and directory names before uploading to the cloud.  At least that is the only explanation I can come up with.

Ref on APFS and normal forms:

(3)

I don’t understand why emacs backup files are not copied to the secondary and subsequently uploaded to the cloud.  I have a suspicion it could be due to the way emacs create the backup file.  Nevertheless, OneDrive does not pick up the emacs backup files – this must be a bug in OneDrive.

I could understand if OneDrive has the need for a temporary location (to normalize for example) for files and directories before being uploaded to the cloud – but with emphasis on “temporary”.  The secondary copies live forever – that can’t be right.

As a side note: Still OneDrive goes to 100+ % CPU for a minute or so every time I save a file in my OneDrive location.  At least the newest version of OneDrive does not cause kernel panics anymore (fingers crossed, knock on wood…).

What – if anything – can I do to avoid having the secondary copies?

/Mikael

Microsoft 365 and Office | OneDrive | For home | MacOS

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

45 answers

Sort by: Newest
  1. Anonymous
    2022-07-18T07:21:42+00:00

    Arielle,

    As clearly stated in the subject line, this is on a Mac - not Windows. The implementation of OneDrive is very different across the two platforms. And just to make life more complicated there are two distinct implementations on Mac - Appel Store and Standalone version - and they also have some differences in implementation and is not easy mutual replaceable.

    /Mikael

    Was this answer helpful?

    10 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2022-07-18T02:49:31+00:00

    Hi Dearwolf,

    Welcome to Microsoft Community and hope you are doing well.

    I'm Arielle Martina and I'd be happy to help you out with your questions

    Step 1. Right-click the OneDrive icon in the taskbar, then click Pause syncing in the context menu. And then select 2 hours.

    Pause Syncing

    Step 2. Open the storage path of OneDrive and find its sync folder. Then select a file to drag to the desktop.

    Step 3. Back to the taskbar and right-click the OneDrive. Choose Resume syncing in the right-click menu. Then we can see if the OneDrive is syncing normally.

    Way 2: Reset OneDrive
    If we encounter sync pending on OneDrive, we can also try to reset OneDrive. There are two methods provided below:

    #1. By Search for Run
    Step 1. Search Run in the taskbar search box and then press enter.

    Run

    Step 2. Type the following command and press OK.

    %localappdata%\Microsoft\OneDrive\onedrive.exe /reset

    OneDrive Reset Command

    Step 3. In case the icon on the taskbar does not appear in a few minutes, you need to execute the following command.

    %localappdata%\Microsoft\OneDrive\onedrive.exe

    When the execution is done, we will notice the blue arrow on the OneDrive icon. This means that the file is being synchronized. After the synchronization is complete, check whether all files are synchronized correctly and whether the problem is resolved.

    Hope the above information helps. Reply if you need more assistance and I'll be happy to help you.

    Best Regards,

    Arielle Martina

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2022-07-17T23:09:48+00:00

    Ravi,

    There is only one person/account in play here: me and my home account. None of the files are shared with anybody else. Nobody else has been granted access to any of my files in OneDrive.

    Therefore, I fail to see that any file in my OneDrive has been updated by more than one person/account, who both have contribution permissions in different locations.

    Still, I fail to see how credentials can play any role in OneDrive keeping two copies of all downloaded files.

    /Mikael

    Was this answer helpful?

    7 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2022-07-17T18:54:51+00:00

    Hello,

    Greetings for the day!

    The reason why duplication of files were related to credential manager is because the conflict that exists when the file has been updated by more than one person/account, who both have contribution permissions in different locations. I understand manually deleting these duplicate files are hectic, and the simple way to prevent these files from duplicating is to clear the credential manager to make sure only one account gets sync with the cloud files.

    Option 1: Relink OneDrive from Mac

    1. Tap on the OneDrive icon in the menu bar
    2. Go to Help & Settings
    3. Go to Preferences > Account > OneDrive
    4. Click on Unlink This Mac
    5. Restart the system
    6. Add your account

    Relink OneDrive again on Mac and check if the duplicate files are still being created or not.

    Option 2: Clear OneDrive Cached credentials

    1. In the Spotlight search type Keychain
    2. Select Keychain Access
    3. Alternatively, if you are unable to see the Keychain under the spotlight, select the Utility folder and open Keychain Access
    4. Look for OneDrive
    5. Then, locate OneDrive Cached Credential entry and delete it
    6. Run OneDrive once again

    Option 3:
    If nothing resolve this, please reinstall OneDrive from Mac.

    You won't lose files or data by disabling or uninstalling OneDrive on your computer. You can always access your files by signing in to OneDrive.com - https://go.microsoft.com/fwlink/p/?LinkID=251869

    https://apps.apple.com/us/app/onedrive/id823766827?ls=1&mt=12

    Please contact Apple support if none of the option helps.

    Hope this information would be useful to you. Please feel free to get back if you need any additional info.

    Thank you!
    Ravikumar
    Help the next person who has this issue by indicating if this reply solved your problem. Click Yes or No below.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2022-07-16T16:00:24+00:00

    Hi Dearwolf,

    I'm Sneha and I'd be happy to help you out with your question.

    I have suggested to firstly go through fixing sync issue, to get it confirmed that your one drive is able to sync it or not, as since it's having two copies means it's unable to sync the first copy already present and it's reinitiated the download and created new copy resulting in two copies at a time at two location.

    Yes, This can also happen due to a bug in Latest Mac and Latest OneDrive Version as I have checked for Windows it's working fine.

    All your suggestions and feedbacks are valuable for future of OneDrive, Thank You for it. You can forward same suggestion through portal where it can be taken in consideration quicker also as you believe it could be a bug and since there are not many users are facing it possibly it's not known yet, please send this issue with feedback too through same steps :- https://support.microsoft.com/en-us/office/send-feedback-or-suggest-a-feature-a557a90a-828c-482f-8a71-f933499e70f4#ID0EBD=Mac

    To fix your issue at the moment since it's specific to your system, you'll need to connect with Microsoft OneDrive Technical Team. They can connect with you remotely and go through the issue and fix on your system for you remotely because here in Community Forum it can take longer to go through all possible fixes and fix it.

    Connect through Technical Team via https://support.microsoft.com/contactus from this chat support they'll guide and connect with you remotely and fix the issue.

    I hope this information helps. If you have any questions, please let me know and be glad to assist you further.

    Best Regards,
    Sneha

    Was this answer helpful?

    0 comments No comments