thanks a lot, Snappy. Excellent!
I'll try it today
thanks a lot, Snappy. Excellent!
I'll try it today
I've got some time for playing with your script last night (sorry for delaying, had no time before)
and I understood that several things weren't cleared for me (as usually )
Is it necessary to remove comments from your scripts before copy/paste (I mean for example,
# Set timeout to the number of times you want the loop to repeat, or # Create the mount point directory ) ?
Which point has to be renamed to nasmount.sh ? (is it #!/bin/sh ? )
You meant that script has to be copied to /usr/local/etc/ directory. Did I get right that I have to paste your script at the end of /usr/local/etc/rcS ? but it's not a directory but file. It looks that point is not cleared for me at all
Press "i" in vi to enter insert mode; use your mouse to highlight the content to be copied; move to your terminal screen (Probably putty in your case) and copy the content. Still using vi make the required changes (IP change, mount Paths etc..). Now save the file and exit vi; hint= enter ":wq!"
Note the mount point can be whatever you want on the PBO; in the example below I used /tmp/ramfs/volumes/public but I could have used anything I want really. If you want your shares to be visible under the HDD tab menu though you will have to use a directory under the /tmp/ramfs/volumes/"whatever_you_want_to_call_it"
Now that the nasmount.sh has been created you can modify your /usr/local/etc/rcS file and add the /usr/local/etc/nasmount.sh at the end of it.
This should do it for you; I hope it is a little more clear.
Last edited by snappy46; 06-22-2011 at 12:04 PM.
Now it's more clear for me excepting of one thing - how to create a new file called /usr/local/etc/nasmount.sh
If I've got right I just need to do vi /usr/local/etc/nasmount.sh ?
Since I bought my 1st PBO (it was on March) I'm trying to get more experience in Linux, and I thought that some basic steps have been already passed, but it looks wrong. I promise to improve my knowledge in the future
thanks in advance for your patience
Do not forget to make that file no matter how your create it with vi or PC editor as executable.
chmod +x /usr/local/etc/nasmount.sh
Last edited by snappy46; 06-22-2011 at 03:48 PM.
Something goes wrong for me
I've got no movies after run update
/ # /usr/local/etc/srjg/jukebox_update.sh -i -p /tmp/ramfs/volumes/PUBLIC/Movies
Searching for movies..
Generating RSS header..
the new directory has been created under main menu of PBO - I can see PUBLIC folder(and then Movies subfolder) under HDD, but it's empty
Last edited by jurijz; 06-22-2011 at 08:21 PM.
here you can see below my /usr/local/etc/nasmount.sh file
# Set timeout to the number of times you want the loop to repeat
# Create the mount point directory
mkdir -p /tmp/ramfs/volumes/PUBLIC/Movies # Change this to your PBO mount point
# While we haven't used up all the attempts
while [ $TIMEOUT -gt 0 ]; do
# this will be true if 'ping' gets a response
if ping 192.168.0.106; then # Change this to your NAS IP address
mount -t cifs //192.168.0.106/PUBLIC/Movies -o username=Guest /tmp/ramfs /volumes/PUBLIC/Movies
echo "NFS mounted"
# and if there's no response...
TIMEOUT=$((TIMEOUT - 1))
if [ $TIMEOUT -eq 0 ]; then
echo "NFS Failed to mount - no response to server pings"
and then I put the following lines into /usr/local/etc/rcS
I had issued the command : chmod +x /usr/local/etc/nasmount.sh
nothing happend after, cursor just jump to the next line without any errors of comments
Last edited by jurijz; 06-22-2011 at 09:20 PM.
OK first thing first I think that you are almost there; here's a few thing to doublecheck:
1) Are you sure about the name of your share on your NAS; you can only share whatever your NAS allow you to share. For example I also have a samba public share directory on my NAS but because I put a subdirectory under that share does not mean that I can mount it as a samba share. Given the following example:
NAS/public = define NAS samba share
NAS/public/movies = Subdirectory under public
mount -t cifs //192.168.0.106/public -o username=Guest /tmp/ramfs /volumes/PUBLIC/Movies .....will work fine.
mount -t cifs //192.168.0.106/public/Movies -o username=Guest /tmp/ramfs /volumes/PUBLIC/Movies .......will not work. I can only mount the samba share directory not any directory under it. So unless you specifically created a /NAS/PUBLIC/Movies samba shared directory on your NAS (This does not just mean creating the directory but actually creating a share on the NAS) the /NAS/PUBLIC/Movies can not be mounted.
Ok enough about that; now to make sure that the mount command actually works run the mount command manually and see if you receive any error messages. So enter:
To make sure that the mount directory exist and thenCode:mkdir -p /tmp/ramfs/volumes/PUBLIC/Movies
Report any errors that you get. If that all work fine then just try to remove the "&" at the end of the /usr/local/etc/nasmount.sh in the rcS file and see if it helps.Code:mount -t cifs //192.168.0.106/PUBLIC/Movies -o username=Guest /tmp/ramfs /volumes/PUBLIC/Movies
By the way who is the user that own the /PUBLIC/Movies are you sure that it is guest???? If you have yourself created that share who is the owner???? if not guest make sure that you replace "guest" with the user name define on the NAS. Do you need a password???? if so it need to be included in the mount command after the username ....... password=xxxxxxxxx. Also try guest vs Guest; use the same user / password that you use on your PC to mount that same share under window.
You are almost there keep trying.
Last edited by snappy46; 06-23-2011 at 03:58 AM.
I almost finished, but...
I had changed directory from PUBLIC to user's, because both my Windows 7 machine and NAS Gearbox sometimes recognise public folder as "public" instead of PUBLIC. I don't know why. That's why I moved my movies to "user" folder with password
Now I can mount it manually and everything works fine :
mkdir -p /tmp/ramfs/volumes/jurijz
mount -t cifs //192.168.0.106/jurijz -o username=jurijz,password=081 /tmp/ramfs/volumes/jurijz
I had tried your script and also tried to put above mentioned 2 lines(with sleep 5) at the end of /usr/local/etc/rcS - with no result, shared directory wasn't mounted
Do you have any ideas why it does'n work automatically, but only manually ?
Let me know if this works without errors; also what firmware are you running currently.
Also remove the ampersand "&" at the end of the command in the rcS if you have not done so yet and see if it helps.
Last edited by snappy46; 06-23-2011 at 01:42 PM.