Setting up an NFS server on Banana Pi

Install the NFS Server

sudo apt-get install nfs-kernel-server

 

—————————————-
Mount the drive

sudo nano /etc/fstab
more /etc/fstab

# FSTAB FOR BASE SYSTEM

# 512 MB swapfile
/swapfile1 swap swap defaults 0 0

# NAS Volume mount
# /dev/sda2 /mnt/nas_volume ext4 auto 0 0

—————————————–
Setting up the exports

sudo mkdir /nfs
cd nfs
ln -s /mnt/nas_volume/Public/ Public
sudo ln -s /mnt/nas_volume/Public/ Public
sudo ln -s /mnt/nas_volume/georg/ Georg
sudo ln -s /mnt/nas_volume/marit/ Marit
sudo ln -s /mnt/nas_volume/backup/ Backup
sudo ln -s /mnt/nas_volume/gabi/ Gabi

————————————
Configuring the exported directories

sudo nano /etc/exports

sudo exportfs -ra

———————————
Starting the server

sudo service nfs-kernel-server start
sudo tail /var/log/messages

————————————————————————-
After normal restart

georg@bananapi:~$ sudo ps -elf |grep rpc
[sudo] password for georg:
1 S root 23 2 0 60 -20 - 0 rescue 18:16 ? 00:00:00 [rpciod]
5 S root 1432 1 0 80 0 - 473 poll_s 18:16 ? 00:00:00 /sbin/rpcbind -w
5 S statd 1464 1 0 80 0 - 551 poll_s 18:16 ? 00:00:00 /sbin/rpc.statd
1 S root 1476 1 0 80 0 - 581 epoll_ 18:16 ? 00:00:00 /usr/sbin/rpc.idmapd
1 S root 1992 1 0 80 0 - 663 poll_s 18:16 ? 00:00:00 /usr/sbin/rpc.mountd --manage-gids
0 S georg 2684 2618 0 80 0 - 931 pipe_w 18:18 pts/0 00:00:00 grep rpc
georg@bananapi:~$ sudo ps -elf |grep nfs
1 S root 29 2 0 60 -20 - 0 rescue 18:16 ? 00:00:00 [nfsiod]
1 S root 1955 2 0 60 -20 - 0 rescue 18:16 ? 00:00:00 [nfsd4]
1 S root 1956 2 0 60 -20 - 0 rescue 18:16 ? 00:00:00 [nfsd4_callbacks]
1 S root 1957 2 0 80 0 - 0 svc_re 18:16 ? 00:00:00 [nfsd]
1 S root 1958 2 0 80 0 - 0 svc_re 18:16 ? 00:00:00 [nfsd]
1 S root 1959 2 0 80 0 - 0 svc_re 18:16 ? 00:00:00 [nfsd]
1 S root 1960 2 0 80 0 - 0 svc_re 18:16 ? 00:00:00 [nfsd]
1 S root 1961 2 0 80 0 - 0 svc_re 18:16 ? 00:00:00 [nfsd]
1 S root 1962 2 0 80 0 - 0 svc_re 18:16 ? 00:00:00 [nfsd]
1 S root 1963 2 0 80 0 - 0 svc_re 18:16 ? 00:00:00 [nfsd]
1 S root 1964 2 0 80 0 - 0 svc_re 18:16 ? 00:00:00 [nfsd]
0 S georg 2687 2618 0 80 0 - 931 pipe_w 18:18 pts/0 00:00:00 grep nfs
georg@bananapi:~$

—————————————–
Adding the NFS group

sudo groupadd --gid 1111 nfs
groups
sudo usermod -aG nfs georg

—————————————–
Assign the new group to existing files

sudo chown -R root:nfs *

—————————————–
Adding the group on the client machine

sudo addgroup --gid 1111 nfs
sudo usermod -aG nfs georg
groups

Leave a Reply

Your email address will not be published. Required fields are marked *

By submitting this form, you accept the Mollom privacy policy.