Softwares |
Main /
How-to-configure-NFS-The-Network-File-SystemMain.How-to-configure-NFS-The-Network-File-System HistoryHide minor edits - Show changes to output Changed lines 179-180 from:
to:
%blue%Man Pages: [root@wordsworth ~]# man -k exports exports (5) - NFS file systems being exported (for Kernel based NFS) [root@wordsworth ~]# man -k rpcinfo rpcinfo (8) - report RPC information Changed lines 155-180 from:
to:
%blue%NMAP check [root@wordsworth ~]# nmap localhost Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2007-08-12 20:23 IST Interesting ports on localhost (127.0.0.1): Not shown: 1668 closed ports PORT STATE SERVICE 21/tcp open ftp 22/tcp open ssh 53/tcp open domain 80/tcp open http 111/tcp open rpcbind 139/tcp open netbios-ssn 445/tcp open microsoft-ds 884/tcp open unknown 900/tcp open unknown 935/tcp open unknown 2049/tcp open nfs 3306/tcp open mysql Nmap finished: 1 IP address (1 host up) scanned in 0.321 seconds [root@wordsworth ~]# Changed lines 1-2 from:
to:
%blue%The network file system is based on RPC: Which allows the client to auto mount and access the file system. In RPC subroutines are executed on another address space, say on another computer. Deleted line 6:
Changed lines 136-137 from:
to:
%blue%Telnet check [root@wordsworth ~]# telnet localhost 2049 Trying 127.0.0.1... Connected to localhost (127.0.0.1). Escape character is '^]'. help Connection closed by foreign host. [root@wordsworth ~]# telnet localhost 111 Trying 127.0.0.1... Connected to localhost (127.0.0.1). Escape character is '^]'. help ^] telnet> q Connection closed. [root@wordsworth ~]# Added lines 137-141:
Reference: *http://www.linuxconfig.org/HowTo_configure_NFS#Scenario *http://centos.org/docs/4/html/rhel-sag-en-4/s1-nfs-additional-resources.html *http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch29_:_Remote_Disk_Access_with_NFS Added lines 103-106:
or echo "192.168.0.1:/data/itmission /media/itmission nfs defaults 0 0" >> /etc/fstab Changed lines 6-7 from:
to:
%blue%Softwares that are needed. Added line 14:
Changed lines 19-20 from:
% to:
%blue%Server exports file All NFS server exports need to be defined in /etc/exports file. Added lines 29-30:
/home/nfs/ 10.1.1.100(rw,sync,no_root_squash) export /home/nfs directory for host with IP 10.1.1.100 with read, write permissions, synchronized mode and the remote root user will not be treated as a root but as a default nfs user. Changed lines 42-43 from:
to:
%blue%Start Changed lines 55-56 from:
to:
%blue%Check if running or not Changed lines 103-109 from:
[root@wordsworth ~]# nfsstat -s to:
%blue%Manually Mounting NFS File Systems: mount -t nfs 192.168.0.1:/data/itmission /media/itmission %blue%Stats [root@wordsworth ~]# nfsstat -s Changed lines 114-118 from:
[root@wordsworth ~]# cat /etc/services |grep nfs nfs 2049/tcp nfsd nfs 2049/udp nfsd [root@wordsworth ~]# to:
[root@wordsworth ~]# cat /etc/services |grep nfs nfs 2049/tcp nfsd nfs 2049/udp nfsd [root@wordsworth ~]# Changed lines 127-129 from:
to:
%blue%Restart NFS daemon or run command exportfs: exportfs -ra Changed lines 113-117 from:
to:
[root@wordsworth ~]# cat /etc/services |grep portmap sunrpc 111/tcp portmapper # RPC 4.0 portmapper TCP sunrpc 111/udp portmapper # RPC 4.0 portmapper UDP rpc2portmap 369/tcp rpc2portmap 369/udp # Coda portmapper [root@wordsworth ~]# Changed lines 101-103 from:
* Server rpc stats: calls badcalls badauth badclnt xdrcall to:
*Stats [root@wordsworth ~]# nfsstat -s Server rpc stats: calls badcalls badauth badclnt xdrcall Changed lines 108-111 from:
to:
[root@wordsworth ~]# cat /etc/services |grep nfs nfs 2049/tcp nfsd nfs 2049/udp nfsd [root@wordsworth ~]# Changed lines 101-104 from:
to:
*[root@wordsworth ~]# nfsstat -s Server rpc stats: calls badcalls badauth badclnt xdrcall 0 0 0 0 0 Changed lines 15-17 from:
to:
*Configuring NFS on The Server: The /etc/exports file is the main NFS configuration file, and it consists of two columns. The first part lists the networks or DNS domains that can get access to the directory, and the second part lists NFS options in brackets. Changed lines 30-32 from:
to:
%blue%Service needed to start: * nfs, RPC, portmap, nfslock (NFS file locking to reduce the risk of corrupted data.) # chkconfig --level 35 nfs on # chkconfig --level 35 nfslock on # chkconfig --level 35 portmap on *Start [root@wordsworth ~]# service portmap start Starting portmap: [ OK ] [root@wordsworth ~]# service nfs start Starting NFS services: [ OK ] Starting NFS quotas: [ OK ] Starting NFS daemon: [ OK ] Starting NFS mountd: [ OK ] [root@wordsworth ~]# service nfslock start Starting NFS statd: [ OK ] [root@wordsworth ~]# *Check if running or not [root@wordsworth ~]# rpcinfo -p localhost program vers proto port 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100011 1 udp 881 rquotad 100011 2 udp 881 rquotad 100011 1 tcp 884 rquotad 100011 2 tcp 884 rquotad 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 4 udp 2049 nfs 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100003 4 tcp 2049 nfs 100021 1 udp 37666 nlockmgr 100021 3 udp 37666 nlockmgr 100021 4 udp 37666 nlockmgr 100021 1 tcp 59071 nlockmgr 100021 3 tcp 59071 nlockmgr 100021 4 tcp 59071 nlockmgr 100005 1 udp 897 mountd 100005 1 tcp 900 mountd 100005 2 udp 897 mountd 100005 2 tcp 900 mountd 100005 3 udp 897 mountd 100005 3 tcp 900 mountd 100024 1 udp 932 status 100024 1 tcp 935 status [root@wordsworth ~]# %blue%On Client Machine. [root@wordsworth ~]# service netfs start Mounting other filesystems: [ OK ] [root@wordsworth ~]# service portmap start Starting portmap: [ OK ] [root@wordsworth ~]# service nfslock start Starting NFS statd: [ OK ] %blue%Mounting NFS with fstab #/etc/fstab #Directory Mount Point Type Options Dump FSCK 192.168.0.1:/data/itmission /media/itmission nfs soft,nfsvers=2 0 0 *Manually Mounting NFS File Systems: # mount -t nfs 192.168.0.1:/data/itmission /media/itmission Changed lines 14-16 from:
to:
*RPC portmap package is needed. *Configuring NFS on The Server: The /etc/exports file is the main NFS configuration file, and it consists of two columns. The first part lists the networks or DNS domains that can get access to the directory, and the second part lists NFS options in brackets. %example% #/etc/exports /data/itmission *(ro,sync) /home 192.168.0.0/24(rw,sync) /data/itmission1 *.itmission.org(rw,sync) /data/itmission2 192.168.1.203/32(rw,sync) *Read-only access to the /data/itmission directory to all networks *Read/write access to the /home directory from all servers on the 192.168.1.0 /24 network, which is all addresses from 192.168.1.0 to 192.168.1.255 *The sync option to ensure that file data cached in memory is automatically written to the disk after the completion of any disk data copying operation. Added lines 6-16:
*Softwares that are needed. [root@wordsworth ~]# rpm -qa | grep nfs nfs-utils-lib-1.0.6-8 nfs-utils-1.0.6-80.EL4 system-config-nfs-1.2.8-1 [root@wordsworth ~]# rpm -q portmap portmap-4.0-63 [root@wordsworth ~]# Added lines 1-5:
*The network file system is based on RPC, which allows the client to auto mount and access the file system. In RPC subroutines are executed on another address space, say on another computer. [root@wordsworth ~]# cat /proc/filesystems |