nfs 설치
$sudo apt-get install nfs-kernel-server
nfs 설정
exports 파일 설정
$sudo vim /etc/exports
내용 :
/nfs_resource 192.168.0.11(rw,sync,no_root_squash)
/nfs_resource 는 nfs 디렉토리고 192.168.0.11 은 외부에 열어줄 ip 이다.
재시작
target board 에서 mount 하기
각 네트워크의 ip 설정을 한다.
target board : ifconfig eth0 192.168.0.11 up
host : ifconfig eth0 192.168.0.10 up
ip 설정 완료 후 다음과 같이 target board에서 mount 한다.
mount -t nfs 192.168.0.10:/nfs_resource /mnt
문제해결
failed: Protocol not supported
nfs의 버전 문제라고 한다. mount 시 다음과 같은 옵션을 추가한다.
mount -t nfs -o nfsvers=2 192.168.0.10:/nfs_resource /mnt
RPC: failed to contact portmap (errno -5)
mount -t nfs -o nfsvers=2 -o nolock 192.168.0.10:/nfs_resource /mnt