[How To] Mount Windows Share on OpenElec Boot

tuxen

Banned
Mar 23, 2012
2,235
0
0
Denmark
Jackpot!!!!!!

Bloody answer was right infront of me the whole time in tuxens last post



feel so stupid now that i spent an hour trying to sort this out, and it turns out i havent copied all the code:mad:

looks so obvious now that i know whats was wrong.

Thanks anyway!
I was gonna write this to you but I had to run so I did not want to leave a half weird confusing post. Sorry. I would have written it now but luckily another kind soul pointed you in the right direction. :)

As said ; \ is part of the script you can make to mount it at boot.
 
Last edited:

tuxen

Banned
Mar 23, 2012
2,235
0
0
Denmark
Well i updated to the new openelec today and had no luck with the built in gui, thats what got me back onto doing it this way.

The problem i was having with the built in option was under the field named 'mount' i assumed this was the location i wanted the mount to be, but if i entered a file path i.e. storage/nas it would delete the / and leave storagenas, and tbh thats as far as i went with it.
I'm pretty sure the mount point first folder is fixed to /storage/ already so you only need to enter nas. :)
 

ViperNY

New member
Nov 10, 2012
10
0
0
New York
You are missing the sharename on the computer/nas (very important), a user with rights to the sharename, that users password if there is one set, and finally that the share should be mounted as read and write able.

I have put the missing options in bold. Also you need to first create the /storage/pcdownloads dir where your share from the computer/nas will be mounted in if you have not done so.
(command: mkdir /storage/pcdownloads)

And yes I tested it before I posted, and it works perfect. :D

Code:
mount -t cifs -o username=[B]userwithrights[/B],password=[B]userpassword[/B],[B]rw[/B] //192.168.1.2/[B]sharename[/B] /storage/pcdownloads
Don't use ; \ at the end its part of the script explained in post #1

To see which share names that you have on your nas (you should know since you must have created them) in windows press leftwin+r and type \\192.168.1.2 into the run field then press ok.

Edit: For reference: http://wiki.openelec.tv/index.php?title=Mounting_network_shares
Tuxen, I did'nt want you to think I had disappeared, but I have been busy for a few days. Finally got to play a little tonight and still can't get it to connect. What did you mean "leftwin+r" Also, I think my issue may be with the fact that the Time Capsule only needs a pw and for the life of me I cannot figure out if it has a user name. Thought it was "admin"

I will look over the wiki link tomorrow night when I get home and see if I am missing anything,

Regards,
Vipz
 

ViperNY

New member
Nov 10, 2012
10
0
0
New York
Pressing left windows key + r brings up a run window
Tuxen, two issues or things happening, first I ran the run command and got the proper path of \\192.168.1.2\Time Capsule and under login the user name was Time-capsule\admin and I already have the password.

Tried several versions of the mount command line and keep getting the following messages. BTW, I am testing this thru Putty (hope thats right)

openelec:~ # mount -t cifs -o username=admin,password=xxxxxxxx,rw //Time-capsule/Time Capsule /storage/pcdownloads
BusyBox v1.21.0 (2013-03-24 18:49:50 CET) multi-call binary.

Usage: mount [OPTIONS] [-o OPTS] DEVICE NODE

Mount a filesystem. Filesystem autodetection requires /proc.

-a Mount all filesystems in fstab
-f Dry run
-i Don't run mount helper
-v Verbose
-r Read-only mount
-w Read-write mount (default)
-t FSTYPE[,...] Filesystem type(s)
-O OPT Mount only filesystems with option OPT (-a only)
-o OPT:
loop Ignored (loop devices are autodetected)
[a]sync Writes are [a]synchronous
[no]atime Disable/enable updates to inode access times
[no]diratime Disable/enable atime updates to directories
[no]relatime Disable/enable atime updates relative to modification time
[no]dev (Dis)allow use of special device files
[no]exec (Dis)allow use of executable files
[no]suid (Dis)allow set-user-id-root programs
[r]shared Convert [recursively] to a shared subtree
[r]slave Convert [recursively] to a slave subtree
[r]private Convert [recursively] to a private subtree
[un]bindable Make mount point [un]able to be bind mounted
[r]bind Bind a file or directory [recursively] to another location
move Relocate an existing mount point
remount Remount a mounted filesystem, changing flags
ro/rw Same as -r/-w

There are filesystem-specific -o flags.

openelec:~ #
 

nothere

Banned
Nov 25, 2012
1,036
0
0
Its your share name. You have a share name = Time Capsule
Replace with Time\040Capsule
Also try with the actual IP address of the time capsule not the network name.
 
Last edited:

Alan

New member
Feb 2, 2013
43
0
0
Is it as simple as change cifs to nfs in the code to change the share type?
 

ViperNY

New member
Nov 10, 2012
10
0
0
New York
Its your share name. You have a share name = Time Capsule
Replace with Time\040Capsule
Also try with the actual IP address of the time capsule not the network name.
Ok, hopefully I replaced/updated the command line, however I get the following error,

openelec:~ # mount -t cifs -o username=admin,password=xxxxxxxxx,rw //192.168.1.2/Time\040Capsule /storage/mount/Downloads
mount: mounting //192.168.1.2/Time040Capsule on /storage/mount/Downloads failed: No such device or address
openelec:~ #

PS: I also tried it slightly different command line,

openelec:~ # mount -t cifs -o username=admin,password=xxxxxxxxx,rw //192.168.1.2/Time\040Capsule /storage/pcdownloads
mount: mounting //192.168.1.2/Time040Capsule on /storage/pcdownloads failed: No such device or address


In both situations, the mount folders exist on my Pi in the associated locations.
 

nothere

Banned
Nov 25, 2012
1,036
0
0
You included the slash? \040
I think its the space giving you grief. Can you change the share name on the time capsule?
 
Last edited:

ViperNY

New member
Nov 10, 2012
10
0
0
New York
You included the slash? \040
I think its the space giving you grief. Can you change the share name on the time capsule?
Bingo!!!

All my issues were the share name, thanks a million, made the following changes and it work.

#!/bin/sh
(sleep 30; \
mount -t cifs -o username=admin,password=xxxxxxxx,rw //192.168.1.2/TimeCapsule/Downloads /storage/downloads;
)&

Now, how do I remove all those test folders I created trying to make this work.

Regards,
Vipz
 

bullsboy

New member
May 28, 2012
392
0
0
Derbyshire, UK
Just tried updating to a new build and it looks like this is not working. I've gone back to 13959 where it works fine.
I tried to use the new config tool to mount it instead but that didn't work. I ran the mount command on the new build from putty and got "function not supported"
 

Alan

New member
Feb 2, 2013
43
0
0
No upgrades for me then till this gets sorted as everything is running from my nas. Cheers for the warning
 

Kc6nsf

New member
May 30, 2013
202
0
0
Antelope Valley California
Mounting a USB hard disk is one of the next things to do on my list. I have read several different way to do it. Someone told me to just let it auto-mount, but I like this method.

Thanks for the good information
 

Kc6nsf

New member
May 30, 2013
202
0
0
Antelope Valley California
A noob question here, the USB drive will be plugged into the Raspberry Pi? and the computer does not have to be on, once this is done?

I am using Raspbmc, when I type the ip address, I get a XBMC screen which shows Tv, Pictures, Music, and music. When I type \\Raspbmc, it comes up with two directories, Pi, and devices.
 
Last edited:

Antnkel

New member
Oct 13, 2013
170
0
0
Was wondering if someone could help?
I need to mount my nas drive to my android box but am very green when it comes to all this. I didn't Understand the previous posts on how to do it, would need it explaining very simply if that's possible.
Thanks.
Anthony.
 

Hustler

New member
Mar 24, 2013
78
0
0
Florida
Was wondering if someone could help?
I need to mount my nas drive to my android box but am very green when it comes to all this. I didn't Understand the previous posts on how to do it, would need it explaining very simply if that's possible.
Thanks.
Anthony.
You may want to post this in the Android section for a quicker response.