User:Alexmat/Network File System Setup

From ArchWiki

Network File System Setup

Introduction and Concepts

Server Setup

Verify/Compile Kernel NFS Support

For Kernel 2.6:

cd /usr/src/linux
make menuconfig
File Systems --->
 Network File Systems --->
 <*> NFS file system support
 [*]   Provide NFSv3 client support
 [ ]   Provide NFSv4 client support (EXPERIMENTAL)
 [ ]   Allow direct I/O on NFS files (EXPERIMENTAL)
 <*> NFS server support
 [*]   Provide NFSv3 server support
 [ ]   Provide NFS server over TCP support (EXPERIMENTAL)
 < > Secure RPC: Kerberos V mechanism (EXPERIMENTAL)
 < > SMB file system support (to mount Windows shares etc.)
 < > CIFS support (advanced network filesystem for Samba, Window and o...)
 < > NCP file system support (to mount NetWare volumes)
 < > Coda file system support (advanced network fs)
 < > Andrew File System support (AFS) (Experimental)

Install nfs-utils:

pacman -Sy nfs-utils

Edit /etc/exports:

/dir/toshare 192.168.1.0/24(rw,sync)

Update exports:

exportfs -a

Edit /etc/conf.d/nfsd and modify the following line to read:

MOUNTD_OPTS="--nfs-version 3"

Edit /etc/hosts.allow:

portmap: ALL
lockd: ALL
mountd: ALL

WARNING: Change ALL to a more secure setting! Only use that for initial testing.

Start nfs services:

/etc/rc.d/portmap start
/etc/rc.d/nfslock start
/etc/rc.d/nfsd start

Test your setup:

rpcinfo -p

After you've tested your setup and it works, add these services to the daemons list in /etc/rc.conf.


Client Setup

For Kernel 2.6:

cd /usr/src/linux
make menuconfig
File Systems --->
 Network File Systems --->
 <*> NFS file system support
 [*]   Provide NFSv3 client support
 [ ]   Provide NFSv4 client support (EXPERIMENTAL)
 [ ]   Allow direct I/O on NFS files (EXPERIMENTAL)
 < > NFS server support
 < > Secure RPC: Kerberos V mechanism (EXPERIMENTAL)
 < > SMB file system support (to mount Windows shares etc.)
 < > CIFS support (advanced network filesystem for Samba, Window and o...)
 < > NCP file system support (to mount NetWare volumes)
 < > Coda file system support (advanced network fs)
 < > Andrew File System support (AFS) (Experimental)

Start portmap:

/etc/rc.d/portmap start

Test your connection to the server:

rpcinfo -p -u server

Mount a share:

mount server:/shared/dir /mnt/share