Sunteți pe pagina 1din 2

About NFS (Network File System) NFS is a client and server architecture based protocol, developed by Sun Microsy

stems. The main purpose of this protocol is sharing file/file system over networ k. In general, files/file system sharing between two UNIX machines. User on cli ent computer access remote file system over a network in manner similar to how l ocal storage accessed. Here we will discuss, how to access NFS share (exports) from the client. Assuming that HOST A (NFS Server) running NFS service (rpc.mountd, nfsd, rpc.rqu otad). Also you can confirm by executing following command on NFS Server. [root@localhost ~]# service nfs status rpc.mountd (pid 2919) is running... nfsd (pid 2916 2915 2914 2913 2910 2909 2908 2907) is running... rpc.rquotad (pid 2903) is running... [root@localhost ~]# Now login to the HOST B (NFS Client) execute following command, to find out shar ed directories in the NFS Server. [root@localhost ~]# showmount -e 192.168.1.4 Export list for 192.168.1.4: /mnt/array1/RHEL5 192.168.1.0/255.255.255.0 /mnt/array1/RHEL632 192.168.1.0/255.255.255.0 [root@localhost ~]# While entering showmount command, you have to specify IP/Hostname (FQDN) of the NFS Server. After getting exported file system information, you can access by th e mount command. [root@localhost ~]# mount -t nfs 192.168.1.4:/mnt/array1/RHEL5 /data/ Before mounting remote file system, first create mount point, here I have create d /data directory and mounted remote file system. Syntax: #mount -t vfstype [-o options] NFS Servername:/exporteddirectory /mount poin t or #mount -t nfs -o options host:/remote/export /local/directory Options: -t - Option specifies type of the file system that is NFS. -o intr this option is used in non reliable network, or network having more net work congestion. NFS request will be interrupted when server is not reachable. Example: [root@localhost ~]# mount -t nfs -o intr 192.168.1.4:/mnt/array1/RHEL5 /data/ [root@localhost ~]# mount | grep -i intr 192.168.1.4:/mnt/array1/RHEL5 on /data type nfs (rw,intr,addr=192.168.1.4) Hard if hard option is specified during nfs mount, user cannot terminate t he process waiting for NFS communication to resume. Example: [root@localhost ~]# mount -t nfs -o hard 192.168.1.4:/mnt/array1/RHEL5 /data/ [root@localhost ~]# mount | grep -i hard 192.168.1.4:/mnt/array1/RHEL5 on /data type nfs (rw,hard,addr=192.168.1.4) Soft- if soft option is specified during nfs mount, user will get error alert when NFS server is not reachable.

Example: [root@localhost ~]# mount -t nfs -o soft 192.168.1.4:/mnt/array1/RHEL5 /data/ [root@localhost ~]# mount | grep -i soft 192.168.1.4:/mnt/array1/RHEL5 on /data type nfs (rw,soft,addr=192.168.1.4)

[root@localhost ~]# Nfsvers=value-- if this option is specified during nfs mount NFS clien t uses particular NFS protocol version to communicate. Example: [root@localhost ~]# mount -t nfs -o nfsvers=3 192.168.1.4:/mnt/array1/RHEL5 /da ta/ [root@localhost ~]# mount | grep -i nfsvers 192.168.1.4:/mnt/array1/RHEL5 on /data type nfs (rw,nfsvers=3,addr=192.168.1.4) Tcp or UDP: As said above, NFS is client and server architecture based protocol and it can be used transport layer as TCP and UDP both depend upon the application requirement. Example: TCP [root@localhost ~]# mount -t nfs -o tcp 192.168.1.4:/mnt/array1/RHEL5 /data/ [root@localhost ~]# mount | grep -i tcp 192.168.1.4:/mnt/array1/RHEL5 on /data type nfs (rw,tcp,addr=192.168.1.4) Example: UDP [root@localhost ~]# mount -t nfs -o udp 192.168.1.4:/mnt/array1/RHEL5 /data/ [root@localhost ~]# mount | grep -i udp 192.168.1.4:/mnt/array1/RHEL5 on /data type nfs (rw,udp,addr=192.168.1.4)

S-ar putea să vă placă și