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.



Thanks for great guide.
I have just one note: I you write the scripts on Windows and then upload it to the device, make sure you have correct line endings (i.e. LF ONLY!!!). Otherwise it will mess up the folder names and the script will fail (because of non-existing folders).
Top info here thanks – trying it now on my new ds212j
Hello all
I am using a DS211J with DSM 3.2.
Just like Robert in his original question, I have my photos and videos all stored within the same directory structure, currently under volume1/photo.
This is the way I would like to keep things. Like him, I do not want to have to split my photos and videos and would like both types of files served from the same directory (whether “photo”, “video” or something else like “media”).
It all works well when accessing the data using Photo Station 5 (still photos and videos are thumbnailed and can be viewed).
However, when trying to access them using the iPhone/iPad App DS Photo+, I get “Failed to display unsupported video(s)”. Still photos work well though.
Any idea?
Thank you very much
this is great info and its really appreciated…i have a ds411 that i just purchased and was wondering if i could take this a step further…would it be possible if i had all my photos and music on a completely different nas on my network, to be able to mount that somehow on the ds411 and point the photostation and audiostation to those specific folders that are on the other nas? would i be able to add some lines of code that said to mount the other nas at bootup using the appropriate username and password and then create some sort of symbolic links with that new mount point??? thanks for all the great help!
ok i just noticed that under the file station you can actually mount cifs points and use the photo share and the audio share and have it mount at startup automatically which is great! however it doesnt seem to be indexing these mount points to be used with the photo station and audio station…am i doing something wrong or is there a way to get that to work?
please if anyone can help me this is driving me crazy…i was able to run the bind command after mounting my 2nd nas as a remote mount to a new share i created on the synology. it wouldnt allow me to bind to an ip address so after mounting the 2nd nas to a new local share i was able to run and have the bind command startup at bootup.
so basically if you go to the default photo share on the synology you see all the photo folders from the other nas. the same with the music folder.
but for the life of me i cant get the indexing to work to be able to use photo and audio stations. ive tried synoindex /A and /D, ive tried restarted the services, restarting the box, disabling and re-enabling the stations. nothing works. it even shows in the resource monitor that the commands are working for a few minutes but then nothing happens. i even saw a makethumb type service running and thought it was creating all my photo thumbnails but it eventually stops and when i open photostation it shows that i have no pictures….
please anyone that has any ideas… please : )
Been searching for this for a while
Got no wiser untill I read this page. Excellent. Had to add the synoindex command into the rc.local file to get the autoindex, but other than that, no problems whatsoever
Thanks.
I used your method to mount both my music and my photo directories, outstanding work tracking this down, thanks!
Thanks everyone for all the good info! I was trying to get my ext SATA HDD to show up in Media Server and this totally explained it, though my *nix skills were a bit rusty
One question – after I created rc.local and rebooted, the Media Server is stuck in “Indexing Mode” and MAN is it hammering those internal HDDs! Also, now when I use my PS3 or iPhone to hit any of the media shares (video, music, photo), there’s nothing there.
Is this right? How long should it take to do an indexing (I’m running 5 2TB drives for 7.14TB, plus the 2TB ext SATA)?
Wim, I managed to find a solution:
Basically i had to rename /usr/syno/etc/usbno_guid.map ro /usr/syno/etc/usbno_guid.old
Reboot, and the directory was gone.
should say ls/dir
I can’t really do anything File Browser, all options are greyed out. And when i do ls/dirin a ssh connection to the NAS, i can’t see it as a mount point, nor a directory.
Hey Wim. Thanks for the swift reply, but this doesn’t seem to work for me. I binded my external USB to a folder in /Diskstation/ (well that’s where it appears in File browser), and I’m not sure what argument to use to unbind/unmount it?
So now i have /usbshare1/ mounted somehow, and I don’t really need ot mounted in the file browser (which btw doesnt let me unbind it either)
Thanks,
Steve
Can’t you just remove that directory?
Hi! How do you unmount the directory?
Hi Steve,
You can unmount with the command umount. In my example it should be umount /volume1/music
Thanks Manuel,
I tried this and worked. It was driving me crazy, too.For every movie I had to wait 10 minutes, until the indexing finished.
Catalin,
I was having the same problem, when I added files via windows directly on the real path (My example \\Diskstation\Synology DiskStation\My Photos) they did no appear in Photo Station.
But if I add files on the mounted path (\\Diskstation\photo) the changes appear immediately on the Photo Station.
Hope this works for you too, because I was driving crazy.
One little question: how do i remove this folder? remove rc.local does not remove the folder after rebote; umount /volume1/photo does not remove the folder after reboot. any ideas?
Hi Wim,
My reindexing problem appears not only at reboot, but anytime I add a new file or folder.
It’s a little weird, because the files are somehow accessible for the player (in this case my TV). I had one movie in that location, I reindexed and added afterwards a subtitle file. I played the movie and the subtitle appeared on screen, although it wasn’t visible on the folder.
synoindex, from what I seen, does a manual reindexing.
Apparently is not a issue of binding, but rather of indexing. my Movies folder is binding, but I have to manually push re-index.
I didn’t found much help on the net about this problem.
Hi Catalin,
Have you tried running the following command in console:
synoindex -A /volume1/video
I tried this solution. It works with the audio folder, but not with the video one.:(
I have a DS110j and rc.local contains 2 lines:
mount -–bind /volume1/audio /volume1/Media/Music
mount -–bind /volume1/video /volume1/Media/Movies
Any suggestions?
Hi, just to bump Robert’s Q: is it possible to (or better: how) to tell the indexer to scan the /photo dir for photos AND videos, as you can’t edit the default folders via GUI, thanks a lot!
How to umount the –bind share?
Later versions of the Firmware let you change the volume via the shared folder control panel. So if you want it on a seperate volume it is very easy via the GUI.
[...] http://dev.eek.be/2010/01/change-folders-for-synology-media-server/ Share this:TwitterFacebookLike this:LikeBe the first to like this post. [...]
@Adam & @Robert: I used:
sleep 30
mount –bind /volume1/photo /volume1/video
Not sure I needed the sleep, as I’m not using USB here…
My dnla enabled tv (LG LW5700) sees photos in the /photo folder and videos in the /video folder. I tested and found that videos added directly to the video folder show up right away in the tv’s video folder, and photos added directly to the photo folder show up right away in the tv’s photo folder, but it requires I reindex in DSM to see the changes in the other folder. The changes show immediately in DS Photo+, DSFile, File Station, etc. It’s just the DNLA that’s hosed. I too keep my photos and videos off my camera in the same folder structure. To separate these out means more work, can’t use Synology Assistant Photo Uploader for videos, and Photo Station 4 won’t see the videos. Bummer. Does anyone know why in this case the index isn’t being created?
[...] ls -la /etc/rc.local Thanks to Wim http://dev.eek.be/2010/01/change-folders-for-synology-media-server/ Gespeichert unter DS410, Synology Kommentare nicht erlaubt | Trackback [...]
Hey great,
it works fine for me as well!
Thanks
Etienne
Hi. thanks for sharing this!
is it possible to make link from one (system) to another volume, eg. mount –bind /volume2/MyMusicDirectory /volume1/music
Navid,
I’m not sure but I don’t think this is possible.
You can maybe create a Symlink from volume2 to the volume1 musicdirectory
Wim,
Thanks for the reply. I can see it in the Shared Folder list in the Synology Browser.
Yes, by going to my Diskstation in Explorer I can see the Shares.
I remapped to the specific folder and can browse it. I was just annoyed that I didn’t see the Folder under my already mapped drive.
I suppose my solution here is just remap. It isn’t exactly the appearance I would like, but that is just on the back end; so it doesn’t really matter.
Thanks!
Hi,
I have mounted a photo folder located on volume2. I indexed Photo Station and can see the test album. That’s all great. HOWEVER, I cannot navigate to the folder (test album) in Windows Explorer as a Mapped Drive. I can only see the Folder in the File Browser on DS.
Has anyone else had this problem?
Thanks in advance!
Hi Joe,
Can you see the folder in your shared folder list?
Can you get the filesystem if you type in your explorer screen: \\nas_ip
( where nas_ip is the ip of the nas )
Regarding my previous post, i found out that you need to log as root with putty, same password as admin, in order to run the commands.
Thanks for the great tip !
Lionel
Hello,
I am getting permission denied when doing the touch /etc/rc.local
I am using DSM3.1 on a brand new DS211, logged with putty under the admin account.
Any idea ?
Thank you very much !
Lionel
Hi Lionel,
You can try the command sudo touch /etc/rc.local or else you have to log in as root instead of admin.
I created own music folder for every NAS user and create an unbreakable link for every folder in the default music folder.
But the “audio station” ignores the file permissions and lists all music files from the other users as well.
Is there a solution or a workaround available?
Daniel
Use two dashes. mount –bind
mount is a standard unix command so it isn’t going to go away or stop working.
Thanks, this helped my out a lot. I used it the make a link to my photo’s (somewhere in my backup folder on my DS211J) and share them with photo station.
anyone know if this still works?
im trying it on the DS411J but can’t get it to work ;/ any idea, what i might do wrong?
iv got the
“mount -bind /volume2/HD-movies volume1/video”
also tried to ad the sleep 30
still nothing.
i can see all the movies i move into volume1/video folder, but not the ones from the one i try to mount?
Thank you. Work like a charm. Now I don’t have to worry about filling up my USB drives with videos and replace with larger drives. With all your instruction here, I just simply ‘bind’ new drives to the system ‘photo’ folder. Thank you. Great instructions. Nick
I tried the mount -bind and at first it seemd to work. All is fine via DLNA and in Audiostation.
However, if I access the iTunes server, all files show up twice. Looking at the database shows, that it contains all files twice: once under ‘/volume1/music’ and once under ‘/volume1/Media/Audio’ (which is the directory I mounted under /volume1/music).
Does anyone know how to resolve this? How to tell the diskstation which folders to index and which not?
Cheers,
Karsten
Hi,
Got it working. Needed to change the “sleep 30″ to “sleep 120″ as the box normally mounts my extra mounts before it mounts the encrypted folders.
Sleep 120
mount –bind /volume1/movs /volume1/video
Thanx
Hi,
Have any1 tried this with an encrypted folder on the synology? Would you use the ordinary (ex. /volume1/movs) or the “strange” folder (ex. /volume1/@movs@) as ref?
Thanx,
Boboland
I found the problem. There was a setting in the NAS that changed the MIME-types. I disabled it and now it works! Now I just want to be able to play mkv files and use subtitles..
Yes it is weird. Yes I’m looking under videos on the ps3 and I have the latest firmware. I just hooked up my TV to the media server and the TV can play the files from the NAS without any problems.
I’v played those files on the ps3 before I copied it all from my computer to the NAS without problems. Now I wonder if there might be a problem with the mount of the video folder. I haven’t tried playing files from the video folder directly so I can’t be sure if that is the issue here.
Hi,
Thanks for the guide. I used this to set up my movie library on volume2. I.e:
mount –bind /volume2/Film_Tv /volume1/video
Media server indexing works fine as long as I add the files directly to /volume1/video. Not if I use the directory on volume2 for upload. This is fine though.
But my problem is that the movies won’t play on my playstation 3. I get the unsupported format message on every video file. The files show up but I can’t play them. Any ideas?
That’s weird. I can play almost every video without any problems.
Have you installed the latest firmware on your PS3 and are you looking on your PS3 in the video folder for the movies?
Thanks Wicher! I was sure my issue was the USB device coming up to speed you have ended my hair pulling!
I’ve been struggeling with this problem for a while, but i finaly got it right. Because i’m a n00b, i didn’t understand how to edit the rc.local, and after that it still didn’t work. It seems that it takes a bit of time before you can execute these commands, so you need to put a pause in the rc.local file. Here’s how i did it:
Say you want the folder movies on your USB-disk to be in the video-folder.
# Create a folder movies (or any folder you like) in your video-folder.
# Use Putty to SSH to your Synology.
# Log in as root (username: root, pass: your usual admin password)
# Get to the dir etc:
cd /etc/
#create or edit the file rc.local:
vi rc.local
# press ‘i’ to get into insert mode. Insert the text below:
sleep 30
mount –bind /volumeUSB1/usbshare/movies/ /volume1/video/movies/
# Press ESC to get back into command-mode.
# save and quit the file, type
:wq and then het return.
#check your file (the text should be the two lines you’ve entered):
cat rc.local
Now reboot, use the web-interface to re-index your data, and it should work!
Good post!
I have a DS107, and your mount solution works when I’m browsing the tree structure, but my files are not auto reindexed.
This is what I did in rc.local:
mount –bind /volume1/family/photos /volume1/photo/family
I was hoping that subsequently adding files in /volume1/family/photos would cause my DS107 to reindex – but this doesn’t happen – any ideas?
thanks for your article! i was facing the exact same problem with the symlinks.
since im relativly new to linux, i was happy to find your manual
i have one addition: i had to make the fresh rc.local file executable:
chmod 755 /etc/rc.local
after this, the bind was done after every restart successfully.
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
Perfect!! Worked like a champ on my DS210j! Just what I was looking for.
-LiGHT
Hello, nice writing.
@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
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 …
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.