资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

NFS自动mount的使用-创新互联

环境介绍:

成都创新互联公司专注于企业营销型网站建设、网站重做改版、久治网站定制设计、自适应品牌网站建设、H5页面制作商城网站开发、集团公司官网建设、外贸营销网站建设、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为久治等各大城市提供网站开发制作服务。

REDHAT 5.1 64BIT*2

[@more@]

由于环境中需要挂载远端系统,所以就用NFS来实现,为了在系统启动的时候或者用户访问的时候就进行挂载不用手动参与,于是就用linux的autofs功能来实现:

source OS:

[root@szpa-bak-db2 ~]# more /etc/exports /u02/backupset/140_expback 16.41.169.139(rw,no_root_squash)
[root@szpa-bak-db2 ~]#

target OS:

[oracle@localhost exp_back]$ more /etc/auto.master #
# $Id: auto.master,v 1.4 2005/01/04 14:36:54 raven Exp $
#
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#
/misc /etc/auto.misc
/net -hosts
/u02/backup/expbk /etc/auto.nfs#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master

[oracle@localhost exp_back]$ more /etc/auto.nfs exp_back -rw,bg,hard,rsize=32768,wsze=32768 16.41.169.140:/u02/backupset/140_expback[root@localhost exp_back]# /etc/init.d/autofs restart
Stopping automount: [ OK ]
Starting automount: [ OK ]

自动挂载演示:

[root@localhost u02]# mount/dev/cciss/c0d0p3 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/cciss/c0d0p6 on /u02 type ext3 (rw)
/dev/cciss/c0d0p2 on /u01 type ext3 (rw)
/dev/cciss/c0d0p1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
[root@localhost u02]# cd /u02/backup/expbk/exp_back/
[root@localhost exp_back]# ls
abc
[root@localhost exp_back]# mount;df/dev/cciss/c0d0p3 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/cciss/c0d0p6 on /u02 type ext3 (rw)
/dev/cciss/c0d0p2 on /u01 type ext3 (rw)
/dev/cciss/c0d0p1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
16.41.169.140:/u02/backupset/140_expback on /u02/backup/expbk/exp_back type nfs (rw,soft,rsize=32768,wsze=32768,addr=16.41.169.140)
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/cciss/c0d0p3 49594228 9928852 37105420 22% /
/dev/cciss/c0d0p6 285521444 232729476 38054344 86% /u02
/dev/cciss/c0d0p2 49594228 44736880 2297392 96% /u01
/dev/cciss/c0d0p1 101086 12533 83334 14% /boot
tmpfs 8201032 0 8201032 0% /dev/shm
16.41.169.140:/u02/backupset/140_expback
585057792 168249760 386609472 31% /u02/backup/expbk/exp_back
[root@localhost exp_back]#


分享标题:NFS自动mount的使用-创新互联
网页URL:http://cdkjz.cn/article/dodsdj.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220