NFS
Last update: 2006/8/7Since: 1994/2/22
- Display the info. (2006/8/7)
- Client Linux (added 2002/9/12)
- Automount client Linux (added 2002/7/9)
- Server (Linux) (added 2002/9/17)
- Sun4
(Automount client, Clients, Server, Synchronization)
- Contents
- Display info.
- Status
- % mount
% showmount -e hostname ...... What are exported by hostname. - Statistics
- % nfsstat -s
% nfsstat -c
- Status
- Client (RH7.1)
- Access control
Check /etc/sysconfig/ipchains, and add the following if needed.
- -A input -s 130.87.xxx.xxx -d 0/0 -p udp -j ACCEPT
- # service ipchains restart
- Starting daemons
To start automatically at boot time.
- # chkconfig portmap on
# chkconfig nfslock on
# chkconfig autofs on
- # service portmap start
# service nfslock start
# service autofs start
- Access control
- Automount client (RH7.2, Turbo7)
- Create a mount directory.
- # mkdir /misc
- Add the following entry into /etc/auto.master.
- /misc /etc/auto.misc
- A sample of /etc/auto.misc file.
- Q_and_A -ro,intr fs.kek.jp:/public/linux/Support/Q_and_A
Tips -ro,intr fs.kek.jp:/public/linux/Support/Tips - Access control
- Refer to "2. Client".
- Starting daemons
- Refer to "2. Client".
- Confirmation
- $ ls /misc/Q_and_A /misc/Tips
- Create a mount directory.
- Server (Linux)
- Starting NFS server.
With Turbo workstation 8 on 2002/9/12.
- Access control
Allow portmap access in /etc/hosts.allow. A sample is,
- portmap: soleil.kek.jp 130.87.32.99
- # /etc/rc.d/init.d/portmap start
- # /etc/rc.d/init.d/nfs start
Following daemons will be started.
- Starting NFS services:
Starting NFS quotas: OK
Starting NFS mountd: OK
Starting NFS daemon: OK
- -->
- # /usr/sbin/rpc.rquotad
Cannot register service: RPC: Unable to receive; errno = Connection refused
rpc.rquotad: unable to register (RQUOTAPROG, RQUOTAVERS, udp).
- -->
- /usr/sbin/rpc.mountd
Cannot register service: RPC: Unable to receive; errno = Connection refused
- Access control
- A sample of /etc/exports.
- /Lib soleil.kek.jp(rw)
/home lune.kek.jp(rw) soleil.kek.jp(rw) - Other operations.
- After changing /etc/exports
# /etc/rc.d/init.d/nfs reload
- or
- After changing /etc/exports
- Display status.
- #/usr/sbin/exportfs
#/usr/sbin/showmount -a
- Starting NFS server.
- Sun4
- Automount client
- Insert following line in "/etc/rc.local" to start automount daemon
- /usr/etc/automount -m -f /etc/auto.master
- Automount description
/etc/auto.master # mount point map file option /- /etc/auto.direct soft /home /etc/auto.indirect /etc/auto.direct # keyoption location /fs -ro fs:/public/linux /etc/auto.indirect # keyoption location cc -rw,soft procyon:/home/cc
* Mount point must be created previously.
- Insert following line in "/etc/rc.local" to start automount daemon
- Clients (Sun4)
- Start-up
biod daemons are started from /etc/rc.local
- NFS mount automatically at system boot time
Entries in "/etc/fstab".example) /dev/sd3a / 2 rw,nosuid 1 1 /dev/sd3d /usr 2 rw 1 2 /dev/sd3e /home 2 rw 1 3 fs:/public/sun /mnt/fs nfs ro,soft,retry=1 0 0
(4th line is NFS mount; mounts "/public/sun" of fs onto "/mnt/fs" with read only mode.)
- Manual mounting
- # mount -o option hostname:remote-filesystem local-directory
- # mount -o soft fs.kek.jp:/public/sun /mnt/fs
- # umount /mnt/fs
- Mounting all files of a file type.
When you changed NFS mount entry in /etc/fstab, enter the following command to activate new discription.- # umount -a -t nfs
# mount -a -t nfs
- Start-up
- Server (Sun4)
- System files
System program ... exportfs
Daemons ...... rpc.mounted & nfsd
- Start-up
/etc/rc.local- Calls exportfs ------ Reads /etc/exports, Creates /etc/xtab
Calls nfsd
Calls rpc.mountd ---- Reads /etc/xtab
- The directories to be shared are listed in "/etc/exports".
example) /home -access=host1:host2 ..... Permit to host1 & host2. /usr/local -ro,access=host3 ..... Permit to host3 with read only mode. /share -root=host1 ..... Permit to any hosts, Petmit to SU of host1.
- Manual operation
When you modified /etc/exports, the following procedure will make new list valid.
- # exportfs -a
- % exportfs
- System files
- Synchronization (Sun4)Time synchronization will be required.
- # rdate hostname
- Automount client
===========================
<출처: http://ccweb1.kek.jp/people/yashiro/guide/linux/manage/setup/nfs.html >