如何使用 btrfs 上的当前引导将 /boot 移动到 UEFI 系统上的单独分区?

Pil*_*ot6 6 boot btrfs uefi boot-partition

/boot在带有 btrfs 分区(subvol=@)的 UEFI 系统上安装了 Ubuntu 18.04 。

由于 Ubuntu 最近的变化,我总是得到 grub 超时 30 秒。如果/boot在 btrfs 分区上,这是设计使然。

部分 /grub.cfg

function recordfail {
  set recordfail=1
  # GRUB lacks write support for btrfs, so recordfail support is disabled.
}
...
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
Run Code Online (Sandbox Code Playgroud)

我认为如果我创建一个单独的 ext2/boot分区,问题将得到解决。

问题是如果上述假设是正确的,我如何boot从 btrfs subvol移动到 ext2 分区?

Pil*_*ot6 4

我设法使用 LiveUSB 的引导修复来完成此操作。

在开始之前,我建议创建@子卷的快照,以防出现问题。

  1. 缩小/分区以留下 1-2 GB 可用空间gparted

  2. 创建ext2分区。

  3. 将分区挂载//mnt

  4. 将新ext2分区挂载到/media

  5. 跑步cp -a /mnt/@/boot/* /media

  6. 编辑/mnt/@/etc/fstab并将新ext2分区的安装添加到/boot.

  7. 删除旧/引导sudo rm -r /mnt/@/boot

  8. 跑步sudo umount /mnt && sudo umount /media

  9. 运行boot-repair并进行默认检查。

一切都应该可以工作,并且 grub 超时现在可以了。