king 发表于 2026-5-15 10:31:33

PVE安装后一些优化操作

一、通过脚本显示状态信息及直通效果如下,可以显示硬件设备的温度及数字化的使用情况占比等



通过下面大佬的脚本进行优化功能,下载地址:
https://github.com/KoolCore/Proxmox_VE_Status
如果无法访问,可通过最下面的代码块复制后本地运行
主要功能介绍:
1.修改信息栏
bash -c "$(wget -qLO - https://raw.githubusercontent.com/KoolCore/Proxmox_VE_Status/refs/heads/main/pve.sh)"
如果发现 curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused 这种错误,年轻人,你的网络运营商屏蔽了 GitHub。请自行处理网络环境问题。 大概1-3分钟后,按下CTRL+F5强制刷新本页面即可。 代码运行过程会执行软件包更新,可能需要你多次输入y以继续执行代码,请保持关注代码执行过程。

2.开启硬件直通:
(8.3新版本后应该是不需要这个脚本运行了。核显直通请自行搜索:Intel核显直通/AMD核显直通):
bash -c "$(wget -qLO - https://raw.githubusercontent.com/KoolCore/Proxmox_VE_Status/refs/heads/main/passthrough.sh)"
3.还原默认信息栏:
bash -c "$(wget -qLO - https://raw.githubusercontent.com/KoolCore/Proxmox_VE_Status/refs/heads/main/restore.sh)"
二、给PVE的扩容(通过移除local-lvm可,能会影响PVE的部分快照功能)
在shell里边输入:
lvremove pve/data
点击y后,再输入:
lvextend -l +100%FREE -r pve/root
再点击数据中心 – 存储 – local-lvm – 移除,再双击local,把内容里的所有选项都选中。
三、给PVE换源(可以第一步操作)
一般情况下,需要同时修改基础系统(Debian)的源文件 /etc/apt/sources.list 和 Proxmox 的源文件。
清华源
sed -i 's|^deb http://ftp.debian.org|deb https://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
sed -i 's|^deb http://security.debian.org|deb https://mirrors.tuna.tsinghua.edu.cn/debian-security|g' /etc/apt/sources.list
中科大源
sed -i 's|^deb http://ftp.debian.org|deb https://mirrors.ustc.edu.cn|g' /etc/apt/sources.list
sed -i 's|^deb http://security.debian.org|deb https://mirrors.ustc.edu.cn/debian-security|g' /etc/apt/sources.list
修改 Proxmox 的源文件,可以使用如下命令:
清华源
echo "deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian/pve bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
中科大源
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
PVE8之后默认安装Ceph仓库源文件 /etc/apt/sources.list.d/ceph.list,可以使用如下命令更换源:
清华源
if [ -f /etc/apt/sources.list.d/ceph.list ]; then
CEPH_CODENAME=`ceph -v | grep ceph | awk '{print $(NF-1)}'`
source /etc/os-release
echo "deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian/ceph-$CEPH_CODENAME $VERSION_CODENAME no-subscription" > /etc/apt/sources.list.d/ceph.list
fi
中科大源
if [ -f /etc/apt/sources.list.d/ceph.list ]; then
CEPH_CODENAME=`ceph -v | grep ceph | awk '{print $(NF-1)}'`
source /etc/os-release
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-$CEPH_CODENAME $VERSION_CODENAME no-subscription" > /etc/apt/sources.list.d/ceph.list
fi
更改完 sources.list 文件后请运行 apt update 更新索引以生效。
页: [1]
查看完整版本: PVE安装后一些优化操作