Remove DS_Store Files on macOS
OneDrive (work or school) OneDrive (home or personal) More...Less
Corrupted .DS_Store files can prevent OneDrive from syncing correctly. Deleting the corrupted files can help restore normal sync operation.
No data is lost by deleting the corrupted files as Mac Finder only creates .DS_Store files to store viewing options, such as the positions of icons, size of the Finder window, and window backgrounds.
To delete a corrupted .DS_Store file, you will need to use Terminal.app.
Note: You must be logged into macOS as an administrator.
Open a new Finder window and navigate to the Applications folder on the left.
Open the Utilities folder, then double-click the Terminal application.
Give yourself super-user (root) permissions in Terminal so you can use the commands needed to delete .DS_Store files.
In Terminal, type sudo ls then press Return on your keyboard.
When Terminal prompts you for a password, enter your administrator account password. If you don't have a password, leave it blank.
Note: For security reasons, macOS won't show any sign that you are typing your password. Just type normally, even though nothing shows.
Navigate to the folder that is not syncing correctly.
In Terminal, type cd followed by a space.
Find the folder with the issue but do not open it. Instead, drag its icon into Terminal and watch it complete the path for you, then press Return.
Remove the .DS_Store folder and all its contents.
Caution: Make sure you are deleting the correct folder.
Type rm -f .DS_Store and press Return.
Note: Terminal will give no indication that this has been completed. It will only return a message if the command did not work.
Need more help?
Need more help?
Short answer: yes, almost any changes you make on the disk have a possibility of causing further damage. Back up anything important (making minimal changes as you do so), then try to diagnose and fix it.
Long answer: there are several different levels where you could have data corruption/damage:
- There might be a hardware problem -- failing drive, bad cable, etc. I'm not familiar enough with the failure modes of SSDs to tell if this might be the problem here, but I wouldn't rule it out.
- The filesystem data structures (which keep track of what files exist on the disk, where their data is stored, which blocks are available for use, etc) might be corrupted. This sort of damage sort-of applies to the entire volume (or container, in the case of APFS), but might only affect some files/folders.
- Some individual files might have damaged/corrupted contents. I don't think that's the problem here, since a Finder copy will just blindly copy the contents, whether or not they make sense.
Problems at any of these levels can cause secondary problems at higher levels. Hardware problems can cause volume data and/or file contents to get garbled, and volume problems can cause things like parts of files getting overwritten or lost. So if you see problems at one level, keep in mind that the root cause might be at a lower level.
Conversely, trying to fix (or just change) things at a higher level than the root cause can cause additional damage. If you've got damaged volume data structures, creating, deleting, or even editing files can cause the damage to snowball. If you have a hardware problem, trying to repair the volume data structures (e.g. with Disk Utility's First Aid feature) might just cause additional secondary problems at that level.
In your situation, the first thing I'd do is make sure any important files/data is backed up (or as sure as possible under the circumstances). If possible, do this while booted from something else, with the suspect volume mounted read-only to avoid further corruption. (That's probably not possible, so don't worry about it too much. But don't make any unnecessary changes on the disk until the backup's done.)
Then and only then, try running hardware tests, like Apple Hardware Test (for models introduced before June 2013) or Apple Hardware Diagnostics (for models introduced after June 2013) (more info here), or a third-party test utility.
If the hardware tests don't find anything wrong, then start looking at the volume data structures. I don't have any experience repairing APFS yet, but I'd try Disk Utility First Aid first (probably booted in recovery mode). Frankly, if that can't fix it, I'd erase the disk (not just the volume) and reinstall/recover from scratch.
Afterward, maintain good ongoing backups in case there's some underlying problem that didn't get detected/fixed.