NFS 系统

vim /etc/exports

# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
/work/nfs_root  *(rw,sync,no_root_squash)
/work/nfs_root/first_fs  *(rw,sync,no_root_squash)
 

book@www.100ask.org:/work/nfs_root/first_fs$ sudo /etc/init.d/nfs-kernel-server restart
[ ok ] Restarting nfs-kernel-server (via systemctl): nfs-kernel-server.service.
book@www.100ask.org:/work/nfs_root/first_fs$

# ifconfig eth0 up
# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:60:6E:33:44:55
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:11880 (11.6 KiB)  TX bytes:0 (0.0 B)
          Interrupt:51 Base address:0xa000
 

# ifconfig eth0  192.168.0.11
# ping 192.168.0.106
PING 192.168.0.106 (192.168.0.106): 56 data bytes
64 bytes from 192.168.0.106: seq=0 ttl=64 time=14.726 ms
64 bytes from 192.168.0.106: seq=1 ttl=64 time=0.821 ms
64 bytes from 192.168.0.106: seq=2 ttl=64 time=0.831 ms
64 bytes from 192.168.0.106: seq=3 ttl=64 time=0.827 ms
64 bytes from 192.168.0.106: seq=4 ttl=64 time=7.238 ms
 

 在服务器上自己测试一下

book@www.100ask.org:~$ sudo mount -t nfs 192.168.0.106:/work/nfs_root/first_fs /mnt
book@www.100ask.org:~$ ls /mnt
bin  dev  etc  first_drv.ko  hello.txt  lib  linuxrc  proc  sbin  sys  usr

29 packets transmitted, 29 packets received, 0% packet loss
round-trip min/avg/max = 0.661/2.401/14.726 ms
# ls
bin         etc         linuxrc     proc        sys
dev         lib         lost+found  sbin        usr
# mkdir /mnt
# mount -t nfs -o nolock 192.168.0.106:/work/nfs_root/first_fs /mnt

# ls /mnt
bin      etc      linuxrc  sbin     usr
dev      lib      proc     sys
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Z文的博客

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值