1、自建yum仓库,分别为网络源和本地源
1)备份现有的yum源

 mkdir /etc/yum.repo.d/bak
 mv /etc/yum.repo.d/*.repo /etc/yum.repo.d/bak

2)创建yum源配置文件
vim /etc/yum.repo.d/base.repo

[base]
name=cdrom base
baseurl=file:///mnt/rhel
gpgcheck=0              
[epel]
name=aliyun epel
baseurl=http://mirrors.aliyun.com/epel/$releasever/$basearch/
gpgcheck=0
enabled=1    

3)挂载ios文件
把ios文件挂载到/mnt/rhel上
mount /data/rhel-server-7.4-x86_64-dvd.iso /mnt/rhel
4) 查看yum仓库

[18:45:10 root@centos7_6 jiangjingqun]# yum repolist all
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
repo id                                                                                            repo name                                                                                        status
base                                                                                               cdrom base                                                                                       enabled:  4,021
epel/7/x86_64                                                                                      aliyun epel                                                                                      enabled: 13,415
repolist: 17,436
[18:45:17 root@centos7_6 jiangjingqun]# 

2、编译安装http2.4,实现可以正常访问,并将编译步骤和结果提交。
1)、导入源码 httpd-2.4.25.tar.bz2 ,解压;
可以使用rz命令上传源码包
tar -xvf httpd-2.4.25.tar.bz2
2)进入解压文件开始编译
执行./configure命令

[14:04:30 root@centos7_6 httpd-2.4.25]# cd httpd-2.4.25
[14:06:33 root@centos7_6 httpd-2.4.25]# ./configure --prefix=/apps/httpd24 --sysconfdir=/etc/httpd --enable-ssl --enable-so
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure: 
configure: Configuring Apache Portable Runtime library...
configure: 
checking for APR... no
configure: error: APR not found.  Please read the documentation.
[14:06:44 root@centos7_6 httpd-2.4.25]# 

发现报错了,缺少APR包
yum search apr-devel #用此命令搜索
yum install apr-devel #安装
再次执行configure命令:

[14:18:51 root@centos7_6 httpd-2.4.25]# ./configure --prefix=/apps/httpd24 --sysconfdir=/etc/httpd --enable-ssl --enable-so
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure: 
configure: Configuring Apache Portable Runtime library...
configure: 
checking for APR... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting CFLAGS to "  -pthread"
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
  setting LDFLAGS to " "
configure: 
configure: Configuring Apache Portable Runtime Utility library...
configure: 
checking for APR-util... no
configure: error: APR-util not found.  Please read the documentation.
[14:19:20 root@centos7_6 httpd-2.4.25]# yum install apr-util-devel     
再次执行configure命令:
[14:19:41 root@centos7_6 httpd-2.4.25]# ./configure --prefix=/apps/httpd24 --sysconfdir=/etc/httpd --enable-ssl --enable-so
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure: 
configure: Configuring Apache Portable Runtime library...
configure: 
checking for APR... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting CFLAGS to "  -pthread"
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
  setting LDFLAGS to " "
configure: 
configure: Configuring Apache Portable Runtime Utility library...
configure: 
checking for APR-util... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for gcc option to accept ISO C99... -std=gnu99
checking for pcre-config... false
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
[14:20:47 root@centos7_6 httpd-2.4.25]# yum install pcre-devel       #安装报错的包

再次执行:报错如下:
checking for OpenSSL version >= 0.9.8a... FAILED
configure: WARNING: OpenSSL version is too old
no
checking whether to enable mod_ssl... configure: error: mod_ssl has been requested but can not be built due to prerequisite failures
[14:25:56 root@centos7_6 httpd-2.4.25]# yum search Openssl
[14:27:04 root@centos7_6 httpd-2.4.25]# yum install openssl-devel

再次执行configure命令,无报错,有生成Makefile文件;

执行 make -j 4
执行 make install
查看编译后的目录:
配置文件:/etc/httpd
软件目录:/apps/httpd24/bin/apachectl
启动软件:/apps/httpd24/bin/apachectl start

[14:42:00 root@centos7_6 bin]# /apps/httpd24/bin/apachectl start

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::311f:7b7:10c8:b441. Set the 'ServerName' directive globally to suppress this message   

3、创建一个2G的文件系统,块大小为2048byte,预留1%可用空间,文件系统 ext4,卷标为TEST,要求此分区开机后自动挂载至/test目录,且默认有acl挂载选项

1)查看磁盘情况

[22:01:07 root@centos7_6 ~]# lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda               8:0    0   20G  0 disk 
├─sda1            8:1    0  300M  0 part /boot
├─sda2            8:2    0 17.7G  0 part 
│ ├─centos-root 253:0    0    5G  0 lvm  /
│ ├─centos-data 253:1    0  7.7G  0 lvm  /data
│ └─centos-home 253:2    0    5G  0 lvm  /home
└─sda3            8:3    0    2G  0 part [SWAP]
sdb               8:16   0   20G  0 disk 
├─sdb1            8:17   0    1G  0 part 
├─sdb2            8:18   0    4G  0 part [SWAP]
└─sdb3            8:19   0    2G  0 part 
sdc               8:32   0   20G  0 disk 
└─sdc1            8:33   0   20G  0 part 
sdd               8:48   0   20G  0 disk 
└─sdd1            8:49   0   20G  0 part 
sr0              11:0    1  4.3G  0 rom  /run/media/jiang/CentOS 7 x86_64

2)创建2G的分区

[22:01:12 root@centos7_6 ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): p

Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x7f52441c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048     2099199     1048576   83  Linux
/dev/sdb2         2099200    10487807     4194304   82  Linux swap / Solaris
/dev/sdb3        10487808    14682111     2097152   83  Linux

Command (m for help): n
Partition type:
   p   primary (3 primary, 0 extended, 1 free)
   e   extended
Select (default e): p
Selected partition 4
First sector (14682112-41943039, default 14682112): 
Using default value 14682112
Last sector, +sectors or +size{K,M,G} (14682112-41943039, default 41943039): +2G
Partition 4 of type Linux and of size 2 GiB is set

Command (m for help): p

Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x7f52441c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048     2099199     1048576   83  Linux
/dev/sdb2         2099200    10487807     4194304   82  Linux swap / Solaris
/dev/sdb3        10487808    14682111     2097152   83  Linux
/dev/sdb4        14682112    18876415     2097152   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
[22:02:14 root@centos7_6 ~]# 
[22:03:47 root@centos7_6 ~]# partprobe /dev/sdb
[22:03:57 root@centos7_6 ~]# lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda               8:0    0   20G  0 disk 
├─sda1            8:1    0  300M  0 part /boot
├─sda2            8:2    0 17.7G  0 part 
│ ├─centos-root 253:0    0    5G  0 lvm  /
│ ├─centos-data 253:1    0  7.7G  0 lvm  /data
│ └─centos-home 253:2    0    5G  0 lvm  /home
└─sda3            8:3    0    2G  0 part [SWAP]
sdb               8:16   0   20G  0 disk 
├─sdb1            8:17   0    1G  0 part 
├─sdb2            8:18   0    4G  0 part [SWAP]
├─sdb3            8:19   0    2G  0 part 
└─sdb4            8:20   0    2G  0 part 
sdc               8:32   0   20G  0 disk 
└─sdc1            8:33   0   20G  0 part 
sdd               8:48   0   20G  0 disk 
└─sdd1            8:49   0   20G  0 part 
sr0              11:0    1  4.3G  0 rom  /run/media/jiang/CentOS 7 x86_64
[22:03:58 root@centos7_6 ~]# 

3)创建磁盘系统

[22:05:04 root@centos7_6 ~]# mkfs -t ext4 -b 2048 -L TEST -m 1 /dev/sdb4
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=TEST
OS type: Linux
Block size=2048 (log=1)
Fragment size=2048 (log=1)
Stride=0 blocks, Stripe width=0 blocks
131072 inodes, 1048576 blocks
10485 blocks (1.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=269484032
64 block groups
16384 blocks per group, 16384 fragments per group
2048 inodes per group
Superblock backups stored on blocks: 
        16384, 49152, 81920, 114688, 147456, 409600, 442368, 802816

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done 

4)查看结果如下
[22:05:56 root@centos7_6 ~]# blkid
/dev/mapper/centos-root: UUID="ec75a115-23b9-4105-9339-b6416947cb3d" TYPE="xfs" 
/dev/sda2: UUID="FYdah7-2jJO-B8mc-M2Gc-QJ06-f8BS-gj0fBZ" TYPE="LVM2_member" 
/dev/sda1: UUID="dc62f6e0-6c74-43d2-b461-9370c8c84f21" TYPE="xfs" 
/dev/sda3: UUID="7c2b4f3b-d87e-4f80-bbbf-7988239b192c" TYPE="swap" 
/dev/sdb2: UUID="227449ce-ba33-49c0-946a-e09d9b4bb849" TYPE="swap" 
/dev/sr0: UUID="2018-11-25-23-54-16-00" LABEL="CentOS 7 x86_64" TYPE="iso9660" PTTYPE="dos" 
/dev/mapper/centos-data: UUID="3da99461-c1e9-40e4-a8ca-ad492c646590" TYPE="xfs" 
/dev/mapper/centos-home: UUID="65a63d5d-5d4d-4f0f-903e-11dff99b82ca" TYPE="xfs" 
/dev/sdb4: LABEL="TEST" UUID="b4b7e37a-991e-4748-8aae-71b519610db9" TYPE="ext4"

5)挂载
写入/etc/fstab文件中
UUID=b4b7e37a-991e-4748-8aae-71b519610db9 /test ext4 acl 0 0

[22:08:54 root@centos7_6 ~]# mkdir /test
[22:09:05 root@centos7_6 ~]# mount -a
mount: special device /dev/vg0/lv_data does not exist
[22:09:14 root@centos7_6 ~]# 
[22:09:18 root@centos7_6 ~]# df -lh
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root  5.0G  4.3G  746M  86% /
devtmpfs                 894M     0  894M   0% /dev
tmpfs                    910M     0  910M   0% /dev/shm
tmpfs                    910M   11M  900M   2% /run
tmpfs                    910M     0  910M   0% /sys/fs/cgroup
/dev/sda1                297M  162M  136M  55% /boot
/dev/mapper/centos-home  5.0G   45M  5.0G   1% /home
/dev/mapper/centos-data  7.7G  204M  7.5G   3% /data
tmpfs                    182M  8.0K  182M   1% /run/user/42
tmpfs                    182M   28K  182M   1% /run/user/1001
/dev/sr0                 4.3G  4.3G     0 100% /run/media/jiang/CentOS 7 x86_64
tmpfs                    182M     0  182M   0% /run/user/0
/dev/sdb4                2.0G  9.1M  1.9G   1% /test

4、创建一个至少有两个PV组成的大小为20G的名为testvg的VG;要求PE大小 为16MB, 而后在卷组中创建大小为5G的逻辑卷testlv;挂载至/users目录
1)查看磁盘情况

[21:20:15 root@centos7_6 ~]# lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda               8:0    0   20G  0 disk 
├─sda1            8:1    0  300M  0 part /boot
├─sda2            8:2    0 17.7G  0 part 
│ ├─centos-root 253:0    0    5G  0 lvm  /
│ ├─centos-data 253:1    0  7.7G  0 lvm  /data
│ └─centos-home 253:2    0    5G  0 lvm  /home
└─sda3            8:3    0    2G  0 part [SWAP]
sdb               8:16   0   20G  0 disk 
├─sdb1            8:17   0    1G  0 part 
├─sdb2            8:18   0    4G  0 part [SWAP]
└─sdb3            8:19   0    2G  0 part 
sdc               8:32   0   20G  0 disk 
sdd               8:48   0   20G  0 disk 
sr0              11:0    1  4.3G  0 rom  /run/media/jiang/CentOS 7 x86_64
 2)创建文件系统
[21:20:22 root@centos7_6 ~]# fdisk /dev/sdc
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x13676f7f.

Command (m for help): p

Disk /dev/sdc: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x13676f7f

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 
First sector (2048-41943039, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): 
Using default value 41943039
Partition 1 of type Linux and of size 20 GiB is set

Command (m for help): p

Disk /dev/sdc: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x13676f7f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048    41943039    20970496   83  Linux

Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'

Command (m for help): p

Disk /dev/sdc: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x13676f7f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048    41943039    20970496   8e  Linux LVM

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

[21:22:22 root@centos7_6 ~]# fdisk /dev/sdd
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xf3a3a9f3.

Command (m for help): p

Disk /dev/sdd: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xf3a3a9f3

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 
First sector (2048-41943039, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): 
Using default value 41943039
Partition 1 of type Linux and of size 20 GiB is set

Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): L

 0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris        
 1  FAT12           27  Hidden NTFS Win 82  Linux swap / So c1  DRDOS/sec (FAT-
 2  XENIX root      39  Plan 9          83  Linux           c4  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  84  OS/2 hidden C:  c6  DRDOS/sec (FAT-
 4  FAT16 <32M      40  Venix 80286     85  Linux extended  c7  Syrinx         
 5  Extended        41  PPC PReP Boot   86  NTFS volume set da  Non-FS data    
 6  FAT16           42  SFS             87  NTFS volume set db  CP/M / CTOS / .
 7  HPFS/NTFS/exFAT 4d  QNX4.x          88  Linux plaintext de  Dell Utility   
 8  AIX             4e  QNX4.x 2nd part 8e  Linux LVM       df  BootIt         
 9  AIX bootable    4f  QNX4.x 3rd part 93  Amoeba          e1  DOS access     
 a  OS/2 Boot Manag 50  OnTrack DM      94  Amoeba BBT      e3  DOS R/O        
 b  W95 FAT32       51  OnTrack DM6 Aux 9f  BSD/OS          e4  SpeedStor      
 c  W95 FAT32 (LBA) 52  CP/M            a0  IBM Thinkpad hi eb  BeOS fs        
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a5  FreeBSD         ee  GPT            
 f  W95 Ext'd (LBA) 54  OnTrackDM6      a6  OpenBSD         ef  EFI (FAT-12/16/
10  OPUS            55  EZ-Drive        a7  NeXTSTEP        f0  Linux/PA-RISC b
11  Hidden FAT12    56  Golden Bow      a8  Darwin UFS      f1  SpeedStor      
12  Compaq diagnost 5c  Priam Edisk     a9  NetBSD          f4  SpeedStor      
14  Hidden FAT16 <3 61  SpeedStor       ab  Darwin boot     f2  DOS secondary  
16  Hidden FAT16    63  GNU HURD or Sys af  HFS / HFS+      fb  VMware VMFS    
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fc  VMware VMKCORE 
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fd  Linux raid auto
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid fe  LANstep        
1c  Hidden W95 FAT3 75  PC/IX           be  Solaris boot    ff  BBT            
1e  Hidden W95 FAT1 80  Old Minix      
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'

Command (m for help): p

Disk /dev/sdd: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xf3a3a9f3

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1            2048    41943039    20970496   8e  Linux LVM

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
 2)创建pv
[21:31:31 root@centos7_6 ~]# pvcreate /dev/sdc1
  Physical volume "/dev/sdc1" successfully created.
[21:31:44 root@centos7_6 ~]# pvcreate /dev/sdd1
  Physical volume "/dev/sdd1" successfully created.
[21:31:47 root@centos7_6 ~]# pvs
  PV         VG     Fmt  Attr PSize   PFree  
  /dev/sda2  centos lvm2 a--   17.70g      0 
  /dev/sdc1         lvm2 ---  <20.00g <20.00g
  /dev/sdd1         lvm2 ---  <20.00g <20.00g
 3)创建vg
[21:48:16 root@centos7_6 ~]# vgcreate testvg /dev/sdc1 /dev/sdd1 -s 16M
  Volume group "testvg" successfully created
[21:48:22 root@centos7_6 ~]# vgs
  VG     #PV #LV #SN Attr   VSize   VFree  
  centos   1   3   0 wz--n-  17.70g      0 
  testvg   2   0   0 wz--n- <39.97g <39.97g
[21:48:24 root@centos7_6 ~]# vgdisplay 
  --- Volume group ---
  VG Name               centos
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               3
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               17.70 GiB
  PE Size               4.00 MiB
  Total PE              4532
  Alloc PE / Size       4532 / 17.70 GiB
  Free  PE / Size       0 / 0   
  VG UUID               3ULbkT-BigZ-hVDC-u2y9-KCMk-JF33-V6bFNx

  --- Volume group ---
  VG Name               testvg
  System ID             
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               <39.97 GiB
  PE Size               16.00 MiB
  Total PE              2558
  Alloc PE / Size       0 / 0   
  Free  PE / Size       2558 / <39.97 GiB
  VG UUID               Mww2Id-aPpb-QVlu-jtq3-CTZF-Vkph-ATysjj

[21:48:27 root@centos7_6 ~]# 
 4)创建vl
[21:50:35 root@centos7_6 ~]# lvcreate -L 5G -n testlv testvg
  Logical volume "testlv" created.
[21:51:39 root@centos7_6 ~]# lvs
  LV     VG     Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  data   centos -wi-ao---- 7.70g                                                    
  home   centos -wi-ao---- 5.00g                                                    
  root   centos -wi-ao---- 5.00g                                                    
  testlv testvg -wi-a----- 5.00g     
 5)挂载
[21:53:45 root@centos7_6 ~]# mkfs -t ext4 /dev/testvg/testlv
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
327680 inodes, 1310720 blocks
65536 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1342177280
40 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done 

[21:54:20 root@centos7_6 ~]# 
[21:54:21 root@centos7_6 ~]# mount /dev/testvg/testlv /users/   
[21:54:37 root@centos7_6 ~]# df -lh
Filesystem                 Size  Used Avail Use% Mounted on
/dev/mapper/centos-root    5.0G  4.3G  746M  86% /
devtmpfs                   894M     0  894M   0% /dev
tmpfs                      910M     0  910M   0% /dev/shm
tmpfs                      910M   11M  900M   2% /run
tmpfs                      910M     0  910M   0% /sys/fs/cgroup
/dev/sda1                  297M  162M  136M  55% /boot
/dev/mapper/centos-home    5.0G   45M  5.0G   1% /home
/dev/mapper/centos-data    7.7G  204M  7.5G   3% /data
tmpfs                      182M  8.0K  182M   1% /run/user/42
tmpfs                      182M   28K  182M   1% /run/user/1001
/dev/sr0                   4.3G  4.3G     0 100% /run/media/jiang/CentOS 7 x86_64
tmpfs                      182M     0  182M   0% /run/user/0
/dev/mapper/testvg-testlv  4.8G   20M  4.6G   1% /users

备注:需要mount命令是临时挂载,真是开机自动挂载需要修改/etc/fstab文件