作者/来源:yixinu.com
栏目:运维/编程
日期:2012-04-11 14:21:16
1、挂载NFS
showmount [主机] 查看目的主机资源
[root@bogon ~]# showmount 192.168.0.101 …… [root@bogon ~]# mount 192.168.0.101:/var/ftp/pub /mnt/temp ……
如果 是rhel5
[root@bogon ~]# mount 192.168.0.101:/var/ftp/pub /mnt/temp -t nfs ……
2、自动挂载
步骤:
1、在 /etc/auto.master 中指定自动挂载的挂载点 ,指定挂载到 /mnt/autofs_temp,在 /etc/auto.my.misc 文件中配置
# # 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 /mnt/autofs_temp /etc/auto.my.misc ……
2、修改/etc/auto.my.misc文件,这里挂载ISO文件
…… # Details may be found in the autofs(5) manpage #cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom conf -fstype=iso9660,ro,loop,nosuid,nodev :/mnt/mydata/conf.iso ……
3、重新启动autofs服务
[root@bogon mnt]# service autofs stop Stopping automount: [ OK ] [root@bogon mnt]# service autofs start Starting automount: [ OK ]遇到问题:
service autofs reload 后,文件系统并没有挂载,目录找不到
[root@bogon ~]# cd /mnt/autofs_temp/conf -bash: cd: /mnt/autofs_temp/conf: No such file or directory
停止服务始终失败
[root@bogon mnt]# service autofs stop Stopping automount: [FAILED]但又可以启动
[root@bogon mnt]# service autofs start Starting automount: [ OK ]状态是正在运行
[root@bogon mnt]# service autofs status automount (pid 1669) is running...用以下方法解决了:
[root@bogon mnt]# service autofs status automount (pid 1669) is running... [root@bogon mnt]# kill -9 1669 [root@bogon mnt]# service autofs status automount dead but pid file exists #automount 已经挂了,但pid文件还在 [root@bogon mnt]# service autofs stop Stopping automount: [ OK ] [root@bogon mnt]# service autofs start Starting automount: [ OK ] [root@bogon mnt]# cd /mnt/autofs_temp/conf [root@bogon conf]# ls