Please note this is not the same thing as adding a share through XBMC. This mounts the SMB in at a Linux level and will do so every reboot.
Q. Why would you want to do this?
A. Some addons mainly Ic*f*lms and XBMCMusic have the option to download (as opposed to stream). Natively XBMC does not allow addons to write to a share created in XBMC it only allows local drives. It can access network shares, and read them ok, the problem comes when you want to write to them. The share has to be mounted at an OS level for an addon to be able to write to the share.
Q. What does mounting do?
A. A folder is created within /storage/ which acts as a kind of shortcut to a real folder on a network share. Once mounted if you open this folder it will show the contents of the network share you assigned it to. Essentially the OS thinks this is actually a local folder on the Pi.
How....
1. SSH in to the pi (I use Putty) and create a mount point (the folder which will point to your share, in my example I will be mounting a folder on my desktop where all my downloads go).
mkdir /storage/pcdownloads
2. Make sure the folder on your desktop is shared (im my case its a folder called Downloads)
3. Navigate to your Pi's ip address in Windows Explorer
\\192.168.2.2\ (in my case)
You should see some shared folders.
4. Double click on the Configfiles folder and create a new file called
autostart.sh
Make sure its called autostart.sh and not something like autostart.txt or autostart.sh.txt (you may need to turn on file extensions in Folder Options in Windows)
5. Copy and paste the following into autostart.sh
Change the 3rd line to reflect your network and shared folder. My PC has a static IP of 192.168.2.22 and the shared folder on my PC I want to mount is called Downloads. The bit after that on the 3rd line is the location of the mount point on your PI. Stick to the \storage\ folder. My mount point is called pcdownloads.
If you have a username and password to get into windows use this as the basis of the 3rd line.
Reboot your PI and you should have your windows share mounted. You should be able to navigate to the mount point (\storage\pcdownloads in my case) and use it to download to. Anything you download will be on your network share.
Q. Why would you want to do this?
A. Some addons mainly Ic*f*lms and XBMCMusic have the option to download (as opposed to stream). Natively XBMC does not allow addons to write to a share created in XBMC it only allows local drives. It can access network shares, and read them ok, the problem comes when you want to write to them. The share has to be mounted at an OS level for an addon to be able to write to the share.
Q. What does mounting do?
A. A folder is created within /storage/ which acts as a kind of shortcut to a real folder on a network share. Once mounted if you open this folder it will show the contents of the network share you assigned it to. Essentially the OS thinks this is actually a local folder on the Pi.
How....
1. SSH in to the pi (I use Putty) and create a mount point (the folder which will point to your share, in my example I will be mounting a folder on my desktop where all my downloads go).
mkdir /storage/pcdownloads
2. Make sure the folder on your desktop is shared (im my case its a folder called Downloads)
3. Navigate to your Pi's ip address in Windows Explorer
\\192.168.2.2\ (in my case)
You should see some shared folders.
4. Double click on the Configfiles folder and create a new file called
autostart.sh
Make sure its called autostart.sh and not something like autostart.txt or autostart.sh.txt (you may need to turn on file extensions in Folder Options in Windows)
5. Copy and paste the following into autostart.sh
Code:
[B]#!/bin/sh
(sleep 30; \
mount -t cifs -o username=user,rw //192.168.2.22/Downloads /storage/pcdownloads; \
)&[/B]
If you have a username and password to get into windows use this as the basis of the 3rd line.
Code:
[B]mount -t cifs -o username=username,password=password,rw //192.168.2.22/Downloads /storage/pcdownloads; \[/B]
Last edited: