Difference between revisions of "NFS"

From Ilianko
Line 4: Line 4:
 
*the output of rpcinfo -p servername run on the client
 
*the output of rpcinfo -p servername run on the client
  
Installation
+
== Конфигурационни файлове ==
  
The required packages are different depending on if the system is a client or a server. In this Howto, the server is the host that has the files you want to share and the client is the host that will be mounting the NFS share.
+
*''/etc/exports'' - задаване на споделените папки
NFSv4 client
+
*''/etc/default/nfs-common'' - настройка портове, ...
# apt-get install nfs-common  
+
*''/etc/default/nfs-kernel-server'' - настройки Kerberos, изключване nfs4, ...
NFSv4 server
 
# apt-get install nfs-kernel-server  
 
  
After you finish installing nfs-kernel-server, you might see failure to start nfs-kernel-server due to missing entries in /etc/exports. Remember to restart the service when you finish configuring.
+
 
 +
 
 +
== Инсталация ==
 +
 
 +
В зависимост дали машината е NFS клиент или NFS сървър се инсталира съответния пакет:
 +
 
 +
'''NFSv4 client'''
 +
# apt-get install nfs-common
 +
 
 +
'''NFSv4 server'''
 +
# apt-get install nfs-kernel-server  
  
 
For the error message:  
 
For the error message:  
Line 23: Line 31:
  
 
NFSv4 Server
 
NFSv4 Server
 +
Let's say we want to export our users' home directories in /home/users. First we create the export filesystem:
 +
# mkdir /export
 +
# mkdir /export/users
 +
and mount the real users directory with:
 +
# mount --bind /home/users /export/users
 +
To save us from retyping this after every reboot we add the following
 +
 +
line to /etc/fstab
 +
/home/users    /export/users  none    bind  0  0
 +
 +
In /etc/default/nfs-kernel-server we set:
 +
NEED_SVCGSSD=no # no is default
 +
because we are not activating NFSv4 security this time.
 +
 +
In /etc/default/nfs-common we set:
 +
NEED_IDMAPD=yes
 +
NEED_GSSD=no # no is default
 +
To export our directories to a local network 192.168.1.0/24
 +
 +
we add the following two lines to /etc/exports
 +
/export      192.168.1.0/24(rw,fsid=0,no_subtree_check,sync)
 +
/export/users 192.168.1.0/24(rw,nohide,insecure,no_subtree_check,sync)

Revision as of 17:25, 5 January 2012

If your problem involves the inability mount or export shares please also include: a copy of your /etc/exports file

  • the output of rpcinfo -p localhost run on the server
  • the output of rpcinfo -p servername run on the client

Конфигурационни файлове

  • /etc/exports - задаване на споделените папки
  • /etc/default/nfs-common - настройка портове, ...
  • /etc/default/nfs-kernel-server - настройки Kerberos, изключване nfs4, ...


Инсталация

В зависимост дали машината е NFS клиент или NFS сървър се инсталира съответния пакет:

NFSv4 client

# apt-get install nfs-common 

NFSv4 server

# apt-get install nfs-kernel-server 

For the error message: mount.nfs4: No such device

You will have to load the nfs module with the command

  1. modprobe nfs

NFSv4 without Kerberos

NFSv4 Server Let's say we want to export our users' home directories in /home/users. First we create the export filesystem:

  1. mkdir /export
  2. mkdir /export/users

and mount the real users directory with:

  1. mount --bind /home/users /export/users

To save us from retyping this after every reboot we add the following

line to /etc/fstab /home/users /export/users none bind 0 0

In /etc/default/nfs-kernel-server we set: NEED_SVCGSSD=no # no is default because we are not activating NFSv4 security this time.

In /etc/default/nfs-common we set: NEED_IDMAPD=yes NEED_GSSD=no # no is default To export our directories to a local network 192.168.1.0/24

we add the following two lines to /etc/exports /export 192.168.1.0/24(rw,fsid=0,no_subtree_check,sync) /export/users 192.168.1.0/24(rw,nohide,insecure,no_subtree_check,sync)