1

I used to work at a company that used OneDrive. I neglected to unlink the OneDrive account. Now I can't delete the folder.

I started out with:

ls -lae

...

drwx------@   2 jonathan  staff     64 May  9 17:32 OneDrive-COMPANYNAME
 0: group:everyone deny writeextattr
 1: group:everyone deny delete

I booted in startup options and ran this:

csrutil disable --with basesystem --with dtrace --with kext

Next I tried various combinations of xattr, chmod, chown and ended up with this:

ls -lae
drwxrwxrwx@   2 jonathan  staff     64 May  9 17:32 OneDrive-COMPANYNAME

I still can't delete the folder, unfortunately. I'm not sure if it still has some data in it, so maybe that could be the reason. I don't really care about the data. I just want the folder gone.

Here is what I get:

rm -rf OneDrive-COMPANYNAME/
rm: OneDrive-COMPANYNAME/: Permission denied

Here is the output for xattr:

xattr -l OneDrive-COMPANYNAME                                                                           
com.apple.file-provider-domain-id: com.microsoft.OneDrive-mac.FileProvider/OneDrive - COMPANYNAME

Any help is appreciated!

8
  • Backup up everything, then reformat the drive.
    – Solar Mike
    Commented May 25 at 19:18
  • What extended attributes are attached to the directory? Commented May 25 at 21:13
  • I'm sure you did this, but did you run the rm command using sudo? Additionally, this post might help see first reply (not the top reply): answers.microsoft.com/en-us/msoffice/forum/all/…. You might need to reinstall onedrive (but I don't think you will need to sign in to an acount) to be able to delete the symlinks/caches
    – AVelj
    Commented May 26 at 3:56
  • @SolarMike, I had done that. Unfortunately, I need to restore from backups, which includes the OneDrive folder.
    – jschmidt
    Commented May 26 at 23:50
  • @MarcWilson I added xattr above.
    – jschmidt
    Commented May 26 at 23:53

1 Answer 1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .