네트워크상에서 host작업 디렉터리를 client쪽에서 mount하여 마치 로컬 디렉터리, 파일처럼 사용할 수 있는 시스템으로 임베디드 개발환경에서 많이 사용된다.
NFS구축의 순서는 다음과 같다.
Host 설정
네트워크 환경설정 파일을 열어 다음과 같이 host IP를 설정한다.
@ubuntu:/$ sudo vim /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.0.106 |
apt-get패키지를 업데이트하고 필요한 패키지들을 설치한다.
@ubuntu:/$ sudo apt-get update
@ubuntu:/$ sudo apt-get install nfs-kernel-server tftpd tftp dhcp3-server
host에서 작업디렉터리를 생성한다
@ubuntu:/$ sudo mkdir /opt/nfs
nfs환경설정파일을 열어 설정 내용을 추가한다.
@ubuntu:/$ sudo vim /etc/exports
/opt/nfs *(rw,sync,no_root_squash) |
NFS데몬을 restart시킨다.
@ubuntu:/$ sudo /etc/init.d/nfs-kernel-server restart
NFS서비스 확인은 다음과 같은 방법으로 할 수 있다.
@ubuntu:/$ netstat –a | grep nfs
Client 설정
먼저 아래와 같이 업데이트를 진행한다.
@arm:/$ sudo apt-get update
NFS사용을 위해서 관련 패키지를 설치한다.
@arm:/$ sudo apt-get install nfs-common
Client에서 mount 포인트 디렉터리 생성한다.
@arm:/$ sudo mkdir /mnt/nfs
mount명령으로 mount포인트 디렉터리에 host작업 디렉터리를 mount한다.
@arm:/$ sudo mount -t nfs -o nolock 호스트IP:/opt/nfs /mnt/nfs
디렉터리를 확인해보면 host에서 생성한 파일들을 확인할 수 있다.
참조 사이트
http://elinux.org/TFTP_Boot_and_NFS_Root_Filesystems
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
45 | [IPC]D-Bus 소개 | makersweb | 2015.02.28 | 30050 |
44 | mmap() 함수, munmap() 함수 | pjk | 2014.02.05 | 16070 |
43 | ioctl() 함수 | makersweb | 2014.02.27 | 14441 |
42 | read() 함수, write() 함수 | makersweb | 2014.03.04 | 11474 |
41 | SocketCAN 유틸 사용방법 | makersweb | 2022.02.05 | 8925 |
40 | 리눅스 프레임버퍼(Linux Frame Buffer) | makersweb | 2015.02.15 | 7757 |
39 | Ubuntu Linux에서 dbus-c++바인딩 D-Bus 테스트 | makersweb | 2018.03.07 | 7347 |
38 | 키패드 드라이버 | pjk | 2014.02.12 | 6692 |
37 | 리눅스 커널 소스코드 구성도 | makersweb | 2014.03.04 | 5628 |
36 | Build Qt 4.7.0 for Embedded Linux | makersweb | 2015.05.25 | 5590 |
35 | 플랫폼 디바이스 드라이버 개발 시 많이 사용되는 커널 API 및 매크로 | makersweb | 2020.01.28 | 5246 |
34 | 리눅스 데스크탑 환경 종류 | pjk | 2015.02.11 | 4773 |
33 | 디바이스 드라이버에 대해서 | makersweb | 2014.04.19 | 4257 |
32 | Wayland에 대한 간단한 소개 | makersweb | 2017.12.29 | 3672 |
31 | file_operations | makersweb | 2014.02.27 | 3425 |
30 | 리눅스에서 네트워크 구성 | makersweb | 2022.06.11 | 3418 |
29 | 리눅스 오디오 스택과 아키텍처 | makersweb | 2020.09.02 | 3395 |
28 | 리눅스 디렉터리 구조 | makersweb | 2014.02.28 | 3353 |
27 | 4. Makefile를 작성할 때 알면 좋은 것들 | pjk | 2014.02.05 | 3197 |
26 | Weston 의 설명 및 관련 컴포넌트 | makersweb | 2020.06.03 | 3041 |