XBMC script to mount NFS volume
#1
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
Reply
#2
Here you go.

That is what I do.

Jerry
Reply
#3
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).
* MikroTik RB5009UG+S+IN :: ZyXEL GS1900-8HP v1 :: EAP615-Wall v1 :: Netgear GS108T v3 running OpenWrt 23.05
* LibreELEC 11:  HTPC Gigabyte Brix GB-BXA8-5545 with CEC adapter, Sony XR-64A84K :: Desktop AMD Ryzen 7 5800X / Sapphire Nitro+ Radeon 6700XT  / 27" Dell U2717D QHD
* Debian Bookworm x86_64: Celeron G1610, NFS/MariaDB/ZFS server
* Blog
Reply
#4
Thank you both!

As for fstab: if NFS is offline at boot, will fstab mount it when it comes up?
Reply
#5
no, it won't
Reply
#6
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
CrystalHD Installer XBMC Community Forum Thread -
Apple TV CrystalHD Installer Announcement - Broadcom CrystalHD Installer
http://www.sartori.at/ - my weblog

Sync your MAC and Google Account (+ Google Apps) - Click here for 5$ Discout

Living Room: HFX Micro black - Zotac IONITX G - Intel X25V - Hama remote
Bedroom: Linux AppleTV - CrystalHD
Reply
#7
aufofs is the solution,

link above can help you.
Reply
#8
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 ?
Reply
#9
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.
Reply
#10
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.
Reply
#11
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.
* MikroTik RB5009UG+S+IN :: ZyXEL GS1900-8HP v1 :: EAP615-Wall v1 :: Netgear GS108T v3 running OpenWrt 23.05
* LibreELEC 11:  HTPC Gigabyte Brix GB-BXA8-5545 with CEC adapter, Sony XR-64A84K :: Desktop AMD Ryzen 7 5800X / Sapphire Nitro+ Radeon 6700XT  / 27" Dell U2717D QHD
* Debian Bookworm x86_64: Celeron G1610, NFS/MariaDB/ZFS server
* Blog
Reply
#12
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=-
Reply
#13
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
Reply
#14
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.
* MikroTik RB5009UG+S+IN :: ZyXEL GS1900-8HP v1 :: EAP615-Wall v1 :: Netgear GS108T v3 running OpenWrt 23.05
* LibreELEC 11:  HTPC Gigabyte Brix GB-BXA8-5545 with CEC adapter, Sony XR-64A84K :: Desktop AMD Ryzen 7 5800X / Sapphire Nitro+ Radeon 6700XT  / 27" Dell U2717D QHD
* Debian Bookworm x86_64: Celeron G1610, NFS/MariaDB/ZFS server
* Blog
Reply

Logout Mark Read Team Forum Stats Members Help
XBMC script to mount NFS volume0