Page 182 - DCAP602_NETWORK_OPERATING_SYSTEMS_I
P. 182

Network Operating Systems-I




                    notes          One file system, /usr, has two lines specifying exports to the same host, client. The correct format
                                   for this situation is:
                                   /usr/src /usr/ports  client
                                   The properties of one file system exported to a given host must all occur on one line. Lines without
                                   a client specified are treated as a single host. This limits how you can export file systems, but for
                                   most people this is not an issue.
                                   The  following  is  an  example  of  a  valid  export  list,  where  /usr  and  /exports  are  local  file
                                   systems:
                                   # Export src and ports to client01 and client02, but only
                                   # client01 has root privileges on it
                                   /usr/src /usr/ports -maproot=root    client01
                                   /usr/src /usr/ports               client02
                                   # The client machines have root and can mount anywhere
                                   # on /exports. Anyone in the world can mount /exports/obj read-only
                                   /exports -alldirs -maproot=root      client01 client02

                                   /exports/obj -ro
                                   The  mountd  daemon  must  be  forced  to  recheck  the  /etc/exports  file  whenever  it  has  been
                                   modified, so the changes can take effect. This can be accomplished either by sending a HUP
                                   signal to the running daemon:

                                   # kill -HUP `cat /var/run/mountd.pid`
                                   or by invoking the mountd rc script with the appropriate parameter:
                                   # /etc/rc.d/mountd onereload
                                   Alternatively, a reboot will make FreeBSD set everything up properly. A reboot is not necessary
                                   though. Executing the following commands as root should start everything up.
                                   On the NFS server:
                                   # rpcbind
                                   # nfsd -u -t -n 4
                                   # mountd -r

                                   On the NFS client:
                                   # nfsiod -n 4
                                   Now everything should be ready to actually mount a remote file system. In these examples the
                                   server’s name will be server and the client’s name will be client. If you only want to temporarily
                                   mount a remote file system or would rather test the configuration, just execute a command like
                                   this as root on the client:

                                   # mount server:/home /mnt
                                   This will mount the /home directory on the server at /mnt on the client. If everything is set
                                   up correctly you should be able to enter /mnt on the client and see all the files that are on the
                                   server.
                                   If you want to automatically mount a remote file system each time the computer boots, add the
                                   file system to the /etc/fstab file. Here is an example:
                                   server:/home   /mnt    nfs rw  0   0




          176                              LoveLy professionaL university
   177   178   179   180   181   182   183   184   185   186   187