1、创建一个3G大小的分区,并格式化为xfs的文件系统类型,将/etc/passwd文件复制到该分区
[root@xiawu ~]# fdisk /dev/nvme0n1
Welcome to fdisk (util-linux 2.37.4).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.
Command (m for help): n
Partition type
p primary (2 primary, 0 extended, 2 free)
e extended (container for logical partitions)
Select (default p): e
Partition number (3,4, default 3): 3
First sector (26208256-41943039, default 26208256):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (26208256-41943039, default 41943039): +5G
Created a new partition 3 of type 'Extended' and of size 5 GiB.
Command (m for help): n
Partition type
p primary (2 primary, 1 extended, 1 free)
l logical (numbered from 5)
Select (default p): l
Adding logical partition 5
First sector (26210304-36694015, default 26210304):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (26210304-36694015, default 36694015): +3G
Created a new partition 5 of type 'Linux' and of size 3 GiB.
Command (m for help): w
The partition table has been altered.
Syncing disks.
格式为xfs系统文件
2、安装httpd软件包,并让该程序开机自启动,关闭防火墙服务
思路:先写yum源,在用yum安装软件包
第一步:在目录/etc/repos.d下创建suibian.repo
[root@xiawu ~]# cd /etc/yum.repos.d(切/etc/yum.repos.d目录)
[root@xiawu yum.repos.d]# ll
total 4
-rw-r--r--. 1 root root 358 Jul 1 13:03 redhat.repo
-rw-r--r--. 1 root root 0 Jul 13 15:44 suibian.repo
[root@xiawu yum.repos.d]# vim suibian.repo(创建suibian.repo,并且打开编辑)
第二步:安装httpd软件包
[root@xiawu ~]# yum install httpd
第三步:开httpd服务,关防火墙
[root@xiawu ~]# systemctl enable --now httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
[root@xiawu ~]# systemctl disable firewalld
Removed "/etc/systemd/system/multi-user.target.wants/firewalld.service".
Removed "/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service".