1.创建一个逻辑卷 请按下列要求创建一个新的逻辑卷: 创建一个名为 datastore 的卷组,卷组的大小为4G 逻辑卷的名字为 database ,所属卷组为 datastore,该逻辑卷大小为3G 将新建的逻辑卷格式化为 xfs 文件系统,
2.通过自动挂载将该逻辑卷到/volume/lv1
3.扩大卷组扩展上题database逻辑卷的大小为5G。
4.配置nfs服务 将/home/tom(该目录为uid=1111,gid=1111的tom用户的家目录)目录仅共享给172.24.8.129这台主机上的jerry用户,jerry对该目录具有访问、新建和删除文件的权限。
[root@localhost ~]# lsblk
[root@localhost ~]# pvcreate /dev/nvme0n2p{1,2}
Physical volume "/dev/nvme0n2p1" successfully created.
Physical volume "/dev/nvme0n2p2" successfully created.
[root@localhost ~]# vgcreate dataastore /dev/nvme0n2p1
Volume group "dataastore" successfully created
[root@localhost ~]# vgextend dataastore /dev/nvme0n2p2
Volume group "dataastore" successfully extended
[root@localhost ~]# lvcreate -n database -L 3G dataastore
Logical volume "database" created.
[root@localhost ~]# mkfs.xfs /dev/dataastore/database
[root@localhost ~]# mkdir -pv /volume/lv1
[root@localhost ~]# vim /etc/fstab
[root@localhost ~]# pvcreate /dev/nvme0n2p3
Physical volume "/dev/nvme0n2p3" successfully created.
[root@localhost ~]# vgextend dataastore /dev/nvme0n2p3
Volume group "dataastore" successfully extended
[root@localhost ~]# lvextend -L +2G /dev/dataastore/database
Size of logical volume dataastore/database changed from 3.00 GiB (768 extents) to 5.00 GiB (1280 extents).
Logical volume dataastore/database successfully resized.
[root@localhost ~]# xfs_growfs /dev/dataastore/database
[root@localhost ~]# df -h
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# setenforce 0
[root@localhost ~]# yum install nfs-utils
[root@localhost ~]# systemctl restart nfs-server
[root@localhost ~]# vim /etc/exports
[root@localhost ~]# useradd -u 1111 tom -----创建测试用户
[root@localhost ~]# id tom
uid=1111(tom) gid=1111(tom) 组=1111(tom)
[root@localhost ~]#
[root@localhost ~]# chmod 700 /home/tom/
#exportfs -r
#useradd -u 3333 jerry
#setfacl -m u:jerry:rwx /home/tom
[root@localhost ~]# showmount -e 192.168.101.130
Export list for 192.168.101.130:
/home/tom 172.24.8.129
[root@client ~]# useradd -u 3333 jerry
[root@clent ~]#mkdir -p /nfs/tom
[root@clent ~]# mount 192.168.186.150:/home/tom /nfs/tom
mount.nfs: access denied by server while mounting 192.168.186.150:/home/tom