Kodi Community Forum

Full Version: Mapping SMB persistently (restore on reboot)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Within XBMC Live 9.11, I need to map to a SMB share (so that completed .NZB downloads can be stored on the network).

Using "smbmount" I've been successful in mapping SMB shares; however, I need to map them persistent (so that they're re-mapped every time I reboot).

Unfortunately, I don't know any more Linux than getting around the basic CLI, at best. I've spent the last 90 minutes on Google looking for something related to this, assuming it's very straightforward in Linux. However, most of the tutorials are about SAMBA sharing outwards (rather than mapping persistent drives on SMB shares).

Can anyone suggest the proper method for doing this; and, perhaps an example mount-point (to be sure I'm not mounting it in some way that is unconventional)?

Thank you in advance!!
The following thread is focused on NFS but it talks about a couple ways of mounting that may be of help to you.

@Gabbott- Thank you for the link

Their approach was a little messy, but the keywords helped me get on the right track ... about an hour later and dozens of articles, and I've got it working. I'm posting this for other people who stumble on this thread:

Mounting an SMB / CIFS share automatically at boot (persistently) in XBMC (helpful for using SABnzbd on XBMC):

Note: I'm a Linux newbie - there may be a better way of doing this; however, this is the working approach I've found after a lot of reading

First, I prefer to login as root, to make it all easer:
Create the directory where you'd like the mount-point. For example
Quote:mkdir /home/xbmc/win-disk
Next, I edited the fstab file:
Quote:nano /etc/fstab
Inside the fstab file, add a mount at the bottom:
Quote://server_name_or_ip/sharename /mount_point cifs noauto,username=user,password=pass,file_mode=0777,dir_mode=0777 0 0
IMPORTANT: You must substitute your own info here, don't cut-and-paste that line. To be clear, that is:

1) the server name (IP is probably more reliable, use that if you can)
2) the share name
3) a mount point, for example: "/home/xbmc/win-disk"
4) cifs (the file system "smbfs" is depricated, you must use "cifs")
5) the keyword "noauto" which tells it not to mount at boot (we'll mount at login, to avoid problems with mounting a remote share at boot)
6) the username / password of the SMB (Windows) share
7) the permissions (file_mode / disk_mode are the new/updated commands)
8) two zeros, that is "0 0" at the end

Once you've got your fstab file modified, we just have to modify the rc.local file:
Quote:nano /etc/rc.local
Add the following line:
Quote:mount /mount_point
(where "/mount-point" is your actual mount-point (in this example, I used "/home/xbmc/win_disk")

In newer versions, it seems you also need to set rc.local to be executable:
Quote:chmod /etc/rc.local +x

Once you're done, give the system a reboot (I just use the "reboot" command at the prompt) then see if you can get a directory of your new mount point. For example: ls /home/xbmc/win-disk

On a related note -- the best article I've found for this is:

Good luck to anyone else interested in giving this a shot (just don't write me for help, I'm no Linux expert!)
Thank you very much for that guide for a complet n00b like me :-)
Got it working, thank you.