免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 6129 | 回复: 11
打印 上一主题 下一主题

as5 系统中 mount nfs服务器添加到/etc/rc.local中无法执行成功 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-03-20 11:48 |只看该作者 |正序浏览
as5 系统中  mount nfs服务器添加到/etc/rc.local中无法执行成功

mount -t nfs 192.168.1.2:/home/nfs  /home/nfs_client

[ 本帖最后由 stormcc 于 2008-3-20 11:50 编辑 ]

论坛徽章:
0
12 [报告]
发表于 2008-03-27 11:52 |只看该作者

问题得到解决了

问题得到解决了,感谢 jerrywjl  kenduest

问题处理的过程是这样的,我把该mount指令的 正确错误输出到 一个文本文件中,重启服务器后发现,文件中报mout执行失败,没有到主机的路由。但是我服务器与nfs服务器在同一个内网段,不会出现内网路由问题。怀疑是服务器的内网网卡有些问题(可能是网卡初始化短时间没有完成等等,尚不清楚……)

于是在服务器mount指令前添加了一个到nfs服务器的一个ping指令 ping -c 100 192.168.161.202 ,重启服务器后发现服务器已经mount上NFS服务器了,检查ping命令执行结果如下:

From 192.168.161.127 icmp_seq=1 Destination Host Unreachable
From 192.168.161.127 icmp_seq=2 Destination Host Unreachable
From 192.168.161.127 icmp_seq=3 Destination Host Unreachable
From 192.168.161.127 icmp_seq=5 Destination Host Unreachable
From 192.168.161.127 icmp_seq=6 Destination Host Unreachable
From 192.168.161.127 icmp_seq=7 Destination Host Unreachable
From 192.168.161.127 icmp_seq=9 Destination Host Unreachable
From 192.168.161.127 icmp_seq=10 Destination Host Unreachable
From 192.168.161.127 icmp_seq=11 Destination Host Unreachable
From 192.168.161.127 icmp_seq=13 Destination Host Unreachable
From 192.168.161.127 icmp_seq=14 Destination Host Unreachable
From 192.168.161.127 icmp_seq=15 Destination Host Unreachable
From 192.168.161.127 icmp_seq=17 Destination Host Unreachable
From 192.168.161.127 icmp_seq=18 Destination Host Unreachable
From 192.168.161.127 icmp_seq=19 Destination Host Unreachable
64 bytes from 192.168.161.202: icmp_seq=20 ttl=64 time=1.22 ms
64 bytes from 192.168.161.202: icmp_seq=21 ttl=64 time=0.090 ms
64 bytes from 192.168.161.202: icmp_seq=22 ttl=64 time=0.089 ms
64 bytes from 192.168.161.202: icmp_seq=23 ttl=64 time=0.113 ms
64 bytes from 192.168.161.202: icmp_seq=24 ttl=64 time=0.118 ms
64 bytes from 192.168.161.202: icmp_seq=25 ttl=64 time=0.189 ms
64 bytes from 192.168.161.202: icmp_seq=26 ttl=64 time=0.128 ms
。。。。。。。
。。。。。。。
64 bytes from 192.168.161.202: icmp_seq=97 ttl=64 time=0.126 ms
64 bytes from 192.168.161.202: icmp_seq=98 ttl=64 time=0.134 ms
64 bytes from 192.168.161.202: icmp_seq=99 ttl=64 time=0.165 ms
64 bytes from 192.168.161.202: icmp_seq=100 ttl=64 time=0.090 ms


--- 192.168.161.202 ping statistics ---
100 packets transmitted, 81 received, +15 errors, 19% packet loss, time 99013ms
rtt min/avg/max/mdev = 0.070/0.139/1.221/0.127 ms, pipe 4

论坛徽章:
0
11 [报告]
发表于 2008-03-26 15:58 |只看该作者
原帖由 stormcc 于 2008-3-26 14:14 发表
谢谢楼上两位,我刚刚做的测试,仍然无法mount上nfs服务器端,在这里将我本机客户端的配置贴一下,谢谢!

  1. 192.168.161.202:/home/monitor/mount/monitor_client /home/monitor_client nfs defaults 1 4
复制代码


後面改成 0 0 吧,難道你的 nfs fs 可以運作於 dump 與 fsck 使用嗎 ? 再來 nfs 不要傳入 defaults,這是安全大漏洞,因為若是又跑 setuid 屬性權限檔案就會有機會被取得 root 權限。

我建議你若是要測試,你可以把 mount 敘述寫在 /etc/rc.local 內,後面多加個 sleep 30 這樣可以 delay 30sec 顯示畫面。另外改一下 /boot/grub/menu.lst 或是是開機到 grub 時改一下傳入 kernel 參數,先把 rhgb 與 quiet 拿掉,這樣開機過程跑到 rc.local 就會知道問題點。

題外話的是,有許多人竟然在 windows 改 rc.local 後 upload 到主機,這樣會有問題,因為換行字元不一樣會產生錯誤。

--

论坛徽章:
0
10 [报告]
发表于 2008-03-26 14:14 |只看该作者

谢谢楼上两位,仍然无法mount上nfs服务器端

谢谢楼上两位,我刚刚做的测试,仍然无法mount上nfs服务器端,在这里将我本机客户端的配置贴一下,谢谢!

[linux@localhost ~]$
[linux@localhost ~]$ chkconfig --list | grep portmap
portmap         0ff   1ff   2ff   3n    4ff   5ff   6ff
[linux@localhost ~]$ chkconfig --list | grep netfs  
netfs           0ff   1ff   2ff   3:on    4:off   5:off   6:off
[linux@localhost ~]$
[linux@localhost ~]$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1              2030736    329128   1596788  18% /
tmpfs                  2023720         0   2023720   0% /dev/shm
/dev/sda6            462932140    344244 438692820   1% /home
/dev/sda3              2030768     35892   1890052   2% /tmp
/dev/sdb1             11904588   1762636   9527468  16% /usr
/dev/sda2              4061572    115176   3736748   3% /var
/dev/sdb5            468622668    313040 444504916   1% /home1
[linux@localhost ~]$
[linux@localhost ~]$ cat /etc/fstab
LABEL=/1                /                       ext3    defaults        1 1
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
LABEL=/home1            /home                   ext3    defaults        1 2
proc                    /proc                   proc    defaults        0 0
sysfs                   /sys                    sysfs   defaults        0 0
LABEL=/tmp              /tmp                    ext3    defaults        1 2
LABEL=/usr12            /usr                    ext3    defaults        1 2
LABEL=/var              /var                    ext3    defaults        1 2
LABEL=SWAP-sda5         swap                    swap    defaults        0 0
/dev/sdb5               /home1                  ext3    defaults        1 3

192.168.161.202:/home/monitor/mount/monitor_client /home/monitor_client nfs defaults 1 4

论坛徽章:
0
9 [报告]
发表于 2008-03-26 08:15 |只看该作者
原帖由 stormcc 于 2008-3-24 13:39 发表
/etc/fstab文件记录的是服务器磁盘分区表,但是我mount的不是本地的磁盘,而是nfs服务器端,服务器在加载磁盘时候,还没有读取网卡设备,此时候网络根本是不通的,所如果按照楼上的那种做法,服务器肯定会卡在这 ...


哥们,你试过吗?拜托你试过再和我说吧!

论坛徽章:
0
8 [报告]
发表于 2008-03-26 00:21 |只看该作者
原帖由 stormcc 于 2008-3-24 13:39 发表
/etc/fstab文件记录的是服务器磁盘分区表,但是我mount的不是本地的磁盘,而是nfs服务器端,服务器在加载磁盘时候,还没有读取网卡设备,此时候网络根本是不通的,所如果按照楼上的那种做法,服务器肯定会卡在这 ...


不會的,因為 RHEL 有提供 netfs 服務就專門解決該問題所設計的。

/etc/init.d/netfs 你看一下就會知道,後續使用 chkconfig netfs on 設定每次開機啟動那就可以了。

--

论坛徽章:
0
7 [报告]
发表于 2008-03-25 23:20 |只看该作者

自己顶一下。。。。。。。

自己顶一下。。。。。。。

论坛徽章:
0
6 [报告]
发表于 2008-03-24 13:39 |只看该作者

楼上说的这种做法因该是不行的

/etc/fstab文件记录的是服务器磁盘分区表,但是我mount的不是本地的磁盘,而是nfs服务器端,服务器在加载磁盘时候,还没有读取网卡设备,此时候网络根本是不通的,所如果按照楼上的那种做法,服务器肯定会卡在这里无法启动。

论坛徽章:
0
5 [报告]
发表于 2008-03-20 22:45 |只看该作者
我还没有试过,那就把他添加到/etc/fstab中去吧,保证行!

论坛徽章:
0
4 [报告]
发表于 2008-03-20 18:14 |只看该作者

补充一句,我客户端的portmap是启动的

补充一句,我客户端的portmap是启动的

# chkconfig --list | grep portmap
portmap         0ff   1ff   2ff   3n    4n    5n    6ff
  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP