1、自建 yum 仓库,分别为本地源和网络源;
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[local]
name=local base
baseurl=file:///mnt/
gpgcheck=0
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[net]
name=net base
baseurl=http://10.10.10.111/centos/$releasever/os/$basearch/
gpgcheck=0
[root@localhost ~]
2、编译安装 http2.4,实现可以正常访问,并将编译步骤和结果提交;
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost httpd-2.4.43]
[root@localhost httpd-2.4.43]
[root@localhost httpd-2.4.43]
[root@localhost httpd-2.4.43]
<html><body><h1>It works!</h1></body></html>
3、创建一个 2G 的文件系统,块大小为 2048byte,预留 1% 可用空间,文件系统 ext4,卷标为 TEST,要求此分区开机后自动挂载至 /test 目录,且默认有 acl 挂载选项;
[root@centos7 data]
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
[root@centos7 data]
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 0x6f11fc49.
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): 1
First sector (2048-41943039, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +2G
Partition 1 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: 0x6f11fc49
Device Boot Start End Blocks Id System
/dev/sdb1 2048 4196351 2097152 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@centos7 data]
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
[root@centos7 data]
[root@centos7 data]
[root@centos7 data]
[root@centos7 data]
Filesystem Size Used Avail Use% Mounted on
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/mapper/centos_centos7-root 50G 5.4G 45G 11% /
/dev/mapper/centos_centos7-home 47G 39M 47G 1% /home
/dev/sda1 1014M 193M 822M 20% /boot
tmpfs 182M 12K 182M 1% /run/user/42
tmpfs 182M 0 182M 0% /run/user/1003
tmpfs 182M 0 182M 0% /run/user/0
/dev/sdb1 2.0G 9.1M 1.9G 1% /test
4、创建一个至少有两个PV组成的大小为 20G 的名为 testvg 的 VG,要求 PE 大小为 16MB,而后在卷组中创建大小为 5G 的逻辑卷 testlv,挂载至 /users 目录。
[root@centos7 ~]
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): 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): +10G
Partition 1 of type Linux and of size 10 GiB is set
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): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@centos7 ~]
[root@centos7 ~]
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 100G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 99G 0 part
├─centos_centos7-root 253:0 0 50G 0 lvm /
├─centos_centos7-swap 253:1 0 2G 0 lvm [SWAP]
└─centos_centos7-home 253:2 0 47G 0 lvm /home
sdb 8:16 0 20G 0 disk
└─sdb1 8:17 0 10G 0 part
sdc 8:32 0 20G 0 disk
└─sdc1 8:33 0 10G 0 part
sr0 11:0 1 4.4G 0 rom
[root@centos7 ~]
Physical volume "/dev/sdb1" successfully created.
Physical volume "/dev/sdc1" successfully created.
[root@centos7 ~]
PV VG Fmt Attr PSize PFree
/dev/sda2 centos_centos7 lvm2 a-- <99.00g 4.00m
/dev/sdb1 testvg lvm2 a-- 9.98g 9.98g
/dev/sdc1 testvg lvm2 a-- 9.98g 9.98g
[root@centos7 ~]
Volume group "testvg" successfully created
[root@centos7 ~]
VG
centos_centos7 1 3 0 wz--n- <99.00g 4.00m
testvg 2 1 0 wz--n- <19.97g <19.97g
[root@centos7 ~]
Logical volume "testlv" created.
[root@centos7 ~]
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home centos_centos7 -wi-ao---- 46.99g
root centos_centos7 -wi-ao---- 50.00g
swap centos_centos7 -wi-ao---- 2.00g
testlv testvg -wi-a----- 5.00g
[root@centos7 ~]
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
[root@centos7 ~]
/dev/mapper/centos_centos7-root: UUID="458d1621-f955-41da-9c61-4cda5b7543b0" TYPE="xfs"
/dev/sda2: UUID="uv2ZRK-hGZh-0Nfa-3yAz-QXqy-ONu1-AbCOIj" TYPE="LVM2_member"
/dev/sda1: UUID="f7cd1056-9888-4bfd-ae48-0eccace210e3" TYPE="xfs"
/dev/sdb1: UUID="ZQiO6V-WdlI-aDYd-FSDP-0kjX-y5tm-2DdY6a" TYPE="LVM2_member"
/dev/sr0: UUID="2019-09-11-18-50-31-00" LABEL="CentOS 7 x86_64" TYPE="iso9660" PTTYPE="dos"
/dev/mapper/centos_centos7-swap: UUID="a0f7086a-edeb-446b-8c21-377f124045ea" TYPE="swap"
/dev/mapper/centos_centos7-home: UUID="67154c0f-af61-46be-87ae-f0ef0620190a" TYPE="xfs"
/dev/sdc1: UUID="rzKRqQ-qNhx-PCoD-hc7Z-XFD5-xx3b-2OvKDQ" TYPE="LVM2_member"
/dev/mapper/testvg-testlv: UUID="d4c744a0-96b7-4eae-9572-df84a3547379" TYPE="ext4"
echo /dev/testvg/testlv /users ext4 defaults 0 0 >> /etc/fstab
[root@centos7 ~]
[root@centos7 ~]
[root@centos7 ~]
Filesystem Size Used Avail Use% Mounted on
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/mapper/centos_centos7-root 50G 5.4G 45G 11% /
/dev/sda1 1014M 193M 822M 20% /boot
/dev/mapper/centos_centos7-home 47G 39M 47G 1% /home
tmpfs 182M 12K 182M 1% /run/user/42
tmpfs 182M 0 182M 0% /run/user/1003
tmpfs 182M 0 182M 0% /run/user/0
/dev/mapper/testvg-testlv 4.8G 20M 4.6G 1% /users