Synology NAS and those pesky @eaDir folders

datePosted on 20:22, March 8th, 2012 by Many Ayromlou

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.

Related Posts:

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

  1. Andrei on March 29th, 2012 at 17:07

    Thank you! Worked like a charm.

  2. Joe on September 3rd, 2012 at 06:27

    TYVM. Just what I needed.

  3. steini on October 1st, 2012 at 15:47

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

  4. KM on December 5th, 2012 at 09:07

    Thanks! Worked perfectly on my 211j with 3.5 running.

  5. Tony S on December 18th, 2012 at 12:42

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

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

  6. sublimal on March 24th, 2013 at 18:08

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

  7. NuShrike on June 23rd, 2013 at 14:54

    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}

  8. dan on September 21st, 2013 at 11:39

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

  9. Katzenbach on October 13th, 2013 at 06:12

    Thank you very much! It works correctly on DS210j.

  10. pat on April 20th, 2014 at 09:29

    Great, thxs! finally something that worked

  11. GuGuss on August 5th, 2014 at 15:50


    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,


  12. Many Ayromlou on August 13th, 2014 at 10:38

    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.

  13. Rodolfo on March 17th, 2016 at 17:15

    Great Tip, works

Leave a Reply

Name: (required)
Email: (required) (will not be published)