题目:
1、开放/nfs/shared目录,供所有用户查询资料;
2、开放/nfs/upload目录,供所有用户上传下载资料;
3、创建一个lv1,大小为2G,扩大它的大小为4G
一.关闭防火墙
[root@cwt-server ~]# systemctl stop firewalld
[root@cwt-server ~]# systemctl disable firewalld
[root@cwt-server ~]# vim /etc/selinux/config
[root@cwt-server ~]# setenforce 0
二.安装NFS服务
[root@cwt-server ~]# yum install -y nfs-utils
启动NFS服务
[root@cwt-server ~]# systemctl start nfs-server rpcbind
三.编辑配置文件和共享目录
[root@cwt-server ~]# vim /etc/exports
[root@cwt-server ~]# cat /etc/exports
/nfs/shared *(ro,sync)
[root@cwt-server ~]# mkdir /nfs/shared -p
[root@cwt-server ~]# systemctl restart nfs-server rpcbind
四.在客户端关闭防火墙
[root@cwt-client ~]# systemctl stop firewalld
[root@cwt-client ~]# systemctl disable firewalld
[root@cwt-client ~]# vim /etc/selinux/config
[root@cwt-client ~]# setenforce 0
五.安装NFS服务
[root@cwt-client ~]# yum install -y nfs-utils rpcbind
[root@cwt-client ~]# systemctl start nfs-server rpcbind
六.在客户端查看共享目录
[root@cwt-client ~]# showmount -e 192.168.40.139
Export list for 192.168.40.139:
/nfs/shared *
七.创建挂载点目录,挂载
[root@cwt-client ~]# mkdir /hanyuce
[root@cwt-client ~]# mount -t nfs 192.168.40.139:/nfs/shared /hanyuce
八.创建共享目录
[root@cwt-server ~]# mkdir /nfs/upload
九.修改配置文件
[root@cwt-server ~]# cat /etc/exports
/nfs/upload 192.168.40.0/24(rw,anonuid=300,anongid=300,sync)
[root@cwt-server ~]# systemctl restart nfs-server rpcbind
十.在客户端查看共享目录
[root@cwt-client ~]# showmount -e 192.168.40.139
Export list for 192.168.40.139:
/nfs/upload 192.168.40.0/24
十一.创建挂载点目录,挂载
[root@cwt-client ~]# mkdir /chenwanting
[root@cwt-client ~]# mount -t nfs 192.168.40.139:/nfs/upload /chenwanting
十二.在服务器端设置属主和属组
[root@cwt-server ~]# chown nfs-upload.nfs-upload /nfs/upload
[root@cwt-server ~]# cd /nfs