Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. ##############################################
  2. # #
  3. # NFS Setup on a Raspbian device #
  4. # ------------------------------ #
  5. # #
  6. # Quickly setup a network file share (NFS) #
  7. # on a Raspberry Pi device, or similar, #
  8. # running the Raspbian operating system. #
  9. # #
  10. # Inputs: dev = your block device #
  11. # mp = mount point #
  12. # #
  13. ##############################################
  14.  
  15. # your block device to be mounted
  16. # example: /dev/sda1
  17. dev=VARIABLE
  18.  
  19. # mount point on Raspbian device
  20. # example: /mnt/mydrive
  21. mp=VARIABLE
  22.  
  23. # update Rasbpian
  24. apt-get update
  25. apt-get dist-upgrade
  26.  
  27. # create mount point
  28. mkdir -p $mp
  29.  
  30. # install nfs
  31. apt-get install nfs-kernel-server
  32.  
  33. # update the nfs-exports file
  34. echo "$mp *(rw,all_squash,anonuid=1000,anongid=1000)" > /etc/exports
  35.  
  36. # mount your block device
  37. mount $dev $mp
  38.  
  39. # start services
  40. systemctl start rpcbind
  41. systemctl start nfs-kernel-services
  42. systemctl start nfs-common
  43.  
  44. # adds all directories in /etc/exports and files
  45. # under /etc/exports.d to /var/lib/nfs/etab and
  46. # pushes the resulting export entries into the kernel
  47. exportfs -a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement