Kodi Community Forum

Full Version: XBMC script to mount NFS volume
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'd like to have an XBMC script which is executed at XBMC startup and mounts an NFS volume (or safely fails in case the volume is not connected).

I see I have to write that in python? Is that possible to do something like that (mounting a NFS volume at XBMC startup) ?

thank you Smile
Here you go.

That is what I do.

Jerry
Whatever your distro may be, it's easier to add your NFS shares to fstab, and have them mounted at boot (similarly to what is suggested above).
Thank you both!

As for fstab: if NFS is offline at boot, will fstab mount it when it comes up?
no, it won't
depends on your distribution. when using redhat/fedora add _netfs to the mount options and do a
chkconfig netfs on

-andy

no idea how that is achieved unter ubuntu... i just use ubuntu because of the prebuild svn builds Smile (i dont like ubuntu)

-andy
aufofs is the solution,

link above can help you.
Using the script, works just fine Smile

As for fstab, if anybody knows how to make it automatically mount and unmount as the server is up or down, hints would be appreciated Smile

(for ubuntu Smile )

ops, didnt see the autofs hint: how about the autofs issues (desktop unresponsiveness) which are reported in the page linked by jawilljr ?
Have you a linux with desktop or a minimal ?

With a minimal should work fine. Not sure, but can remember there's a problem with nautilus.
I have a ubuntu desktop installed on an ION mini-PC.

I use it as a desktop for XBMC. I have the movies and stuff on the NFS volume.
iosonogio Wrote:As for fstab, if anybody knows how to make it automatically mount and unmount as the server is up or down, hints would be appreciated Smile
Fstab is static, it's only read at boot and whenever you call the mount utility. Fstab's syntax is identical between distributions, there's nothing distribution-specific to it.
if you have the drive in your Fstab and its offline you will get an error when booting and have to press "S" to skip and continue with your boot.

-=Jason=-
Trying with autofs also. So far it's working like a charm, and it seems like it's not blocking nautilus or whatever. I used options "soft,intr".
Smile
Flomaster Wrote:if you have the drive in your Fstab and its offline you will get an error when booting and have to press "S" to skip and continue with your boot.

-=Jason=-

Not if you use the 'noauto' option Wink.