7.然后我们可以使用exportfs命令查询输出的目录

[root@secDB1 oracle]# exportfs

/home/oracle/sql

<world>

8.NFS服务客户端挂载目录方法

[root@secDB2 tmp]# mount 20.20.10.1:/home/oracle/sql /home/oracle/sql

注意,此时如果本机的/home/oracle/sql目录下存在内容将会被新加载的目录内容所替换,直到umount.

使用df命令查看挂在后的效果

[root@asddevdb ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

127G  109G   12G  91% /

/dev/cciss/c0d0p1      99M   13M   82M  13% /boot

tmpfs                 2.0G     0  2.0G   0% /dev/shm

20.20.10.1:/home/oracle/sql

234G  187G   36G  85% /home/oracle/sql

9.卸载方法

# umount /home/oracle/sql

10.保证系统重启后仍能自动挂在脚本目录

修改/etc/rc.d/rc.local文件

[root@secDB2 ~]# vi /etc/rc.d/rc.local

#!/bin/sh

#

# This script. will be executed *after* all the other init scripts.

# You can put your own initialization stuff in here if you don't

# want to do the full Sys V style. init stuff.

touch /var/lock/subsys/local

mount 20.20.10.1:/home/oracle/sql /home/oracle/sql

11.NFS服务脚本创建小结

在Linux操作系统上经过如上一番的配置,我们便可以只在一台服务器上启动NFS服务,让其他所有服务器挂载这个共享的目录.从此我们将不会再因一个脚本的小变化而去手工同步不同服务器上的脚本了.自动化并解放双手是我们永恒的追求……


相关内容