target机挂载Linux主机NFS问题

target机挂载Linux主机NFS问题

主机A情况

[root@Mike /pub]# uname -a

Linux Mike.zanget 2.6.9-5.EL #1 Wed Jan 5 19:22:18 EST 2005 i686 i686 i386 GNU/Linux

 

 

[root@Mike /pub]# nfsstat

Server rpc stats:

calls      badcalls   badauth    badclnt    xdrcall

744        0          0          0          0      

Server nfs v2:

null       getattr    setattr    root       lookup     readlink  

0       0% 44      8% 0       0% 0       0% 12      2% 0       0%

read       wrcache    write      create     remove     rename    

431    86% 0       0% 0       0% 0       0% 0       0% 0       0%

link       symlink    mkdir      rmdir      readdir    fsstat    

0       0% 0       0% 0       0% 0       0% 7       1% 6       1%

 

Server nfs v3:

null       getattr    setattr    lookup     access     readlink  

0       0% 38     15% 0       0% 6       2% 71     29% 0       0%

read       write      create     mkdir      symlink    mknod     

118    48% 0       0% 0       0% 0       0% 0       0% 0       0%

remove     rmdir      rename     link       readdir    readdirplus

0       0% 0       0% 0       0% 0       0% 5       2% 0       0%

fsstat     fsinfo     pathconf   commit    

3       1% 3       1% 0       0% 0       0%

 

注:Server nfs v3:的数据只是开始我未指定挂载选项-o nfsvers=2的情况

 

[root@Mike /pub]# dmesg | grep nfs

SELinux: initialized (dev selinuxfs, type selinuxfs), uses genfs_contexts

SELinux: initialized (dev eventpollfs, type eventpollfs), uses genfs_contexts

SELinux: initialized (dev futexfs, type futexfs), uses genfs_contexts

SELinux: initialized (dev proc, type proc), uses genfs_contexts

SELinux: initialized (dev bdev, type bdev), uses genfs_contexts

SELinux: initialized (dev rootfs, type rootfs), uses genfs_contexts

SELinux: initialized (dev sysfs, type sysfs), uses genfs_contexts

SELinux: initialized (dev usbfs, type usbfs), uses genfs_contexts

SELinux: initialized (dev usbdevfs, type usbdevfs), uses genfs_contexts

SELinux: initialized (dev ramfs, type ramfs), uses genfs_contexts

SELinux: initialized (dev binfmt_misc, type binfmt_misc), uses genfs_contexts

SELinux: initialized (dev rpc_pipefs, type rpc_pipefs), uses genfs_contexts

Installing knfsd (copyright (C) 1996 [email protected]).

SELinux: initialized (dev nfsd, type nfsd), uses genfs_contexts

SELinux: initialized (dev hdc, type iso9660), uses genfs_contexts

nfsd: last server has exited

nfsd: unexporting all filesystems

 

 

[root@Mike /pub]# ifconfig

eth0      Link encap:Ethernet  HWaddr 00:0C:29:E2:75:F2 

          inet addr:172.16.17.232  Bcast:172.16.17.255  Mask:255.255.255.0

          inet6 addr: fe80::20c:29ff:fee2:75f2/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:45780 errors:0 dropped:0 overruns:0 frame:0

          TX packets:9788 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:4516451 (4.3 MiB)  TX bytes:8451482 (8.0 MiB)

          Interrupt:10 Base address:0x2000

 

target机情况:
# cat cpuinfo

CPU:            MC68VZ328

MMU:            none

FPU:            none

Clocking:       33.1MHz

BogoMips:       2.59

Calibration:    1299200 loops

 

运行1

# portmap                                                                             [命令运行正常]

 

# mount -t nfs 172.16.17.232:/pub /tmp -o nfsvers=2          [命令运行正常并且立即返回]

 

#mount

/dev/mtdblock4 on / type romfs (ro)

/proc on /proc type proc (rw)

/dev/ram0 on /var type ext2 (rw)

/dev/mtdblock5 on /usr/bin type jffs (rw)

172.16.17.232:/pub on /mnt type nfs (rw,v2,rsize=8192,wsize=8192,hard,udp,lock,addr=172.16.17.232)

 

# dmesg                                                                                [无错误信息]

 

# cd /tmp

 

# ls

a    pub

 

# ./pub                                                                                  [shell死掉,并且CTRL+C不能结束]

 

运行2

# portmap                                                                             [命令运行正常]

 

# mount -t nfs 172.16.17.232:/pub /tmp -o nfsvers=2          [命令运行正常并且立即返回]

 

#mount

/dev/mtdblock4 on / type romfs (ro)

/proc on /proc type proc (rw)

/dev/ram0 on /var type ext2 (rw)

/dev/mtdblock5 on /usr/bin type jffs (rw)

172.16.17.232:/pub on /mnt type nfs (rw,v2,rsize=8192,wsize=8192,hard,udp,lock,addr=172.16.17.232)

 

# dmesg                                                                                [无错误信息]

Creating 6 MTD partitions on "Flash":

0x00000000-0x00008000 : "lilo"

0x00008000-0x0000a000 : "config"

0x0000a000-0x0003a000 : "font"

0x0003a100-0x00180000 : "kernel"

0x00180100-0x002a0000 : "romfs"

0x002a0000-0x00400000 : "user"

NET4: Linux TCP/IP 1.0 for NET4.0

IP Protocols: ICMP, UDP, TCP

IP: routing cache hash table of 512 buckets, 4Kbytes

TCP: Hash tables configured (established 512 bind 512)

NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.

VFS: tried fs_name = <ext2> err= 0

VFS: Mounted root (romfs filesystem) readonly.

Warning: unable to open an initial console.

eth0: using half-duplex 10Base-T (RJ-45)

 

# cd /tmp

 

# ls

 

a    pub

 

#cp pub /usr/bin                                                                    [shell死掉,并且CTRL+C不能结束]

 

 

 

 

主机B情况172.16.17.239   LINUX版本fedora core 1

[root@Mike nfs]# uname -a

Linux Mike 2.4.22-1.2115.nptl #1 Wed Oct 29 15:42:51 EST 2003 i686 i686 i386 GNU/Linux

[root@Mike nfs]# nfsstat

Server rpc stats:

calls      badcalls   badauth    badclnt    xdrcall

127        0          0          0          0      

Server nfs v2:

null       getattr    setattr    root       lookup     readlink  

0       0% 22     17% 0       0% 0       0% 7       5% 0       0%

read       wrcache    write      create     remove     rename    

91     71% 0       0% 0       0% 0       0% 0       0% 0       0%

link       symlink    mkdir      rmdir      readdir    fsstat    

0       0% 0       0% 0       0% 0       0% 3       2% 4       3%

 

Server nfs v3:

null       getattr    setattr    lookup     access     readlink  

0       0% 0       0% 0       0% 0       0% 0       0% 0       0%

read       write      create     mkdir      symlink    mknod     

0       0% 0       0% 0       0% 0       0% 0       0% 0       0%

remove     rmdir      rename     link       readdir    readdirplus

0       0% 0       0% 0       0% 0       0% 0       0% 0       0%

fsstat     fsinfo     pathconf   commit    

0       0% 0       0% 0       0% 0       0%

 

[root@Mike root]# dmesg | grep nfs

Installing knfsd (copyright (C) 1996 [email protected]).

 

 

[root@Mike nfs]# ifconfig

eth0      Link encap:Ethernet  HWaddr 00:0C:29:D3:92:FB 

          inet addr:172.16.17.239  Bcast:172.16.17.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:598759 errors:0 dropped:0 overruns:0 frame:0

          TX packets:440654 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:54610713 (52.0 Mb)  TX bytes:519366003 (495.3 Mb)

          Interrupt:10 Base address:0x2000

 

 

运行3

#portmap                                                                              [命令运行正常]

 

#mount -t nfs 172.16.17.239:/nfs /mnt && cd /mnt             [命令运行正常并且立即返回]

 

#mount

/dev/mtdblock4 on / type romfs (ro)

/proc on /proc type proc (rw)

/dev/ram0 on /var type ext2 (rw)

/dev/mtdblock5 on /usr/bin type jffs (rw)

172.16.17.239:/nfs on /mnt type nfs (rw,v2,rsize=8192,wsize=8192,hard,udp,lock,addr=172.16.17.239)

 

# dmesg                                                                                [无错误信息]

Creating 6 MTD partitions on "Flash":

0x00000000-0x00008000 : "lilo"

0x00008000-0x0000a000 : "config"

0x0000a000-0x0003a000 : "font"

0x0003a100-0x00180000 : "kernel"

0x00180100-0x002a0000 : "romfs"

0x002a0000-0x00400000 : "user"

NET4: Linux TCP/IP 1.0 for NET4.0

IP Protocols: ICMP, UDP, TCP

IP: routing cache hash table of 512 buckets, 4Kbytes

TCP: Hash tables configured (established 512 bind 512)

NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.

VFS: tried fs_name = <ext2> err= 0

VFS: Mounted root (romfs filesystem) readonly.

Warning: unable to open an initial console.

eth0: using half-duplex 10Base-T (RJ-45)

 

# cd /tmp

 

# ls

a    pub

 

# ./pub                                                                                  [命令大概运行1分钟,pub程序开始运行]

 

运行4

# portmap                                                                             [命令运行正常]

 

# mount -t nfs 172.16.17.232:/pub /tmp -o nfsvers=2          [命令运行正常并且立即返回]

 

# dmesg                                                                                [无错误信息]

 

# cd /tmp

 

# ls

a    pub

 

#cp pub /usr/bin                                                                    [根据flash的读写速度而定,命令能正常执行]

 

 

我不明白为何挂载在主机B上执行、拷贝都能成功,而在主机A上却不行????

 

 

 

mount -t nfs 172.16.17.239:/nfs /mnt && cd /mnt

172.16.17.239虚拟机LINUX版本fedora core 1

172.16.17.239:/nfs on /mnt type nfs (rw,v2,rsize=8192,wsize=8192,hard,udp,lock,addr=172.16.17.239)

 

 

 

portmap

 

指定挂在NFS服务版本V2

mount -t nfs 172.16.17.232:/pub /mnt -o nfsvers=2

172.16.17.232虚拟机LINUX版本 EL

172.16.17.232:/pub on /mnt type nfs (rw,v2,rsize=8192,wsize=8192,hard,udp,lock,addr=172.16.17.232)

 

mount -t nfs 172.16.17.232:/pub /tmp -o nfsvers=2

 

你可能感兴趣的:(target机挂载Linux主机NFS问题)