Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##############################################
- # #
- # NFS Setup on a Raspbian device #
- # ------------------------------ #
- # #
- # Quickly setup a network file share (NFS) #
- # on a Raspberry Pi device, or similar, #
- # running the Raspbian operating system. #
- # #
- # Inputs: dev = your block device #
- # mp = mount point #
- # #
- ##############################################
- # your block device to be mounted
- # example: /dev/sda1
- dev=VARIABLE
- # mount point on Raspbian device
- # example: /mnt/mydrive
- mp=VARIABLE
- # update Rasbpian
- apt-get update
- apt-get dist-upgrade
- # create mount point
- mkdir -p $mp
- # install nfs
- apt-get install nfs-kernel-server
- # update the nfs-exports file
- echo "$mp *(rw,all_squash,anonuid=1000,anongid=1000)" > /etc/exports
- # mount your block device
- mount $dev $mp
- # start services
- systemctl start rpcbind
- systemctl start nfs-kernel-services
- systemctl start nfs-common
- # adds all directories in /etc/exports and files
- # under /etc/exports.d to /var/lib/nfs/etab and
- # pushes the resulting export entries into the kernel
- exportfs -a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement