• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • The forum software that supports hummy.tv has been upgraded to XenForo 2.0!

    This is a major upgrade which changes the look and feel of the forum somewhat but brings a host of improvements too. Please bear with us as we continue to tweak things and report any issues or suggestions in Site/Forum Issues.

Mounting Drives using cifs

#1
Hi

Newbie to the forum. Had my HDR-Fox-T2 for a few months now and thought it would be a good time to load the custom firmware. It loaded on a treat! Thank you guys! Great work! I have downloaded the cifs package via the full web interface.

Now I would like to know how to mount shared folders I have on my linux (Ubuntu) server, so they can be viewed on the Humax. I would like to keep them mounted permanantly as the server is always running in the background.

It would also be useful to have write access to the server, so I can transfer files from the Hummy over to the server to save space for more recording.

I appreciate your help.

Thanks in advance...

Teg
 

Rich_A

New Member
#2
The syntax you need is:
mount -t cifs //server/share /destination/dir -o username=username,password=password

If you want to see your share on the TV you need to put the destination somewhere inside the /media/My Video/ (or My Photo, My Music) folder

To automatically create a mapping when the hummy boots, create a text file called something like S99mountme in /mod/etc/init.d containing the mount command and then chmod 755 the file to make it executable.

My file in init.d maps a single share from my NAS containing all my media and then uses bind to map the relevant media directories in the share to the relevant directories on the hummy so I can see them on the telly:

mkdir /media/sausagestor
mount -t cifs //192.168.1.2/share /media/sausagestor -o username=username,password=password
mount --bind /media/sausagestor/video "/media/My Video/_sausagestor"
mount --bind /media/sausagestor/photos "/media/My Photo/_sausagestor"
mount --bind /media/sausagestor/music "/media/My Music/_sausagestor"
 
OP
OP
T

Teg

Member
#3
Thanks Rich! Worked an absolute dream! :) Never knew that my Hummy would have so many geeky possibilities! All the guys out there working on the customised hardware, I owe you guys a drink!

Thanks again! :)
 
OP
OP
T

Teg

Member
#4
Hi again. I am able to mount shares using a command in telnet window but the script does not seem to work. I have saved the following in the directory as you suggested but it does not mount the shares.

mount -t cifs //192.168.1.69/video "/media/My Video/Network" -o username=teg,password=password
mount -t cifs //192.168.1.69/tunes "/media/My Music/Network" -o username=teg,password=password
mount -t cifs //192.168.1.69/photos "/media/My Photo/Network" -o username=teg,password=password

Appreciate any suggestions. Have I used the wrong directory? I did update the permissions as you also directed.

Thanks in advance.
 

Rich_A

New Member
#5
If you go to your /mod/etc/init.d folder and attempt to run the script by typing ./S99mountme, does it run and successfully mount the partitions?

Have you created the 'Network' directories inside the /media/My XXX/ directories before doing the mount commands?
 
OP
OP
T

Teg

Member
#6
Yes I have created the network directories
Running the script by typing the command in the telnet window - that works fine! :) So not sure why it is not running.
 

af123

Administrator
Staff member
#7
Take a look at the log file /tmp/modinit.log and see if that gives any clues.

It might be that the script is running before your network is ready. If that's the case then wrap it in a network check like this:

Code:
[ "$1" = start ] || exit 0

(
    while [ ! -f /tmp/if-up ]; do
            echo "Mountme: waiting for network."
            sleep 1
    done

    mkdir /media/sausagestor
    mount -t cifs //192.168.1.2/share /media/sausagestor -o username=username,password=password
  # etc.
) &
The ( ) & bit creates a subshell in the background so the whole boot process doesn't stall.
 
OP
OP
T

Teg

Member
#8
Getting the following error message when attempting to run the amended script manually

Humax# ./S99mountshares
./S99mountshares: exit: line 1: Illegal number: 0

Thanks in advance

Teg
 
OP
OP
T

Teg

Member
#10
Still having problems I am afraid

When trying to run the amended script


Humax#
Humax# ./S99mountshares
-/bin/sh: ./S99mountshares: not found
Humax#
Humax# ls
S01cifs S01mongoose S99mountshares rcS
Humax#

Error log

run_init =============================================
Loaded CIFS module into kernel.
/mod/etc/init.d/rcS: line 36: /mod/etc/init.d/S99mountshares: not found
Loading config file /mod/etc/mongoose.conf
 

af123

Administrator
Staff member
#11
That error message means that the script has DOS/Windows line endings in it rather than UNIX ones. Try this:

Code:
humax# cd /mod/etc/init.d
humax# dos2unix < S99mountshares > S99mountshares.unix
humax# mv S99mountshares.unix S99mountshares
humax# chmod 755 S99mountshares