1 / 14

NFS - PowerPoint PPT Presentation

  • Uploaded on

NFS. Using Linux NFS. 安裝 NFS 服務. NFS 伺服器端必須安裝 NFS server 套件 若未安裝,則可安裝光碟中  ./RedHat/PPM  目錄下的 nfs-util 套件 使用 setup 由選單中選取 System services  進入 Services 的設定 nfs. Setting Up an NFS Server. Setting up the server will be done in two steps: Setting up the configuration files for NFS,

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'NFS' - ovid

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript


Using Linux NFS


  • NFS伺服器端必須安裝NFS server套件

  • 若未安裝,則可安裝光碟中 ./RedHat/PPM 目錄下的nfs-util套件

  • 使用setup由選單中選取System services 進入Services的設定nfs

Setting up an nfs server
Setting Up an NFS Server

  • Setting up the server will be done in two steps:

    • Setting up the configuration files for NFS,

    • and then starting the NFS services.

Setting up the configuration files
Setting up the Configuration Files

  • There are three main configuration files you will need to edit to set up an NFS server: /etc/exports, /etc/hosts.allow, and /etc/hosts.deny.

  • Strictly speaking, you only need to edit /etc/exports to get NFS to work, but you would be left with an extremely insecure setup.

Etc exports

  • A typical setup for /etc/exports might look like this:

    /usr/local /home

Starting the portmapper
Starting the Portmapper

  • NFS depends on the portmapper daemon, either called portmap or rpc.portmap.

  • It will need to be started first. It should be located in /sbin but is sometimes in /usr/sbin.

  • Most recent Linux distributions start this daemon in the boot scripts, but it is worth making sure that it is running before you begin working with NFS (just type ps aux | grep portmap).

The daemons
The Daemons

  • NFS serving is taken care of by five daemons:

    • rpc.nfsd, which does most of the work;

    • rpc.lockd and rpc.statd, which handle file locking;

    • rpc.mountd, which handles the initial mount requests,

    • and rpc.rquotad, which handles user file quotas on exported volumes.

The daemons1
The Daemons

  • Starting with 2.2.18, lockd is called by nfsd upon demand, so you do not need to worry about starting it yourself. statd will need to be started separately. Most recent Linux distributions will have startup scripts for these daemons.

  • The daemons are all part of the nfs-utils package, and may be either in the /sbin directory or the /usr/sbin directory.

Verifying that nfs is running
Verifying that NFS is running

  • To do this, query the portmapper with the command rpcinfo -p to find out what services it is providing.

  • If you do not at least see a line that says portmapper, a line that says nfs, and a line that says mountd then you will need to backtrack and try again to start up the daemons


  • 啟動NFS

    /etc/rc.d/init.d/nfs start

  • 停止

    /etc/rc.d/init.d/nfs stop

  • 設定在每次開機時可以自動啓動

    chkconfig nfs on

Making changes to etc exports later on
Making changes to /etc/exports later on

  • You should run the command exportfs –rato force nfsd to re-read the /etc/exports file.

  • If you can't find the exportfs command, then you can kill nfsd with the -HUP flag

Setting up an nfs client
Setting up an NFS Client

  • Mounting remote directories

  • Getting NFS File Systems to Be Mounted at Boot Time

Mounting remote directories
Mounting remote directories

建立掛載點(mount point),並修改

mkdir /mnt/home

mount /mnt/home

  • You can get rid of the file system by typing

    umount /mnt/home

Getting nfs file systems to be mounted at boot time
Getting NFS File Systems to Be Mounted at Boot Time

  • in /etc/fstab would look like: /mnt nfs rw,soft,intr 0 0