跟链式启动说拜拜——ProxmoxVE原生多启动分区功能
起因
这两天在捣鼓x79平台(菊花RH2288Hv2),这玩意原生不支持nvme启动。菊花给它更新BIOS更新到19年也没把模块加进去,然后BIOS升级包加密,还是Insyde出品,自己加模块进去约等于不可能。
这机器只支持USB2.0,因此U盘装PVE性能低下;我也不会再去做个冤种,买个小容量SATA盘,肯定得还是放在垃圾佬最爱的16G傲腾上。那么必须解决启动问题。
最初的尝试
起初网上冲浪了解到,对于x79平台,一般的解决方案是用Clover等开源引导进行链式引导(chainloader),即先在BIOS能够引导的设备(U盘、SATA盘等)上放好这类程序,用其引导启动,这类程序会完成加载nvme驱动的过程,再把启动过程交给nvme盘上原生的引导完成。
于是按此思路忙活了一下午,得出结论——可行,但不能用。Clover可以引导启动,但每次必须手动操作,无法达到无人值守的程度。并且由于Clover的本职工作是引导黑苹果,配置其自动启动需要机器安装MacOS,显然无法实现。
然后又有另一种思路,就是拷贝PVE原有的启动文件。尝试了手动操作,不可行;再去查阅PVE文档,柳暗花明。
完美的解决
经过查阅,在PVE的文档中,提到了其包含这样一个工具。Link:https://pve.proxmox.com/pve-docs/pve-admin-guide.html#sysboot
3.12.2. Synchronizing the content of the ESP with proxmox-boot-tool
proxmox-boot-tool is a utility used to keep the contents of the EFI System Partitions properly configured and synchronized. It copies certain kernel versions to all ESPs and configures the respective bootloader to boot from the vfat formatted ESPs. In the context of ZFS as root filesystem this means that you can use all optional features on your root pool instead of the subset which is also present in the ZFS implementation in grub or having to create a separate small boot-pool [6].
In setups with redundancy all disks are partitioned with an ESP, by the installer. This ensures the system boots even if the first boot device fails or if the BIOS can only boot from a particular disk.
The ESPs are not kept mounted during regular operation. This helps to prevent filesystem corruption to the vfat formatted ESPs in case of a system crash, and removes the need to manually adapt /etc/fstab in case the primary boot device fails.
简而言之,该工具可以将某一分区制作为额外的可以引导PVE的分区并记录,以后若引导有任何更改,也能很方便地使用其进行同步。
使用方法方面,PVE的官方文档已经足够详细,这里不再赘述。经过实测,这一工具确实能够解决如上所述问题,属于是最完美的解决。