Skip to main content

nfs-howto

· One min read
Spark light
#add a share conf
echo "/multi-example 192.168.1.0/24(rw) 172.16.1.0/24(ro) 10.11.12.0/24(rw)" >> /etc/exports
#check config
exportfs -a
#server reload
/etc/init.d/nfs-kernel-server reload
#check nfs ver support status
cat /proc/fs/nfsd/versions
#test nfs mount
mount 192.168.1.100:/example /mnt/example
#if remote mount stuck, check iptable/ufw
#nfs need port: tcp port 111, 2049, 4000-4004 udp port 4001
ufw disable

nfs mac client

  • In the Finder > Go > Connect to server window, specify:
    #need add line "nfs.client.mount.options = vers=4.0" to /etc/nfs.conf
    nfs://192.168.0.51:/<share_full_path>/
  • or without modify /etc/nfs/conf for vers 4 refs
    nfs://vers=4,nuc.local:/mnt/tb
    nfs://vers=4,nuc.local:/mnt/tb
    nfs://vers=4,rw,192.168.1.3:/mnt/sgex16data
    rw
  • mount -t nfs -o vers=4.0 192.168.0.51:/<share_full_path>/ /mnt/nfs
  • mount -t nfs -o soft,timeo=900,retrans=3,vers=3,proto=tcp nas01:/sales /private/sales
  • nfsstat -m

refs