NFS
NFS
Scripts de arranque
# /sbin/init.d/nfs.server stop
# /sbin/init.d/nfs.client stop
# /sbin/init.d/nfs.client start
# /sbin/init.d/nfs.server start
-r-xr-xr-x 1 bin bin 10810 Jun 5 2007 nfs.client (arranca en 2)
-r-xr-xr-x 1 bin bin 6858 Sep 3 2003 nfs.core (arranca en 2)
-r-xr-xr-x 1 bin bin 8059 Sep 3 2003 nfs.server (arranca en 3)
/etc/rc.config.d/nfsconf (servidor)
# vi /etc/rc.config.d/nfsconf
NFS_SERVER=1 Set to 1 to ensure that the NFS server daemons start
START_MOUNTD=1 Set to 1 to ensure that the NFS mount daemon starts
NUM_NFSD=16 Configurable; determines the number of nfsd daemons
PCNFS_SERVER=0 Optional; set to 1 to enable to authentication of PC
NFS_TCP=1 Determines if NFS over TCP is enabled.
LOCKD_OPTIONS=”" Optional; defines options to pass to rpc.lockd.
STATD_OPTIONS=”" Optional; defines options to pass to rpc.statd.
MOUNTD_OPTIONS=”" Optional; defines options to pass to rpc.mountd.
/etc/rc.config.d/nfsconf (cliente
# vi /etc/rc.config.d/nfsconf
NFS_CLIENT=1 Set to 1 to ensure that the NFS client daemons start.
NUM_NFSIOD=16 Configurable; determines the number of biod daemons
LOCKD_OPTIONS=”" Optional; defines options to pass to rpc.lockd.
STATD_OPTIONS=”" Optional; defines options to pass to rpc.statd.
NFS_TCP=1 Determines whether NFS over TCP is enabled.
/etc/exports
/exportnfs -access=hosta:hostb
/export -ro
#exportfs -a
Procesos
rpc.lockd
rpc.statd
rpc.mountd
Comprobar qué se está exportando
#showmount -e
#exportfs
Comandos utiles (servidor)
# exportfs –i /opt Export a file system not listed in /etc/exports
# exportfs –u /opt Unexport a file system.
# exportfs –a Export all file systems listed in /etc/exports.
# exportfs –ua Unexport all file systems.
# showmount –a List clients with this server’s file systems currently mounted.
# rpcinfo –p List registered rpc programs (including rpc.mountd & nfsd).
# nfsstat Display NFS usage statistics.
# nfsstat –z Reset (zero) the nfsstat registers.
Comandos utiles (cliente)
# umount /app Unmount a specific NFS file system.
# umount –aF nfs Unmount all NFS file systems.
# mount –aF nfs Mount all NFS file systems.
# mount -v List all mounted file systems (including NFS file
# rpcinfo –p List all locally registered rpc programs (including
# rpcinfo –p svr List all rpc’s registered on the NFS server.
# showmount -e svr List file systems exported by an NFS server.
Automounter
Modificar /etc/rc.config.d/nfsconf
NFS_CLIENT=1 NFS client functionality is required!
AUTOMOUNT=1 Start the automount deamon at boot time.
AUTO_MASTER=”/etc/auto_master” Choose a “master map” file.
AUTO_OPTIONS=”-f $AUTO_MASTER” Specify logging, timeout and other options.
AUTOFS=0 Disable AutoFS.
(si es AUTOFS, AUTOFS=1 y AUTOMOUNT=0)
# view /etc/auto_master
/net –hosts -soft Automatically soft mounts file systems under /net.
/home /etc/auto.home Refers automounter to the /etc/auto.home map.
/data /etc/auto.data Refers automounter to the /etc/auto.data map.
/tools /etc/auto.tools Refers automounter to the /etc/auto.tools map.
ejemplo /usr/export “-o vers=3,proto=udp” SERVIDOR:/nombredelexport
Reiniciar con los cambios:
#automount -av
#kill pidautomount
# ps –ef | grep automount
# automount –f /etc/auto_master
(nunca matarlo con -9)