Linux Help: How to setup NFS
#1
I am trying to get NFS working on my pogoplug E02 wtih ALARM (archlinux) to share my /media folder and all the external usb drives attached to it to XBMC Eden Atv2 and atv1. Here are some things that I have done, please advise what Im missing since when I try to connect nfs it doesnt connectin xbmc.

Summary: I would like to add my /media folder as a nfs share to be accessible on my network and all the external drives connected to it.


I installed nfs 1.2.6-4 using packer
I bind with mount --bind /media /media
I set permissions
Code:
[root@alarm ~]# chmod 777 /media


I ran the service and enabled it also
Code:
[root@alarm ~]# systemctl start rpc-idmapd.service
[root@alarm ~]# systemctl start rpc-mountd.service


Below are my mounted usb drives
Code:
[xbmc@alarm ~]$ df
Filesystem      1K-blocks       Used Available Use% Mounted on
rootfs            7705504    1315916   5998168  18% /
/dev/root         7705504    1315916   5998168  18% /
devtmpfs           126152          0    126152   0% /dev
tmpfs              126236          0    126236   0% /dev/shm
tmpfs              126236        288    125948   1% /run
tmpfs              126236          0    126236   0% /sys/fs/cgroup
tmpfs              126236          0    126236   0% /tmp
/dev/sdb1       976760000  796875876 179884124  82% /media/ext drive 2
/dev/sdc1      1953512000 1526774152 426737848  79% /media/Expansion Drive
/dev/sdd1      1465135100 1155186728 309948372  79% /media/Elements

/etc/fstab
Code:
#
# /etc/fstab: static file system information
#
# <file system> <dir>   <type>  <options>       <dump>  <pass>

/media /media  none   bind   0   0

/etc/exports
Code:
# /etc/exports
#
# List of directories exported to NFS clients.  See exports(5).
# Use exportfs -arv to reread.
#
# Example for NFSv2 and NFSv3:
#  /srv/home       hostname1(rw,sync) hostname2(ro,sync)
#
# Example for NFSv4:
#  /srv/nfs4       hostname1(rw,sync,fsid=0)
#  /srv/nfs4/home   hostname1(rw,sync,nohide)
# Using Kerberos and integrity checking:
#  /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt)
#  /srv/nfs4/home   gss/krb5i(rw,sync,nohide)
#

/media 192.168.1.2/30(rw,fsid=0,all_squash,insecure,anonuid=501,anongid=501)

I reexported by
Code:
[root@alarm ~]# exportfs -ra
[root@alarm ~]# exportfs -arv
exporting 192.168.1.2/30:/media


/etc/mdmapd.conf
Code:
[General]

Verbosity = 0
Pipefs-Directory = /var/lib/nfs/rpc_pipefs
Domain = localdomain

[Mapping]

Nobody-User = nobody
Nobody-Group = nobody

[Translation]

Method = nsswitch

/etc/conf.d/nfs-server/conf
Code:
# Where to mount nfsd filesystem; the default is "/proc/fs/nfsd".
PROCNFSD_MOUNTPOINT=""

# Options used to mount nfsd filesystem; the default is "rw,nodev,noexec,nosuid$
PROCNFSD_MOUNTOPTS=""

# Options for rpc.mountd.
# If you have a port-based firewall, you might want to set up
# a fixed port here using the --port option.
# See rpc.mountd(8) for more details.
MOUNTD_OPTS=""

# Do you want to start the svcgssd daemon? It is only required for Kerberos
# exports. Valid alternatives are "yes" and "no"; the default is "no".
NEED_SVCGSSD=""

# Options to pass to rpc.svcgssd.
# See rpc.svcgssd(8) for more details.
SVCGSSD_OPTS=""

UUID
Code:
[root@alarm ~]# blkid -o list -c /dev/null
device     fs_type label    mount point    UUID
-------------------------------------------------------------------------------
/dev/sda1  ext2             /              43a1fe96-484a-4103-8a25-c07e55bbd4db
/dev/sdb1  ntfs    Expansion Drive (in use) F480628F806257DE
/dev/sdc1  ntfs    Elements (in use)       CE1433D41433BE71
/dev/sdd1  ntfs    ext drive 2 (in use)    0E2454C02454AD09
Nvidia Shield with Kodi 18
Reply
#2
Here's the sum total of my Ubuntu-based NFSv4 server + client crib notes. I get very close to Gigabit wirespeed using this config.

In my case I am sharing the /home/user/share folder...a mounted drive. Hope this helps:

server
Code:
sudo apt-get install portmap nfs-kernel-server

sudo vim /etc/default/nfs-kernel-server
    NEED_SVCGSSD=no

sudo vim /etc/default/nfs-common
    NEED_IDMAPD=yes
    NEED_GSSD=no

make these dir + chown them for user
     /exports
     /exports/share

sudo vim /etc/exports
    /exports 192.168.0.1(rw,fsid=0,insecure,async,no_subtree_check)
    /exports/share 192.168.0.1(rw,nohide,insecure,async,no_subtree_check)

sudo vim /etc/fstab
    /home/user/share    /exports/share none bind 0 0

iptables -- add these three lines
    -A INPUT -p udp -i eth0 -m udp --dport 111 -j ACCEPT
    -A INPUT -p tcp -i eth0 -m tcp --dport 111 -j ACCEPT
    -A INPUT -p tcp -i eth0 -m tcp --dport 2049 -j ACCEPT

sudo exportfs -ra
sudo /etc/init.d/portmap restart
sudo /etc/init.d/nfs-kernel-server restart
sudo exportfs -v

client
Code:
sudo apt-get install portmap nfs-common
sudo mount -t nfs4 nfs-server:/export/share /mnt/shr
*on xbmc had to add ‘nfs’ to /etc/modules*

NOTE: I use autofs on the client's to handle the NFS mounts.
If I helped out pls give me a +

A bunch of XBMC instances, big-ass screen in the basement + a 20TB FreeBSD, ZFS server.
Reply
#3
rflores - whats the error? If you map all accesses to userid 501 you need to ensure that all files/folders in your exported folders have proper access rights for userid 501... - also before mount bind - try to export a real share from the original mount folder.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply

Logout Mark Read Team Forum Stats Members Help
Help: How to setup NFS 0