Synology NAS and those pesky @eaDir folders

If you’ve enabled MediaServer and/or PhotoStation on your Synology NAS you might have noticed a bunch of “@eaDir” folders inside your data folders. You will not normally see this under samba or appletalk connections. I noticed it since I was trying to rsync from synology to a old qnap nas I have lying around. Although you can turn these services off from the Control Panel, it does not get rid of these dumb folders. So here is a quick script to clean all the “@eaDir” folders up from your synology disk. NOTE: I’VE INTENTIONALLY NOT USED THE “rm -rf” COMMAND HERE. I DON’T WANT YOU TO DESTROY YOUR NAS SERVER WITH JUST ONE COMMAND. Run the command below and it will “echo” the names of these “@eaDir” folders to the terminal. Then once you’re satistied that it’s working well (no weird filenames/characters/etc.), then replace the “echo” with “rm -rf” to actually remove those folders. There is no guarantee that this will work for you, DO NOT USE THIS IF YOU DON’T UNDERSTAND WHAT THE COMMAND DOES. THIS CAN HARM YOUR FILES.

find . -name "@eaDir" -type d -print |while read FILENAME; do echo "${FILENAME}"; done

Make sure you login via ssh first and “cd” to where your files are stored. This command starts looking for “@eaDir” folders recursively from the current directory.

, ,

14 responses to “Synology NAS and those pesky @eaDir folders”

  1. that’s what i am looking for. Now shotwell will no longer import 1 million of thumbnails ;-)

  2. When you cross directories with spaces, you can use this;

    find . -name “@eaDir” | while read -r filename ; do echo $filename ; rm -r $filename; done

  3. find . -name “@eaDir” -type d -print0 |xargs -0 rm -rf “${FILENAME}”

  4. From current directory:
    find . -name “@eaDir” -type d -print 0 | xargs -0 rm -rf

    is all you need. Sublimal’s doesn’t make sense is there’s no ${FILENAME}

  5. This is *nix, there are a hundred good way of doing the same thing. And thousands of way doing the same thing. :-)

  6. Hi,

    Is it possible to recover files from those @eadir files ?

    The recycle bin of CloudStation only allows recovering 50 files per 50 files and I’m wondering wether I could recover them all at once directly via SSH-in to the CloudStation folder in the NAS.

    Thanks for your help,


  7. Hi GuGuss,

    Those @eadir folders are for internal Apple Spotlight indexing. They do not contain any “user” files. When you delete a file from mac — that has a connection to NAS via AFP or SMB — the file is immediately deleted (you actually get a warning on the mac before it deletes the file. So unfortunately if you delete a file it’s gone.

Leave a Reply