在服务端上配置SMB服务,要求:
共享/common目录,共享名必须为 common,可以在common目录里面创建文件。
首先是服务端装包
[root@localhost ~]# yum install samba -y
装成功后编辑配置文件,添加内容
[root@localhost ~]# vim /etc/samba/smb.conf
[common]
comment = read and write
path = /common
browseable = yes
writeable = yes
然后创建对应目录并修改权限
[root@localhost ~]# mkdir /common
[root@localhost ~]# chmod o+w /common
添加一个用户xiao
[root@localhost ~]# useradd xiao
[root@localhost ~]# smbpasswd xiao -a
New SMB password:
Retype new SMB password:
Added user xiao.
关闭防火墙,selinux,开启服务
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl restart smb nmb
然后客户端装包
[root@client ~]# yum install samba-client -y
创建要挂载的目录
[root@client ~]# mkdir /samba/common -p
将服务端挂载到客户端(rhel7挂载rhel8的samba共享目录,需要添加参数指定协议版本vers=2.0)
[root@client ~]# mount //192.168.136.138/common /samba/common -o username=xiao,password=root,vers=2.0
[root@client ~]# df -h
//192.168.136.138/common 15G 4.4G 11G 29% /samba/common
测试
[root@client ~]# touch /samba/common/client
[root@client ~]# ll /samba/common
total 0
-rwxr-xr-x. 0 root root 0 Aug 8 11:17 client
2.创建一个lv1,大小为2G,扩大它的大小为4G
lvcreate -L 2G -n lv1 vg1
lvresize -L 4G -r /dev/vg1