Kodi Community Forum

Full Version: [LIVE] Automount SMB Shares with autofs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'be been trying to automount SMB Shares with autofs with the following steps :

First installed the packages.

Code:
sudo aptitude install smbfs autofs

Then I've created the server automount root /mnt/server where all the network shares will be mounted.

Code:
sudo mkdir /mnt/server
sudo chmod 0666 /mnt/server

Then edited /etc/auto.master to add the following line at the end of the file :


Code:
/mnt/server    /etc/auto.server    --timeout=6000    --ghost

Then created /etc/auto.server to list all the shares that should be automatically mounted under the /mnt/server root :

Code:
movies    -fstype=smbfs,credentials=/etc/auto.auth    ://AddressOfServer/movies
music    -fstype=smbfs,credentials=/etc/auto.auth    ://AddressOfServer/music
pictures    -fstype=smbfs,credentials=/etc/auto.auth    ://AddressOfServer/pictures

Then I've created the file /etc/auto.auth and wrote in the following :

Code:
username=myusername
password=mypassword

Once configuration was over, I've restarted autofs daemon for the changes to take effect:

Code:
sudo /etc/init.d/autofs restart

Now if I want to add the directories in XBMC my problem is that they are all empty.

Any ideas how to solve this ?
Well, within xbmc if you have smb enable with your network name (i.e. Workgroup, ms home, etc) than that's all you need for auto mounting shares.

When you select music, movies, pictures from main menu, you then select add source. From there you can add and browse your network and local shares and add them to the path that xbmc uses to find movies, pictures, etc.. Near the end it will prompt you for login name and passwd if it is on a network share.
speed32219 Wrote:Well, within xbmc if you have smb enable with your network name (i.e. Workgroup, ms home, etc) than that's all you need for auto mounting shares.

When you select music, movies, pictures from main menu, you then select add source. From there you can add and browse your network and local shares and add them to the path that xbmc uses to find movies, pictures, etc.. Near the end it will prompt you for login name and passwd if it is on a network share.

Thx pal but that's not what I need Rolleyes
The main advantage of automount approach is to have these network shares accessible thru the normal filesystem. But to be honest I need the automount feature to eleminate a bug with SMB which causes the system once a day unresponsible.
In case you are not aware of this automount doesn't do anything until it needs to.

Meaning try a 'ls /mnt/server/movies' for instance and then check with 'mount' to see if that triggered anything. Its a chick-egg paradox. Wink

I use autofs for NFS and its one little quirk that isn't really spelled out anywhere. If this is now working then just add the sources as per normal.

Once XBMC goes to look for the source you shouldn't ever need to do this on a regular basis. Same goes for any shortcuts in Nautilus, etc.

If you knew of this of course disregard.
thethirdnut Wrote:In case you are not aware of this automount doesn't do anything until it needs to.

Meaning try a 'ls /mnt/server/movies' for instance and then check with 'mount' to see if that triggered anything. Its a chick-egg paradox. Wink

I use autofs for NFS and its one little quirk that isn't really spelled out anywhere. If this is now working then just add the sources as per normal.

Once XBMC goes to look for the source you shouldn't ever need to do this on a regular basis. Same goes for any shortcuts in Nautilus, etc.

If you knew of this of course disregard.

After typing the command ls /mnt/server/movies I just get a No such file or directory message.
And as it turned out I see the folder names even if I shut down my server PC.

Any Ideas how could I make this work ?
maybe try creating the directories? when i specify mount points in fstab, it wont mount them unless the directory i point to exists.

not a problem when auto-mount actually works, on a clean xbmc live install does this right until i update something, then i have to import my custom fstab and create those dir's that i want.

i realize we are talking different mounting issues, but i thought it may be similar enough
I set mine up in a similar method with autofs when I couldn't get XBMCBuntu to connect to my samba shares
autofs mounted the filesystems and XBMC can see the contents inside them on my setup.
The one difference for me is that I set up my samba share with share level security and I set it up to not need a password.
Here's the samba settings for the share:

Code:
[videos]
   path = /movies
   public = yes
   force user = videos
   only guest = yes
   writable = no
   printable = no

Works flawlessly for me.
Autofs should automatically make the necessary directories under /mnt/server assuming that they are mounted properly.