Saturday, June 18, 2011

Those Annoying @eaDir Files (Synology DS210j NAS)

If you've installed MyMedia Server to your Synology NAS, the first thing you'll likely notice is that there are folders called "@eaDir" everywhere on your system.  This is a "hidden" folder where the server stores thumbnail files associated with iTunes support.  Since we are not using iTunes, we do not need these folders!

To stop the folders from being created:
cd /usr/syno/etc.defaults/rc.d
S66synoindexd.sh stop
S77synomkthumbd.sh stop
S88synomkflvd.sh stop
S99iTunes.sh stop
chmod 000 S66synoindexd.sh S77synomkthumbd.sh S88synomkflvd.sh S99iTunes.sh

To re-enable the folders being created:
cd /usr/syno/etc.defaults/rc.d
chmod 655 S66synoindexd.sh synomkthumbd.sh S88synomkflvd.sh S99iTunes.sh
S66synoindexd.sh start
S77synomkthumbd.sh start
S88synomkflvd.sh start
S99iTunes.sh start


To delete *all* @eaDir folders on your system:
CAUTION:  This will delete files without confirmation, so be sure you have it right!!
cd /volume1/music (or wherever your doc root is)
find . -name @eaDir -print | while read n ; echo $n ; rm -rf "$n" ; done


If you are copying files to the NAS from an Mac then sometimes @eaDir folders will reappear.  When this happens, just re-run the above delete script to get rid of them.

11 comments:

  1. Useful post, thanks!

    Change /etc.default/ to /etc.defaults/ though.

    Also, an alternate way of removing these is:

    sudo find . -name '@eaDir' -exec rm -rf {} \; > /dev/null

    ReplyDelete
  2. Thanks for the correction!

    Your method works as well. I fell into into the habit of using "| while read" as I sometimes ran into issues with paths containing spaces. That could be a Cygwin thing though.

    ReplyDelete
  3. Hi Bill,

    There is my result after ran your scripts you provided:

    DiskStation> cd /usr/syno/etc.defaults/rc.d
    DiskStation> S66synoindexd.sh stop
    -sh: S66synoindexd.sh: not found
    DiskStation> S77synomkthumbd.sh stop
    -sh: S77synomkthumbd.sh: not found
    DiskStation> S88synomkflvd.sh stop
    -sh: S88synomkflvd.sh: not found
    DiskStation> S99iTunes.sh stop
    -sh: S99iTunes.sh: not found
    DiskStation> chmod 000 S66synoindexd.sh synomkthumbd.sh S88synomkflvd.sh S99iTun
    es.sh
    chmod: S66synoindexd.sh: Operation not permitted
    chmod: synomkthumbd.sh: No such file or directory
    chmod: S88synomkflvd.sh: Operation not permitted
    chmod: S99iTunes.sh: Operation not permitted

    I used the admin account login to ssh already.

    ReplyDelete
  4. Hi Siutat,
    Your results sound like a permission issue. Did you log in as "admin" or as "root"?

    You did find an error in my posting though -- the "synomkthumbd.sh" file in the chmod command should be prefixed with "S77". I'll fix that in the original post.

    ReplyDelete
  5. Hi Siutat,

    DiskStation> cd /usr/syno/etc.defaults/rc.d
    DiskStation> S66synoindexd.sh stop
    -sh: S66synoindexd.sh: not found

    I had the same problem. This is because the shell scripts are not in the path. I got it working by adding ./ before the scripts to stop:

    DiskStation> cd /usr/syno/etc.defaults/rc.d
    DiskStation> ./S66synoindexd.sh stop

    For the chmod command to work you need to be root, not admin

    ReplyDelete
  6. try ./S66synoindexd.sh

    the current dir (.) usually is axcluded from the PATH environement variable for security reasons.

    ReplyDelete
  7. I disabled the services and changed the permissions to 000. Then deleted all the @eaDir objects but the directories keep coming back!

    I figured out that when I disable "show thumbnails instead of icons" in Windows7 (under advanced system settings > Performance settings > Visual Effects) they are not being created anymore. This however limits the ability to view thumbnails in Windows 7.

    Does anyone knows why this is happening and if it is because of Samba or something else????

    ReplyDelete
  8. Commenting on above, in the @eaDir that gets created when I access it with Windows7, is the file "Thumbs.db@SynoEAStream". So it seams Synology still has some process running that makes these directories...

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. I noticed that when updating the DSM software, all services will be re-enabled. I've started using the iTunes server on the NAS so I'm learning to just live with the darned files.

    ReplyDelete
  11. Here's the command I use to do the deletions:

    find -type d -name '@eaDir' -print0 | xargs -0 rm -rfv

    ReplyDelete