- 论坛徽章:
- 0
|
本帖最后由 ccbcfan 于 2010-05-04 16:37 编辑
正好在openwrt( 一种应用于路由器上的嵌入式linux)下配置NFS,碰到如下问题:
/etc/init.d/portmap start ##正常
/etc/init.d/nfsd start ##有错误提示:- root@Openwrt:~# /etc/init.d/nfsd start
- mount: mounting nfsd on /proc/fs/nfsd failed: No such device
- sysctl: error: 'fs.nfs.nlm_tcpport' is an unknown key
- sysctl: error: 'fs.nfs.nlm_udpport' is an unknown key
- exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/mnt".
- Assuming default behaviour ('no_subtree_check').
- NOTE: this default has changed since nfs-utils version 1.0.x
复制代码 vi /etc/init.d/nfsd- #!/bin/sh /etc/rc.common
- # Copyright (C) 2006 OpenWrt.org
- START=60
- STOP=60
- NFS_D=/var/lib/nfs
- LOCK_D=/var/lib/nfs/sm
- start() {
- grep -q /proc/fs/nfsd /proc/mounts || \
- mount -t nfsd nfsd /proc/fs/nfsd
- mkdir -p $NFS_D
- mkdir -p $LOCK_D
- touch $NFS_D/rmtab
- sysctl -w fs.nfs.nlm_tcpport=32777 fs.nfs.nlm_udpport=32777 > /dev/null
- /usr/sbin/rpc.statd -p 32778 -o 32779
- /usr/sbin/exportfs -r
- /usr/sbin/rpc.nfsd
- /usr/sbin/rpc.mountd -p 32780
- }
- stop() {
- killall rpc.mountd 2> /dev/null
- rpc.nfsd 0 2> /dev/null
- /usr/sbin/exportfs -au
- killall rpc.statd 2> /dev/null
- grep -q /proc/fs/nfsd /proc/mounts && \
- umount /proc/fs/nfsd
- }
- reload() {
- /usr/sbin/exportfs -r
- }
复制代码 root@Openwrt:~# ps- root@Openwrt:~# ps
- PID USER VSZ STAT COMMAND
- ...
- 1048 root 2200 S ntfs-3g -o nls=utf8 /dev/sda1 /mnt/sda1
- 1486 root 972 S vsftpd
- 1541 root 2556 S N smbd -D
- 1543 root 2056 S nmbd -D
- 3803 nobody 852 S /usr/sbin/portmap
- 4274 root 880 S /usr/sbin/rpc.statd -p 32778 -o 32779
- 4279 root 1160 S /usr/sbin/rpc.mountd -p 32780
-
复制代码 vi /etc/exports- /www *(ro,all_squash,insecure)
复制代码 在Linux 服务器上进行NFS 服务器的回环测试显示没有成功,运行如下命令:
# mount –t nfs 192.168.3.1:/www /test- root@Openwrt:~# mount –t nfs 192.168.3.1:/www /test
- mount: 192.168.3.1:/www failed, reason given by server: Permission denied
复制代码 root@Openwrt:~# showmount -e 192.168.3.1- root@Openwrt:~# showmount -e 192.168.3.1
- Export list for 192.168.3.1:
- /www *
复制代码 root@Openwrt:~# df shares- root@Openwrt:~# df shares
- Filesystem 1K-blocks Used Available Use% Mounted on
- df: shares: can't find mount point
复制代码 NFS客户端现在无法mount NFS share , 请指点!!谢谢 |
|