
Re: HOWTO: Let the Media Library Index a mounted NAS share
Thanks for everyones posts on this. It took a bit of trial and error, not really used linux much, but I eventually got the script to mount to my NAS and bind to the USB folder. At first it didn't index but I seemed to have got that working too.
For reference I'm using a wired connection to a ReadyNAS device.
My script was as follows: -
Code:
#!/bin/sh
sleep 20
ip=192.168.0.2
smb_share=media
mntp=/usr/local/etc
mkdir $mntp/Movies
options=username=guest
mount -t cifs //$ip/$smb_share $mntp/Movies -o $options
sleep 5
mount -o bind $mntp/Movies/Videos/Films /tmp/usbmounts/sda1/Movies
A few notes on where it failed for me before I got it right: -
As others have noted, when you mount to a smb share it must only be to the root share, don't try to a mount to sub folder on the share as it wont work. Use bind to link to the sub folders. On my NAS the video files are located as follows: -
\\192.168.0.2\media\Videos\Films
So I mount to \\192.168.0.2\media, the root share and then bind to the sub folders Videos/Films
The second thing that failed for me was when I created the mount without passing a username as an option, because I don't normally need a username/password to access it. However it was only when I added the option username=guest that it would successfully mount.
The final part that wasn't working for me was indexing of the files. I could browse to the USB and see all the Films on the NAS but I couldn't see them if I went directly into Movies. Now the silly thing was I tried two things at once, so not actually sure what caused the index to kick in.
1) Copied any mp3 file to the USB stick. My thinking being that if it detects a new file on the stick itself, it might initiate the index process.
2) While doing the above I noticed a hidden folder on the USB stick called ".Theater". I was guessing that this is where it stored its index results so I deleted it (well moved it, just in case I need it back).
3) Rebooted the Mini.
Now it could have been that it just needed another reboot or one of the other two steps, but once it came back online it started the index process and I could then see all my films under Movies.
Hope it helps,
Anthony