Это старая версия документа.


Сетевая файловая система (NFS)

NFS позволяет системе предоставлять в общее пользование каталоги и файлы другим системам через сеть. С помощью NFS пользователи и программы могут получить доступ к файлам на удаленной системе так же, как если бы они были локальными файлами.

Некоторые наиболее значимые преимущества, предоставляемые NFS:

  1. Локальные рабочие станции используют меньше дискового пространства, поскольку совместно используемые данные можно сохранять на одной машине, а другим предоставлять к ним доступ по сети.

  2. Нет необходимости пользователям иметь отдельные домашние каталоги на каждом компьютере в сети. Домашние каталоги могут устанавливаться на NFS сервер и предоставляться через сеть.

  3. Такие накопители, как флоппи-дисководы, CDROM и USB флэш диски могут использоваться другими машинами в сети. Это может уменьшить количество приводов удаляемых устройств в вашей сети.

Установка

At a terminal prompt enter the following command to install the NFS Server:

sudo apt-get install nfs-kernel-server

Настройка

You can configure the directories to be exported by adding them to the /etc/exports file. For example:

/ubuntu *(ro,sync,no_root_squash) /home *(rw,sync,no_root_squash)

You can replace * with one of the hostname formats. Make the hostname declaration as specific as possible so unwanted systems cannot access the NFS mount.

To start the NFS server, you can run the following command at a terminal prompt:

sudo /etc/init.d/nfs-kernel-server start

Настройка клиента NFS

Use the mount command to mount a shared NFS directory from another machine, by typing a command line similar to the following at a terminal prompt:

sudo mount example.hostname.com:/ubuntu /local/ubuntu

The mount point directory /local/ubuntu must exist. There should be no files or subdirectories in the /local/ubuntu directory.

An alternate way to mount an NFS share from another machine is to add a line to the /etc/fstab file. The line must state the hostname of the NFS server, the directory on the server being exported, and the directory on the local machine where the NFS share is to be mounted.

The general syntax for the line in /etc/fstab file is as follows:

example.hostname.com:/ubuntu /local/ubuntu nfs rsize=8192,wsize=8192,timeo=14,intr

If you have trouble mounting an NFS share, make sure the nfs-common package is installed on your client. To install nfs-common enter the following command at the terminal prompt:

sudo apt-get install nfs-common

Ссылки

Linux NFS faq

Ubuntu Wiki NFS Howto