一、自建yum仓库,分别为网络源和本地源

[root@centos7 ~]# cd /etc/yum.repos.d/
[root@centos7 yum.repos.d]# mkdir bak #建立备份文件夹
[root@centos7 yum.repos.d]# mv *.repo bak/ #将系统自带yum仓库备份
[root@centos7 yum.repos.d]# vim base.repo #新建仓库文件
[root@centos7 yum.repos.d]# cat base.repo
[development] #本地光盘yum源
name=dvdbase repo
baseurl=file:///mnt/cdrom/
enabled=
gpgcheck=
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-CentOS-7 [aliyun] #阿里云yum源
name=aliyun repo
baseurl=https://mirrors.aliyun.com/centos/$releasever/os/$basearch/
enabled=
gpgchedk=
gpgkey=https://mirrors.aliyun.com/centos/$releasever/os/$basearch/RPM-GPG-KEY-CentOS-$releasever
[root@centos7 yum.repos.d]# mkdir /mnt/cdrom/ #创建光盘挂载点
[root@centos7 yum.repos.d]# mount /dev/sr0 /mnt/cdrom/ #挂载光盘
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, langpacks
Cleaning repos: aliyun development
Cleaning up list of fastest mirrors
Other repos take up M of disk space (use --verbose for details)
[root@centos7 yum.repos.d]# yum repolist #查看生效的yum源
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
aliyun | 3.6 kB ::
development | 3.6 kB ::
(/): development/group_gz | kB ::
(/): development/primary_db | 6.0 MB ::
(/): aliyun//x86_64/group_gz | kB ::
(/): aliyun//x86_64/primary_db | 6.0 MB ::
repo id repo name status
aliyun//x86_64 aliyun repo ,
development dvdbase repo ,
repolist: ,

二、编译安装http2.4,实现可以正常访问,并将编译步骤和结果提交

[root@centos7 ~]# ll httpd-2.4..tar  #准备包
-rw-r--r-- root root Dec : httpd-2.4..tar
[root@centos7 ~]# tar -xvf httpd-2.4..tar #解包
[root@centos7 ~]# cd httpd-2.4./
[root@centos7 httpd-2.4.]# ./configure --prefix=/usr/local/httpd #编译安装
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-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
configure:
configure: Configuring Apache Portable Runtime library...
configure:
checking for APR... no
configure: error: APR not found. Please read the documentation.
#发现有错误,一般都是缺少相关包,经过几次提示,安装好以下包后未报错
[root@centos7 httpd-2.4.]# yum install -y apr-devel apr-util-devel gcc pcre-devel
[root@centos7 httpd-2.4.]# ./configure --prefix=/usr/local/httpd
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-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
...中间省略
configure: summary of build options: Server Version: 2.4.
Install prefix: /usr/local/httpd
C compiler: gcc -std=gnu99
CFLAGS: -pthread
CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE
LDFLAGS:
LIBS:
C preprocessor: gcc -E
[root@centos7 httpd-2.4.]# make
[root@centos7 httpd-2.4.]# make install
[root@centos7 httpd-2.4.]# /usr/local/httpd/bin/apachectl start #安装完成后启动服务
[root@centos7 httpd-2.4.]# curl http://192.168.214.17 #测试访问是可以的
<html><body><h1>It works!</h1></body></html>

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

[root@centos7 ~]# fdisk /dev/sdb  #新建分区
Welcome to fdisk (util-linux 2.23.). 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 0x001b493c. Command (m for help): p Disk /dev/sdb: MB, bytes, sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk label type: dos
Disk identifier: 0x001b493c Device Boot Start End Blocks Id System Command (m for help): n
Partition type:
p primary ( primary, extended, free)
e extended
Select (default p): p
Partition number (-, default ):
First sector (-, default ):
Using default value
Last sector, +sectors or +size{K,M,G} (-, default ): +2G
Partition of type Linux and of size GiB is set Command (m for help): p Disk /dev/sdb: MB, bytes, sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk label type: dos
Disk identifier: 0x001b493c Device Boot Start End Blocks Id System
/dev/sdb1 Linux Command (m for help): w
The partition table has been altered! Calling ioctl() to re-read partition table.
Syncing disks.
[root@centos7 ~]# lsblk /dev/sdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb : 5G disk
└─sdb1 : 2G part
#开始创建文件系统
[root@centos7 ~]# mke2fs -t ext4 -b -L TEST -m /dev/sdb1
mke2fs 1.42. (-Dec-)
Filesystem label=TEST
OS type: Linux
Block size= (log=)
Fragment size= (log=)
Stride= blocks, Stripe width= blocks
inodes, blocks
blocks (1.00%) reserved for the super user
First data block=
Maximum filesystem blocks=
block groups
blocks per group, fragments per group
inodes per group
Superblock backups stored on blocks:
, , , , , , , Allocating group tables: done
Writing inode tables: done
Creating journal ( blocks): done
Writing superblocks and filesystem accounting information: done
[root@centos7 ~]# blkid /dev/sdb1
/dev/sdb1: LABEL="TEST" UUID="c3f133c8-6e14-425d-8b24-f90ab30bb8d1" TYPE="ext4"
[root@centos7 ~]# mkdir /test #创建挂载目录
[root@centos7 ~]# mount -o acl /dev/sdb1 /test #临时挂载
[root@centos7 ~]# vim /etc/fstab #在fstab中添加以下内容,实现开机自动挂载
UUID=c3f133c8-6e14-425d-8b24-f90ab30bb8d1 /test ext4 defaults,acl

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

1、新增两块硬盘,大小分别为5G和15G,设备名分别为 /dev/sdb 和 /dev/sdc

[root@centos7 ~]# lsblk /dev/sdb /dev/sdc
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb : 5G disk
sdc : 15G disk

2、创建PV

[root@centos7 ~]# pvcreate /dev/sd{b,c}
Physical volume "/dev/sdb" successfully created.
Physical volume "/dev/sdc" successfully created.
[root@centos7 ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sdb lvm2 --- .00g .00g
/dev/sdc lvm2 --- .00g .00g

3、创建VG,并设置PE大小为16MB

[root@centos7 ~]# vgcreate testvg /dev/sd{b,c} -s 16m
Volume group "testvg" successfully created
[root@centos7 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
testvg wz--n- <.97g <.97g
[root@centos7 ~]# vgdisplay
--- Volume group ---
VG Name testvg
System ID
Format lvm2
Metadata Areas
Metadata Sequence No
VG Access read/write
VG Status resizable
MAX LV
Cur LV
Open LV
Max PV
Cur PV
Act PV
VG Size <19.97 GiB
PE Size 16.00 MiB #PE大小
Total PE
Alloc PE / Size /
Free PE / Size / <19.97 GiB
VG UUID fLJ0GI-hg5u-1QJ0-7ihI-ezKF-RyIP-TQUOgh

4、创建LV

[root@centos7 ~]# lvcreate -n testlv -L 5G testvg
Logical volume "testlv" created.
[root@centos7 ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
testlv testvg -wi-a----- .00g
[root@centos7 ~]# lvdisplay
--- Logical volume ---
LV Path /dev/testvg/testlv
LV Name testlv
VG Name testvg
LV UUID DUZV6O-Guj4-C3IR-NEwI-Bj4d-F9Xj-W2jqal
LV Write Access read/write
LV Creation host, time centos7.localdomain, -- :: +
LV Status available
# open
LV Size 5.00 GiB
Current LE
Segments
Allocation inherit
Read ahead sectors auto
- currently set to
Block device :

5、创建文件系统,并挂载

[root@centos7 ~]# mkfs.xfs /dev/testvg/testlv
meta-data=/dev/testvg/testlv isize= agcount=, agsize= blks
= sectsz= attr=, projid32bit=
= crc= finobt=, sparse=
data = bsize= blocks=, imaxpct=
= sunit= swidth= blks
naming =version bsize= ascii-ci= ftype=
log =internal log bsize= blocks=, version=
= sectsz= sunit= blks, lazy-count=
realtime =none extsz= blocks=, rtextents=
[root@centos7 ~]# blkid
/dev/sda1: UUID="06fb735b-a954-479b-a7e2-5615d5ac1429" TYPE="xfs"
/dev/sda2: UUID="39a8e496-0019-4c2e-9cfe-2bb657078465" TYPE="xfs"
/dev/sda3: UUID="bf1909f2-e77e-4fe2-b8a8-c48bfb2dfeac" TYPE="xfs"
/dev/sda5: UUID="18046ac9-2bc9-4b83-b179-1453c4c40c51" TYPE="swap"
/dev/sdb: UUID="iJM4vP-g6pN-W0N5-J7k8-5u9w-Ywz2-Fdp1AR" TYPE="LVM2_member"
/dev/sdc: UUID="ZRpN8E-SD9n-p1sN-i623-vsAO-iqSL-6WYo7D" TYPE="LVM2_member"
/dev/mapper/testvg-testlv: UUID="7a0d0bc4-938c-4bbd-843c-0b248aec174b" TYPE="xfs"
[root@centos7 ~]# mkdir /users #创建挂载点
[root@centos7 ~]# mount /dev/mapper/testvg-testlv /users #临时挂载
[root@centos7 ~]# cd /users/
#如要实现自动化永久挂载,可以/etc/fstab 文件后添加以下内容
[root@centos7 users]# vim /etc/fstab
UUID=iJM4vP-g6pN-W0N5-J7k8-5u9w-Ywz2-Fdp1AR /users xfs defaults

第六周作业—N42-虚怀若谷的更多相关文章

  1. 2018-2019-1 20189221 《Linux内核原理与分析》第六周作业

    2018-2019-1 20189221 <Linux内核原理与分析>第六周作业 实验五 实验过程 将Fork函数移植到Linux的MenuOS fork()函数通过系统调用创建一个与原来 ...

  2. 201621123080《java程序设计》第六周作业总结

    201621123080<java程序设计>第六周作业总结 1. 本周学习总结 2. 书面作业 clone方法 1.1 在test1包中编写Employee类,在test2包中新建一个Te ...

  3. 2019-2020-1 20199329《Linux内核原理与分析》第六周作业

    <Linux内核原理与分析>第六周作业 一.本周内容概述: 学习系统调用的相关理论知识,并使用库函数API和C代码中嵌入汇编代码两种方式使用getpid()系统调用 学习系统调用syste ...

  4. 2020-2021-1 20209307《Linux内核原理与分析》第六周作业

    这个作业属于哪个课程 <2020-2021-1Linux内核原理与分析)> 这个作业要求在哪里 <2020-2021-1Linux内核原理与分析第六周作业> 这个作业的目标 & ...

  5. 1903021116—吉琛—Java第六周作业—类的定义

    项目 内容 课程班级博客链接 19信计班 这个作业要求链接 第六周作业链接 java面向对象的概念和定义 博客名称 学号-姓名-Java第六周作业-题目自拟 要求 每道题要有题目,代码(使用插入代码, ...

  6. C语言--第六周作业评分和总结(5班)

    作业链接:https://edu.cnblogs.com/campus/hljkj/CS2017-5/homework/1250 一.评分要求 要求1 完成PTA第六周所有题,若存在抄袭现象,倒扣此题 ...

  7. 1903021121—刘明伟—Java第六周作业—java类

    项目   内容 课程班级博客链接  19信计班(本) 作业要求链接 第6周作业 扩展阅读 java面向对象的概念和定义 作业要求 每道题要有题目,代码,截图(只截运行结果). 题目1: 一个Phone ...

  8. 201621123062《java程序设计》第六周作业总结

    1. 本周学习总结 1.1 面向对象学习暂告一段落,请使用思维导图,以封装.继承.多态为核心概念画一张思维导图或相关笔记,对面向对象思想进行一个总结. 注1:关键词与内容不求多,但概念之间的联系要清晰 ...

  9. 2019春第六周作业Compile Summarize

    这个作业属于那个课程 C语言程序设计II 这个作业要求在哪里 在这里 我在这个课程的目标是 能够熟练掌握指针的用法 这个作业在那个具体方面帮助我实现目标 对指针的使用更加得心应手 参考文献与网址 C语 ...

  10. 20169207《Linux内核原理与分析》第六周作业

    这周的作业同样分为两部分,第一部分的学习MOOC第四节[扒开系统调用的三层皮],并结合实验楼的实验四深入学习.第二部分阅读学习教材「Linux内核设计与实现 (Linux Kernel Develop ...

随机推荐

  1. 十六、简单配置jenkins执行本地的robotframework项目

    A.前期准备: 1.登录jenkins 2.系统管理-插件管理-高级-上传插件(http://mirrors.jenkins-ci.org/plugins/robot/,中选择一个版本的插件下载至本地 ...

  2. netstat和ps

    ps是查看进程, 主要是针对本机的, 进程活动, 更多的是关注性能, 关注对机器 资源的使用清况 netstat是查看网络状态, 主要是针对网络的.是查看网络上, 对内网 外网的活动情况, 更多的是关 ...

  3. 011-elasticsearch5.4.3【四】-聚合操作【二】-桶聚合【bucket】过滤、嵌套、反转、分组、排序、范围

    一.概述 bucketing(桶)聚合:划分不同的“桶”,将数据分配到不同的“桶”里.非常类似sql中的group语句的含义. metric既可以作用在整个数据集上,也可以作为bucketing的子聚 ...

  4. 阶段1 语言基础+高级_1-3-Java语言高级_04-集合_04 数据结构_1_数据结构_栈

    2.1 数据结构有什么用? 当你用着java里面的容器类很爽的时候,你有没有想过,怎么ArrayList就像一个无限扩充的数组,也好像链表之类 的.好用吗?好用,这就是数据结构的用处,只不过你在不知不 ...

  5. python常用包官网

    Pandas http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.reset_index.html?high ...

  6. redis 设置密码 和 redis.config文件

  7. POJ-3468 A Simple Problem with Integers (区间求和,成段加减)

    You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of op ...

  8. Java反射学习-3 - 反射获取属性,方法,构造器

    package cn.tx.reflect; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import ...

  9. 使用hash表进行数组去重

    哈希表(Hash table,也叫散列表),是根据关键码值(Key value)而直接进行访问的数据结构.也就是说,它通过把关键码值映射到表中一个位置来访问记录,以加快查找的速度.这个映射函数叫做散列 ...

  10. 解决pip源问题 安装不了第三方库问题

    1. 参考链接: https://www.biaodianfu.com/python-pip.html http://blog.csdn.net/u012450329/article/details/ ...