Professional Documents
Culture Documents
http://web.mit.edu/rhel-doc/3/rhel-rg-es-3/s1-nfs-server-export.html
Anterior
Red Hat Enterprise Linux 3: Manual de referencia Captulo 9. Sistema de archivos de red (NFS)
Siguiente
En esta estructura, reemplace <export> con el directorio a exportar, reemplace <host1> con el host o la red a la cual est siendo compartida la exportacin y reemplace <options> con las opciones para cada host o red. Los hosts adicionales se pueden especificar en una lista separada por espacios. Se pueden usar los mtodos siguientes para especificar nombres de host: una sola mquina Cuando una mquina en particular es especificada con nombre completo de dominio, nombre de mquina o direccin IP. comodines Usamos un carcter * o ? para referirnos a un grupo de nombres completos de dominio o direcciones IP o que coincidan con una cadena particular de letras. Los comodines no son usados con direcciones IP; sin embargo, es posible para estos funcionar accidentalmente si fallan las bsquedas de DNS inversas. Tenga cuidado cuando especifique comodines con nombres de dominio
1 of 5 27/03/2007 9:16
http://web.mit.edu/rhel-doc/3/rhel-rg-es-3/s1-nfs-server-export.html
completos, pues tienden a ser ms exactos de lo que usted cree. Por ejemplo, el uso de *.example.com como comodn, permitir a ventas.domain.com acceder al sistema de archivos exportado, pero no a bob.ventas.domain.com. Para permitir ambas posibilidades, debera usar *.example.com y tambin *.*.example.com redes IP Permite la coincidencia de hosts basados en sus direcciones IP dentro de una red ms grande. Por ejemplo, 192.168.0.0/28 permite al acceso a las primeras 16 direcciones IP, desde la 192.168.0.0 a la 192.168.0.15, acceder al sistema de archivos exportado, pero no a la 192.168.0.16 y superiores. grupos de redes Permite usar un nombre de grupo de red NIS, escrito como @<group-name>. Esto pone al servidor NIS controlando el acceso de este sistema de archivos, donde los usuarios pueden ser aadidos o borrados de un grupo NIS sin que afecte a /etc/exports. En su forma ms sencilla, /etc/exports slo necesita saber el directorio a exportar y los hosts que pueden usarlo, como en el ejemplo siguiente: /exported/directory bob.example.com
En el ejemplo, bob.example.com puede montar /exported/directory/. Como no se especifica ninguna opcin en este ejemplo, tomarn efecto las siguientes opciones predeterminadas de NFS: ro Se montan los sistemas de archivos como de slo lectura (read-only). Los host remotos no pueden hacer cambios a los datos compartidos en el sistema de archivos. Para permitir que los hosts puedan hacer cambios, debe especificar la opcin rw (lectura-escritura, read-write). async Permite al servidor escribir los datos en el disco a intervalos irregulares. Esta configuracin funciona mejor si el sistema de archivos exportado es de slo lectura. Si el sistema de archivos de lectura/escritura y los hosts estn haciendo cambios al sistema de archivos cuando el servidor se cae o se apaga, se pueden perder datos. Especificando la opcin sync, todas las escrituras en el disco se efectan antes de que la peticin de escritura del cliente se haya completado. Sin embargo, la opcin sync, puede que disminuya el rendimiento. wdelay Provoca que el servidor NFS retrase el escribir a disco si sospecha que otra peticin de escritura es inminente. Esto puede mejorar el rendimiento reduciendo las veces que se debe acceder al disco por comandos de escritura separados. Use no_wdelay para desactivar esta opcin, la cual slo funciona si est usando la opcin sync. root_squash Prevents root users connected remotely from having root
2 of 5
27/03/2007 9:16
http://web.mit.edu/rhel-doc/3/rhel-rg-es-3/s1-nfs-server-export.html
privileges and assigns them the user ID for the user nfsnobody. This effectively "squashes" the power of the remote root user to the lowest local user, preventing unauthorized alteration of files on the remote server. Alternatively, the no_root_squash option turns off root squashing. To squash every remote user, including root, use the all_squash option. To specify the user and group IDs to use with remote users from a particular host, use the anonuid and anongid options, respectively. In this case, a special user account can be created for remote NFS users to share and specify (anonuid=<uid-value>,anongid=<gid-value>), where <uid-value> is the user ID number and <gid-value> is the group ID number.
Importante Por defecto, las listas de control de acceso (ACLs) son soportadas por NFS bajo Red Hat Enterprise Linux. Para desactivar esta funcionalidad, especifique la opcin no_acl cuando est exportando el sistema de archivos. Para ms informacin sobre esta funcionalidad, vea el captulo Sistemas de archivo de red (NFS) en el Manual de administracin del sistema de Red Hat Enterprise Linux.
Cada valor predeterminado para un sistema de archivos exportado debe ser explcitamente ignorado. Por ejemplo, si no se especifica la opcin rw, entonces el sistema de archivos es exportado como de slo lectura. Lo siguiente es una lnea de muestra de /etc/exports la cual sobreescribe dos opciones predeterminadas: /another/exported/directory 192.168.0.3(rw,sync)
En este ejemplo 192.168.0.3 puede montar /another/exported/directory/ como lectura/escritura y todas las transferencias al disco son efectuadas antes de completar la peticin de escritura del cliente. Adicionalmente, hay otra opciones que estn disponibles que no tienen especificado un valor predeterminado. Estas incluyen la habilidad de desactivar la verificacin por subdirectorios, permitir el acceso desde puertos inseguros y permitir bloquear archivos inseguros (necesario para algunas implementaciones antiguas de clientes NFS). Vea la pgina man de exports para estas opciones menos usadas.
Aviso La manera en que el archivo /etc/exports est organizado es muy importante, particularmente lo que concierne a los espacios en blanco. Recuerde separar siempre los sistemas de archivos exportados de
3 of 5
27/03/2007 9:16
http://web.mit.edu/rhel-doc/3/rhel-rg-es-3/s1-nfs-server-export.html
una mquina a la otra, con un espacio. Sin embargo, no debera haber otros espacios en el archivo a menos que se usen en lneas comentadas. Por ejemplo, las siguientes dos lneas significan cosas distintas: /home bob.example.com(rw) /home bob.example.com (rw)
La primera lnea permite slo a los usuarios de bob.example.com acceder en modo de lectura/escritura al directorio /home. La segunda lnea permite a los usuarios de bob.example.com montar el directorio de slo lectura (el predeterminado), pero el resto del mundo puede instalarlo como lectura/escritura.
Para instrucciones detalladas sobre la configuracin de un servidor NFS modificando /etc/exports, consulte el captulo titulado Sistemas de archivos de red (NFS) en el Manual de administracin del sistema de Red Hat Enterprise Linux.
4 of 5
27/03/2007 9:16
http://web.mit.edu/rhel-doc/3/rhel-rg-es-3/s1-nfs-server-export.html
especificados en /etc/exports. -o file-systems Permite especificar directorios a exportar que no estn listados en /etc/exports. Reemplace file-systems con los sistemas de archivos adicionales a exportar. Estos sistemas de archivos deben tener el mismo formato en que fueron especificados en /etc/exports. Consulte la Seccin 9.3.1 para ms informacin sobre la sintaxis de /etc/exports. Esta opcin es usada para probar un sistema de archivos antes de aadirlo permanentemente a la lista de sistemas a exportar. -i Ignora /etc/exports; slo las opciones dadas desde la lnea de comandos son usadas para definir los sistemas de archivos exportados. -u No exporta todos los directorios compartidos. El comando /usr/sbin/exportfs -ua suspende la comparticin de archivos NFS mientras que mantiene todos los demonios NFS activos. Para reactivar la comparticin NFS, teclee exportfs -r. -v Operacin descriptiva, donde los sistemas de archivos exportados o dejados de exportar son mostrados en gran detalle al ejecutarse el comando exportfs. Si no se pasan opciones al comando /usr/sbin/exportfs, mostrar una lista de los sistemas de archivos actualmente exportados. Para ms informacin sobre /usr/sbin/exportfs, vaya a la pgina man de exportfs. Anterior Iniciar y detener NFS Inicio Subir Siguiente Archivos de configuracin de clientes NFS
5 of 5
27/03/2007 9:16
http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/ref-gui...
Search Docs:
Go
Red Hat Docs > Manuals > Red Hat Linux Manuals > Red Hat Linux 9 >
Prev
Red Hat Linux 9: Red Hat Linux Reference Guide Chapter 9. Network File System (NFS)
Next
9.3.1. /etc/fstab
Placing a properly formatted line in the /etc/fstab file has the same effect as manually mounting the exported file system. The /etc/fstab file is read by the /etc/rc.d/init.d/netfs script at system startup and any NFS shares listed there will be mounted. A sample /etc/fstab line to mount an NFS export looks like the following: <server>:</path/of/dir> </local/mnt/point> nfs <options> 0 0
The <server-host> corresponds to hostname, IP address, or fully qualified domain name of the server exporting the file system. The </path/of/directory> is the path to the exported directory. The </local/mount/point> specifies where on the local file system to mount the exported directory. This mount point must exist before /etc/fstab is read or the mount will fail. The nfs option specifies the type of file system being mounted. The <options> area specifies mount options for the file system. For example, if the options area states rw,suid, the exported file system will be mounted read-write and the user and groupid set by the server will be used. Note that parentheses are not to be used here. For more mount options, see Section 9.3.3 Common NFS Mount Options.
9.3.2. autofs
One drawback to using /etc/fstab is that, regardless of how infrequently a user
1 of 4
27/03/2007 9:16
http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/ref-gui...
may access the NFS mounted file system, the system must dedicate resources to keep that mount in place. This is not a problem with one or two mounts, but when the system is maintaining mounts to a dozen systems at one time, overall system performance can suffer. An alternative to /etc/fstab is to use the kernel-based automount utility, which will mount and unmount NFS file systems automatically, saving resources. The autofs script, located in the /etc/rc.d/init.d/ directory, is used to control automount through the /etc/auto.master primary configuration file. While automount can be specified on the command line, it is more convenient to specify the mount points, hostname, exported directory, and options in a set of files rather than typing them all by hand. By running autofs as a service that starts and stops in designated runlevels, the mount configurations in the various files can be automatically implemented. The autofs configuration files are arranged in a parent-child relationship. A main configuration file (/etc/auto.master) refers mount points on your system that are linked to a particular map type, which take the form of other configuration files, programs, NIS maps, and other less common mount methods. The auto.master file contains lines referring to each of these mount points, organized like this: <mount-point> <map-type>
The <mount-point> element of this line indicates the location of the mount on the local file system. The <map-type> relates to the way in which the mount point will be mounted. The most common method for auto mounting NFS exports is to use a file as the map type for the particular mount point. The map file, usually named auto.<mount-point>, where <mount-point> is the mount point designated in auto.master, contains lines that look like this: <directory> <mount-options> <host>:<exported-file-system>
The <directory> refers to the directory within the mount point where the exported file system should be mounted. Much like a standard mount command, the host exporting the file system, as well as the file system being exported, are required in the <host>:<exported-file system> section. To specify particular options to be used when mounting the exported file system, place them in the <mount-options> section, separated by commas. For NFS mounts that use autofs, place -fstype=nfs in the <mount-options> section. While autofs configuration files can be used for a variety of mounts to many types of devices and file systems, they are particularly useful in creating NFS mounts. For example, some organizations store a user's /home/ directory on a central server via an NFS share. Then, they configure the auto.master file on each of the
2 of 4
27/03/2007 9:16
http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/ref-gui...
workstations to point to an auto.home file containing the specifics for how to mount the /home/ directory via NFS. This allows the user to access personal data and configuration files in their /home/ directory by logging in anywhere on the internal network. The auto.master file in this situation would look similar to this: /home /etc/auto.home
This sets up the /home/ mount point on the local system to be configured by the /etc/auto.home file, which may look similar to this: * -fstype=nfs,soft,intr,rsize=8192,wsize=8192,nosuid server.example.com:/home
This line states that any directory a user tries to access under the local /home/ directory (due to the asterisk character) should result in an NFS mount on the server.example.com system within its exported /home/ file system. The mount options specify that each /home/ directory NFS mounts should use a particular collection of settings. For more information on mount options, including the ones used in this example, see Section 9.3.3 Common NFS Mount Options.
3 of 4
27/03/2007 9:16
http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/ref-gui...
noexec does not permit the execution of binaries on the mounted file system. This is useful if the system is mounting a non-Linux file system via NFS that contains incompatible binaries. nosuid does not allow set-user-identifier or set-group-identifier bits to take effect. rsize=8192 and wsize=8192 may speed up NFS communication for reads (rsize) and writes (wsize) by setting a larger data block size, in bytes, to be transferred at one time. Be careful when changing these values; some older Linux kernels and network cards may not work well with larger block sizes. nfsvers=2 or nfsvers=3 specify which version of the NFS protocol to use. Many more options are listed on the mount man page, including options for mounting non-NFS file systems. Prev NFS Server Configuration Files Home Up Next Securing NFS
4 of 4
27/03/2007 9:16
http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/...
Search Docs:
Go
Red Hat Docs > Manuals > Red Hat Enterprise Linux Manuals >
Prev
Red Hat Enterprise Linux 3: System Administration Guide Chapter 23. Network File System (NFS)
Next
Warning The mount point directory on local machine (/misc/local in the above example) must exist.
In this command, shadowman.example.com is the hostname of the NFS file server, /misc/export is the directory that shadowman is exporting, and /misc/local is the location to mount the file system on the local machine. After the mount command runs (and if the client has proper permissions from the shadowman.example.com NFS server) the client user can execute the command ls /misc/local to display a listing of the files in /misc/export on shadowman.example.com.
The mount point /pub must exist on the client machine. After adding this line to /etc/fstab on the client system, type the command mount /pub at a shell prompt, and the mount point /pub will be mounted from the server.
1 of 4
27/03/2007 9:16
http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/...
The first field in /etc/auto.misc is the name of the /misc subdirectory. This directory is created dynamically by automount. It should not actually exist on the client machine. The second field contains mount options such as rw for read and write access. The third field is the location of the NFS export including the hostname and directory.
Note The directory /misc must exist on the local file system. There should be no subdirectories in /misc on the local file system.
Autofs is a service. To start the service, at a shell prompt, type the following commands:
2 of 4
27/03/2007 9:16
http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/...
To view the active mount points, type the following command at a shell prompt: /sbin/service autofs status
If you modify the /etc/auto.master configuration file while autofs is running, you must tell the automount daemon(s) to reload by typing the following command at a shell prompt: /sbin/service autofs reload
To learn how to configure autofs to start at boot time, refer to Chapter 21 Controlling Access to Services for information on managing services.
Since the default is UDP, if the -o tcp option is not specified, the NFS-exported file system is accessed via UDP. The advantages of using TCP include the following:
3 of 4
27/03/2007 9:16
http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/...
Improved connection durability, thus less NFS stale file handles messages. Performance gain on heavily loaded networks because TCP acknowledges every packet, unlike UDP which only acknowledges completion. TCP has better congestion control than UDP (which has none). On a very congested network, UDP packets are the first types of packet that are dropped. Which means if NFS is writing data (in 8K chunks) all of that 8K has to retransmitted. With TCP because of its reliability, one parts of that 8K data is transmitted at a time. Error detection. When a tcp connection breaks (due to the server going down) the client stops sending data and starts the reconnection process. With UDP, since its connection-less, the client continue to pound the network with data until server comes up. The main disadvantage is that there is a very small performance hit due to the overhead associated with the TCP protocol.
4 of 4
27/03/2007 9:16