OSD Mount network shares
From The Neuros Technology Wiki
Based on this forum topic : Mount your network Shares on Bootup
[edit] Find the mount command
[edit] Samba shares
mount.cifs //<SERVER_ADDY>/<SHARE_FOLDER> /media/<MOUNT_POINT> -o user=USERNAME,pass=PASSWORD,rw,nolock
where:
- SERVER_ADDY is the IP address or hostname of the server.
- SHARE_FOLDER is the name of the folder that's being shared.
- MOUNT_POINT is an empty folder you wish for the share to appear (don't forget to create this first!)
- USERNAME & PASSWORD are the details you use to connect to this share
So for example :
mount.cifs //192.168.1.2/Video /media/Video -o user=joe,pass=bloggs,rw,nolock
[edit] NFS shares
mount -t nfs <SERVER_ADDY>:<ABS_PATH_TO_SHARE> /media/<MOUNT_POINT> -o rw,nolock,tcp,nfsvers=3
where:
- SERVER_ADDY is the IP address or hostname of the server.
- ABS_PATH_TO_SHARE is the absolute path of the folder that's being shared, matching that in /etc/exports on your server.
- MOUNT_POINT is where the share appears.
eg:
mount -t nfs 192.168.1.2:/home/Tunes /media/Tunes -o rw,nolock,tcp,nfsvers=3
[edit] Writing the bootup script
In /mnt/OSD/rc.user (create if necessary using vi), put the lines:
Code:
#!/bin/sh sh /mnt/OSD/bootscript.sh &
Then create a file in /mnt/OSD called bootscript.sh, where you first issue a "sleep 10" command to wait for init process to finish, then run your mount commands. Also don't forget to make the mount point(s) first, as they vanish on reboot. You can use vi to edit text files on the OSD. Here's a crude example of bootscript.sh:
Don't forget to make the file executable.
chmod a+x /mnt/OSD/bootscript.sh chmod a+x /mnt/OSD/rc.user
Code:
#!/bin/sh sleep 10; mkdir /media/Videos; mkdir /media/Tunes; mount.cifs //192.168.1.2/Video /media/Video -o user=joe,pass=bloggs,rw,nolock; mount -t nfs 192.168.1.2:/home/Tunes /media/Tunes -o rw,nolock,tcp,nfsvers=3;
Just reboot your OSD and you should see your network shares2 right there under Play|Browse!
[edit] Troubleshooting
If you experience difficulties accessing your Play|Browse menu, it may be because of one of the above commands hanging because the OSD had not fully initialized when it had run. As a workaround, adjust the duration of the sleep command to about 20 seconds. --Greyback 08:23, 10 September 2007 (EDT)
