记录这次PVE重装的所有步骤

  1. Backup all vms in Stop mode to an external drive (e.g. NAS)
  2. 将网口连接网线以便PVE自动识别IP
  3. Reinstall PVE (all data cleared)
    • set maxvz as 0 (no local-lvm data)
    • set domain as pve@example.com
  4. Remove local-lvm (no need to do if set maxvz as 0)
  5. lvextend -rl +100%FREE /dev/pve/root (resize pve/root to take the whole disk space)
  6. 在数据中心中添加external drive and restore all vms
  7. (Optional) PCI passthrough
  8. (Optional) 设置动态IP地址和网关
  9. Upload SSL certificate
  10. Enable 2FA
  11. Enable repo for pve-no-subscription & Disable pve-enterprise-subscription

关于USB硬盘休眠

如果想让虚拟机(比如OMV)自动休眠所连接的USB硬盘,需要在使用USB硬盘的虚拟机(如OMV)里安装hd-idle。

通过/etc/fstab挂载到虚拟机(比如OMV),开机后硬盘可能会持续运转(硬盘等持续闪烁),一段时间后会停止运转(硬盘灯常亮),10分钟后会自动休眠(硬盘灯呼吸)。

如果硬盘超过10分钟仍不休眠,依次尝试以下步骤:

  1. 在虚拟机(如OMV)中禁用磁盘相关设置,包括:
    • 高级电源管理
    • 停转时间
  2. PCI直通
  3. 在PVE上安装hd-idle (no need)

OMV虚拟机配置

/etc/fstab配置

# Exfat drive
# /dev/disk/by-uuid/0413-1C25             /srv/dev-disk-by-uuid-0413-1C25 exfat   defaults,nofail,uid=1024,gid=100        0 2
# /dev/disk/by-uuid/0413-1C25             /media/usb/backup exfat   defaults,nofail,uid=1024,gid=100        0 2
# /dev/disk/by-uuid/C657-6B4A             /srv/dev-disk-by-uuid-C657-6B4A exfat   defaults,nofail,uid=1024,gid=100        0 2

# Media drive
192.168.50.51:/volume1/Media             /mnt/nas nfs   defaults        0 0
192.168.50.51:/volume1/homes             /mnt/homes nfs   defaults        0 0
192.168.50.51:/volume2/Games             /mnt/games nfs   defaults        0 0
192.168.50.51:/volume2/Backup             /mnt/backup nfs   defaults        0 0
192.168.50.51:/volume2/CloudNAS             /mnt/cloud nfs   defaults        0 0

# >>> [openmediavault]
/dev/disk/by-uuid/A8E7-EFD6             /srv/dev-disk-by-uuid-A8E7-EFD6 exfat   defaults,nofail 0 2
# <<< [openmediavault]

/etc/crontab配置

15 3    1 * *   root    RESTIC_PASSWORD=****** restic -r /srv/dev-disk-by-uuid-A8E7-EFD6/restic-repo backup --verbose /mnt/nas/Personal /mnt/homes /mnt/nas/calibre-manga-library /mnt/nas/calibre-book-library /mnt/nas/public /mnt/backup/backup >> /home/admin/restic-log.txt