<pre class="wp-block-syntaxhighlighter-code">
[root@iZ23wv7v5ggZ ~]# cd /etc/yum.repos.d/
[root@iZ23wv7v5ggZ yum.repos.d]# ls -l
total 8
-rw-r--r-- 1 root root 2523 Jan 28 2022 CentOS-Base.repo
-rw-r--r-- 1 root root 664 Jan 28 2022 epel.repo
[root@iZ23wv7v5ggZ yum.repos.d]# rm -rf /etc/yum.repos.d/*.repo
[root@iZ23wv7v5ggZ yum.repos.d]# ls -l
total 0
[root@iZ23wv7v5ggZ yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7221 100 7221 0 0 3763 0 0:00:01 0:00:01 --:--:-- 3762
[root@iZ23wv7v5ggZ yum.repos.d]# curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7215 100 7215 0 0 11531 0 --:--:-- --:--:-- --:--:-- 11525
[root@iZ23wv7v5ggZ yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
File contains no section headers.
file: file:///etc/yum.repos.d/CentOS-Base.repo, line: 1
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\n'
[root@iZ23wv7v5ggZ yum.repos.d]# ls -l
total 16
-rw-r--r-- 1 root root 7221 Jun 6 14:32 CentOS-Base.repo
-rw-r--r-- 1 root root 7215 Jun 6 14:32 epel.repo
[root@iZ23wv7v5ggZ yum.repos.d]#
</pre>















[root@iZ23wv7v5ggZ ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 464M 0 464M 0% /dev
tmpfs 482M 0 482M 0% /dev/shm
tmpfs 482M 440K 481M 1% /run
tmpfs 482M 0 482M 0% /sys/fs/cgroup
/dev/vda1 20G 2.9G 16G 16% /
tmpfs 482M 0 482M 0% /tmp
tmpfs 97M 0 97M 0% /run/user/0
[root@iZ23wv7v5ggZ ~]# fdisk -lu
Disk /dev/vda: 20 GiB, 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
Disklabel type: dos
Disk identifier: 0x51cf5d51
Device Boot Start End Sectors Size Id Type
/dev/vda1 * 2048 41943039 41940992 20G 83 Linux
Disk /dev/vdb: 40 GiB, 42949672960 bytes, 83886080 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
Disklabel type: dos
Disk identifier: 0xc0ac4089
Device Boot Start End Sectors Size Id Type
/dev/vdb1 2048 83886079 83884032 40G 83 Linux
[root@iZ23wv7v5ggZ ~]#
[root@iZ23wv7v5ggZ ~]# blkid
/dev/vda1: UUID="3bda0135-1a08-4c3e-8216-e07c05dd073a" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="51cf5d51-01"
/dev/vdb1: UUID="0feecc5e-62d8-4282-98b3-cdc8ecf51952" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="c0ac4089-01"
[root@iZ23wv7v5ggZ ~]#
[root@iZ23wv7v5ggZ /]# mkdir /data
[root@iZ23wv7v5ggZ /]# vi /etc/fstab
[root@iZ23wv7v5ggZ /]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Thu May 25 04:02:20 2023
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
UUID=3bda0135-1a08-4c3e-8216-e07c05dd073a / ext4 defaults 1 1
UUID=0feecc5e-62d8-4282-98b3-cdc8ecf51952 /data ext4 defaults 0 0
[root@iZ23wv7v5ggZ /]#
[root@iZ23wv7v5ggZ /]# mount /dev/vdb1 /data
[root@iZ23wv7v5ggZ /]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 464M 0 464M 0% /dev
tmpfs 482M 0 482M 0% /dev/shm
tmpfs 482M 440K 481M 1% /run
tmpfs 482M 0 482M 0% /sys/fs/cgroup
/dev/vda1 20G 2.9G 16G 16% /
tmpfs 482M 0 482M 0% /tmp
tmpfs 97M 0 97M 0% /run/user/0
/dev/vdb1 40G 24G 14G 65% /data
[root@iZ23wv7v5ggZ /]#
[root@iZ23wv7v5ggZ ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 464M 0 464M 0% /dev
tmpfs 482M 0 482M 0% /dev/shm
tmpfs 482M 436K 481M 1% /run
tmpfs 482M 0 482M 0% /sys/fs/cgroup
/dev/vda1 20G 2.9G 16G 16% /
tmpfs 482M 0 482M 0% /tmp
/dev/vdb1 40G 24G 14G 65% /data
tmpfs 97M 0 97M 0% /run/user/0
[root@iZ23wv7v5ggZ ~]#
[root@iZ23wv7v5ggZ ~]# cd /etc/yum.repos.d/
[root@iZ23wv7v5ggZ yum.repos.d]# ls -l
total 20
-rw-r--r-- 1 root root 1475 May 25 12:15 AliYun.repo
-rw-r--r-- 1 root root 703 Jun 10 2022 epel-modular.repo
-rw-r--r-- 1 root root 664 Jun 10 2022 epel.repo
-rw-r--r-- 1 root root 781 Jun 10 2022 epel-testing-modular.repo
-rw-r--r-- 1 root root 742 Jun 10 2022 epel-testing.repo
[root@iZ23wv7v5ggZ yum.repos.d]#
Linux 服务器运维、部署与线上故障排查
如果你的网站或后端服务部署在 Linux 服务器上,遇到访问异常、Nginx 配置问题、MySQL / Redis 异常、Docker 服务不可用、磁盘占满、CPU / 内存过高等问题,可以联系我做一次远程排查。
适合以下场景:
✅ 网站打不开或访问不稳定
✅ Nginx / PHP-FPM 配置异常
✅ MySQL / Redis 性能或连接问题
✅ Docker 服务部署与维护
✅ 服务器迁移与环境配置
✅ CPU / 内存 / 磁盘异常排查
服务内容:
✅ Linux 环境检查
✅ 网站部署与迁移
✅ Nginx / PHP-FPM / MySQL / Redis 排查
✅ Docker 配置与维护
✅ 服务器性能分析
✅ 长期远程运维支持
如需咨询,请联系我,并注明:Linux 运维咨询。
联系方式:
Telegram:@shuijingwan
微信:13980074657
邮箱:shuijingwanwq@gmail.com

发表回复