Kodi Community Forum

Full Version: xbmc's internal nfs client behaves strangely
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey peoples,

i've noticed that xbmc's internal nfs client behaves strangely at my setup.

my nfs server (its a linux server) is configured like this:

yoshi ~ # cat /etc/exports
# /etc/exports: NFS file systems being exported.  See exports(5).
/var/exports  ,fsid=0,no_subtree_check,insecure,all_squash,crossmnt)
yoshi ~ # mount | grep /var/exports
/mnt/raid/merged/medien on /var/exports/medien type none (rw,bind)
/mnt/raid/merged/boot on /var/exports/boot type none (rw,bind)
/mnt/raid/merged/software on /var/exports/software type none (rw,bind)
/mnt/raid/unsorted on /var/exports/unsortiert type none

so i can mount on my linux clients the nfs like this:
mount.nfs4 yoshi:/medien /tmp/test/
everything works.

the problem is xbmc can't access /medien. but xbmc's internal nfs client works with /var/exports/medien. which is pretty strange because when i try to mount yoshi:/var/exports/medien via mount.nfs4 i get the following message:
peach chris # mount.nfs4 yoshi:/var/exports/medien /tmp/test/
mount.nfs4: mounting yoshi:/var/exports/medien failed, reason given by server: No such file or directory

So it looks like xbmc's nfs client ignores the fsid=0 thing which says /var/exports is the nfs root. (i always thought the mapping from / to /var/exports does the nfs server, but then i don't have a reason why xbmc wants to mount /var/exports/medien and it works)

my xbmc version is the Gotham branch from git compiled a few weeks ago

Is it possible to get xbmc's nfs client working with /medien ?
libnfs(the lib xbmc uses for nfs) doesn't support nfsv4 or bind mounts.
Pretty good example of a bad nfs setup if you ask me. (why all the indirection - just mount your stuff into /var/exports directly and export those - or just directly export /mn/raid/blah) . also i wouldn't export /var/exports and its subdirs - only export one (either only /export or all subdirs).

But maybe i am wrong and you are the first person which can really backup such a setup with benefits. I am all ears Smile
My Setup is the following:

my raid array is mounted on /mnt/raid
i've got the following folders on /mnt/raid:
fixed <- for music thats perfectly tagged, movies which are named properly and have a nfo, and sortert photos
unsorted <- for all the stuff thats not perfectly organized
sorted <- i move the stuff from unsorted, organize it and move it to sorted. from time to time the sorted stuff moves to fixed
merged <- is an aufs mount, which combines fixed and sorted. When i write something to merged, it gets written to sorted, but it shows everything combined from fixed and sorted.

so i could export /mnt/raid/merged with fsid=0, but then i had to get the unsorted folder in merged too, so i had to mount --bind it, and i don't know how aufs would react to it.

i also could export /mnt/raid/merged, and /mnt/raid/unsorted. thats what i've done bevore. but with this setup i couldn't use this nice fsid=0 setup where i just have to mount yoshi:/medien or yoshi;/unsorted. i would need either the full path or at least a merged bevor medien. mounting with full path was what i did before trying this mounting to /var/exports and exporting via fsid=0 thing

and mount --bind to /var/exports is the recommended way for setting up a nfs v4 server at least in the gentoo wiki

but i think as long as libnfs doesn't support nfsv4 i will just remove the fsid=0 and mount everything like yoshi:/var/exports/medien
*tilt* Smile