diff --git a/docs/tech/OPNsense-26-1-Install-and-Configuration.md b/docs/tech/OPNsense-26-1-Install-and-Configuration.md index 68875f0..215e691 100644 --- a/docs/tech/OPNsense-26-1-Install-and-Configuration.md +++ b/docs/tech/OPNsense-26-1-Install-and-Configuration.md @@ -9,7 +9,7 @@ | 192.168.1.3 | \ | \ | | 192.168.1.4 | \ | \ | | 192.168.1.5 | CatTomServer1 | 54:f6:c5:f4:98:b0 | -| 192.168.1.6 | \ | \ | +| 192.168.1.6 | CatTomPBS | \ | | 192.168.1.7 | CatTomServer2 | 24:5E:BE:69:90:C9 | | 192.168.1.8 | CatTomServer3 | (vmbr0) | | 192.168.1.9 | CatTomServer3-2 | \ | diff --git a/docs/tech/Proxmox-Backup-4-Install-and-Configuration.md b/docs/tech/Proxmox-Backup-4-Install-and-Configuration.md new file mode 100644 index 0000000..40cd8ea --- /dev/null +++ b/docs/tech/Proxmox-Backup-4-Install-and-Configuration.md @@ -0,0 +1,142 @@ +# 安装与配置 Proxmox Backup Server 4 + +## 下载 ISO 镜像 + +[ISO - Proxmox Backup Server](https://www.proxmox.com/en/downloads/proxmox-backup-server/iso) + +## 创建虚拟机 + +- 操作系统 + - 选择 `proxmox-backup-server_4.1-1.iso` +- 系统 + - 机型: `q35` + - BIOS: `OVMF (UEFI)` + - 添加 EFI 磁盘: True + - 格式: `QEMU 映像格式 (qcow2)` + - 预注册密钥: False + - QEMU 代理: True +- 磁盘 + - 磁盘大小: `30` + - 丢弃/SSD 仿真: True +- CPU + - 核心: `4` + - 类别: `host` +- 内存: `2048` +- 网络 + - `vmbr1` (对应宿主机的 2.5G 网卡,按照实际情况设置) + - Multiqueue: `4` (与 CPU 核心数保持一致,按照实际情况设置) + +## 安装 + +选择 `Install Proxmox VE (Graphical)`。 + +点击 `I agree`。 + +选择服务器的系统盘,点击 `Options` 可以选择文件系统 `ext4`,下面进一步设置分区: + +- hdsize (硬盘总容量): (保持默认) +- swapsize (虚拟内存): `2` +- maxroot (local(系统分区)最大容量): (按实际情况 `30`) +- minfree (预留的未分配空间): `2` + +选择所在国家、时区和键盘布局。 + +输入密码和邮箱地址(建议填写真实地址)。 + +选择 Proxmox 的管理网卡,输入主机名、IP、网关和 DNS 服务器。 + +检查配置内容,点击 `Install`。 + +## 安装 QEMU Guest Agent + +``` bash +apt update && apt install qemu-guest-agent +systemctl start qemu-guest-agent +``` + +## 关闭订阅提示弹窗 + +来源: [PBS Post Install](https://community-scripts.org/categories?category=proxmox-and-virtualization&preview=post-pbs-install) + +``` bash +bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/post-pbs-install.sh)" + +Disabled subscription nag - Yes +``` + +## 存储 + +将 NAS 中的相关目录通过 nfs 挂载至 PBS。 + +``` bash +# Install +sudo apt -y update && sudo apt -y install nfs-kernel-server nfs-common +# Create mount point on client +sudo mkdir -p /mnt/nas +# Mount directories on client +sudo mount [host_ip]:[/path/on/host] /mnt/nas +# Check stats on client +sudo df -h +# Mount the directories at boot +sudo echo "[host_ip]:[/path/on/host] /mnt/nas nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0" >> /etc/fstab +``` + +增加 NFS 存储以存放备份。 + +- 点击 添加数据存储 +- Datastore Type: `本地` +- 备份路径: `/mnt/nas` + +## 修改 SSH 配置 + +参照[此处](https://blog.cattom.site/tech/Commands-for-Server-Operation-and-Maintenance/#ssh)完成。 + +## 为虚拟机启用 TRIM / Discard + +在 PVE 面板中,对虚拟机执行以下操作: + +- 磁盘总线: 确保使用 SCSI (配合 `VirtIO SCSI single` 控制器)。 +- 启用 Discard: 在「硬件」->「硬盘」编辑界面勾选「丢弃」。 +- 启用 SSD 仿真: 在「硬件」->「硬盘」编辑界面勾选「SSD 仿真」。 + - 对 Windows: 必选。这会让 Windows 自动开启计划任务进行 TRIM。 + - 对 Linux: 建议选。这会让 Linux 内核更积极地识别并处理丢弃块。 + +### Linux 优化建议 + +- 检查状态: 默认通常已开启 `fstrim.timer`。 + + ``` bash + systemctl status fstrim.timer + ``` + +- 手动触发: 如果刚刚删除了大量数据并且希望立即缩减下一次备份的大小,请手动执行: + + ``` bash + sudo fstrim -av + ``` + +- QEMU Guest Agent:确保安装了 `qemu-guest-agent`,这有助于 PVE 在备份时更好地协调文件系统静默。 + + ``` bash + sudo apt update && sudo apt install qemu-guest-agent -y + ``` + +### Windows 优化建议 + +- VirtIO 驱动: 确保安装了最新的 VirtIO Drivers(特别是 viostor 或 vioscsi 驱动),这是 Discard 指令透传的基础。 +- 检查 TRIM 是否激活: 以管理员身份运行 PowerShell: + + ``` powershell + fsutil behavior query DisableDeleteNotify + ``` + + - 结果为 0 表示已启用。 + - 结果为 1 表示已禁用,需运行 `fsutil behavior set DisableDeleteNotify 0` 开启。 + +## 参考 + +[Storage - Proxmox VE](https://pve.proxmox.com/wiki/Storage) + +[Proxmox VE Storage](https://proxmox.homelab.cattom.site/pve-docs/chapter-pvesm.html) + +[QEMU/KVM Virtual Machines](https://proxmox.homelab.cattom.site/pve-docs/chapter-qm.html) \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index fc6c838..56557b0 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -104,6 +104,7 @@ nav: - "手把手教你备份和还原 Docker 卷": tech/Backup-and-Restore-of-Docker-Volumes-A-Step-by-Step-Guide.md - "在 Ubuntu 24.04 上添加交换空间": tech/How-to-Add-Swap-Space-on-Ubuntu-2404.md - "安装和配置 Material for MkDocs": tech/Install-Material-for-MkDocs.md + - "安装与配置 Proxmox Backup Server 4": tech/Proxmox-Backup-4-Install-and-Configuration.md - "Authentik: 搭建属于自己的单点登录服务": tech/Build-Your-Own-SSO.md - "创建和管理 Linux 服务器用于身份验证的 SSH 密钥": tech/Creating-and-Managing-SSH-Keys-for-Authentication-on-Linux-Servers.md - "服务器运行与维护常用命令": tech/Commands-for-Server-Operation-and-Maintenance.md