Posts | Comments | Email

Change folders for Synology media server

When you enable the Synology Media Server on your NAS, there are 3 directories added to your file-system (video, music and photo) which will be used for the DLNA/UPnP media server to play the corresponding files.

I wasn’t very happy with these 3 directories because I wanted to categorize my media in other directories. In this post, I will post how I’ve resolved this problem.

First, enable SSH access to the NAS and log in.

My first idea to tackle this issue was to use of symbolic links

ln -s /volume1/MyMusicDirectory /volume1/music

I’ve re-indexed my files on the NAS and everything worked instantly. All the files in MyMusicDirectory where indexed so I was very happy…but not for long.
I noticed quickly that the new files I’ve placed in MyMusicDirectory weren’t auto-indexed by the NAS. I always had to re-index through the webinterface which can take hours when there is a lot of data to index so that was a big issue.
I figured out what the problem was: symbolic links will be considered as files and not as directories so the autoindexer wouldn’t follow the symbolic link.

Up to idea 2: mount –bind
I used mount –bind to create an unbreakable link which normally would be used as a directory by the NAS so the contents could be auto-indexed.

mount --bind /volume1/MyMusicDirectory /volume1/music

It worked!! YES!!
Till I’ve rebooted the NAS. The mount was gone and I had to manually add it again. Not something I want to do at every reboot.

Up to idea 3: changing fstab
The file /etc/fstab will be loaded at startup to mount the filesystem so I’ve added the following rule in the file:

/volume1/MyMusicDirectory /volume1/music bind defaults,bind 0 0

I saved the file and rebooted and it didn’t worked. The fstab file will be overridden at startup with Synology’s default fstab-file so the rule I’ve entered before was deleted.

And then idea 3: The solution
Create a file rc.local

touch /etc/rc.local

open the file and add the following line:

mount --bind /volume1/MyMusicDirectory /volume1/music

Now restart the NAS and you’re done.
The files in MyMusicDirectory will be auto-indexed by the media server.

Comments (6)

 

  1. Robert says:

    I’m currently using a D-Link DNS-323 NAS. I am considering purchasing a Synology DS-409 as a replacement because I want higher network speeds and more disk space.

    When it comes to configuring the media server in the DNS-323, you simply enable the uPnP AV Server in the web interface and then point to a SINGLE folder that contains your media files. In my case, my “media” folder contains a massive subfolder tree of mixed family jpgs and avis organized according to years and months. The photos and videos are NOT separated into distinct folders. For example, I might have a subfolder down the folder tree entitled “2008-02-04 – Disneyland Vacation”. In this folder are all the family pictures AND videos taken on the trip.

    The DNS-323 nicely indexes the entire “media” folder and serves up all the photos when requested and/or all the videos when requested.

    But the Synology Media Server requires me to separate my photos and videos; It wants all photos under the “photo” shared folder and all videos under the “video” shared folder. I don’t want to do this! I want to keep all media associated with a specific vacation or event in a single appropriately-named subfolder.

    So I want both photos and videos to be served and properly indexed from a single “media” folder, just as the DNS-323 does. Can I accomplish this somehow using your “Idea 3: The solution”? I’m a DOS/Windows guy so I’m a little intimidated by your Linux/Unix commands.

  2. Rob says:

    Thanks for sharing this!
    Do you know where the ‘ indexed data’ is stored?
    I am looking for a solution to index my media via an external tool …

  3. Wim says:

    @Robert
    If I find some time this weekend, I’ll take a look into this.

    @Rob
    The index is stored inside a postgres database. I don’t know if you can access this directly.
    You can find postgres in /usr/syno/pgsql/bin/
    The databases are stored in /var/database
    The indexing takes place in /var/spool/syno_indexing_queue.tmp and /var/spool/syno_indexing_queue

  4. Hello, nice writing.

  5. lightenup says:

    Perfect!! Worked like a champ on my DS210j! Just what I was looking for.

    -LiGHT

  6. Adam says:

    Hi,

    Did anyone get anywhere with Roberts request. I have the same issue whereby I want to keep both video and stills in the same folder but served up via the Video or Photo methods of DNLA. It’s a pity DNLA will not allow you see video in photo folders but hey!

    Thanks, Adam

Leave a Reply