grub-install: 错误: 不会继续使用阻止列表

xpt*_*xpt 5 partitioning boot grub2

跟进Install Grub2 to PBR,并根据@mook765 打开一个新问题以提供指向 boot-info-summary 的链接:

http://paste.ubuntu.com/p/SnT6Tcdmqk/

问题又来了:

% grub-install /dev/sdc5
Installing for i386-pc platform.
grub-install: warning: File system `ext2' doesn't support embedding.
grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
grub-install: error: will not proceed with blocklists
Run Code Online (Sandbox Code Playgroud)

即,grub-install拒绝继续处理阻止列表,说“文件系统‘ext2’不支持嵌入”。但是,我的不是ext2文件系统而是ext4,它不需要 fsck:

$ mount | grep /dev/sdc5
/dev/sdc5 on /mnt/osp type ext4 (rw,noatime,nodiratime,data=ordered)

% umount /dev/sdc5
umount: /dev/sdc5: not mounted.

% fsck.ext4 /dev/sdc5
e2fsck 1.44.1 (24-Mar-2018)
osp: clean, 115049/513072 files, 897251/2048287 blocks
Run Code Online (Sandbox Code Playgroud)

为方便起见,这里是 boot-info-summary 中的相关部分:

sdc5: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  Grub2 (v1.99-2.00)
    Boot sector info:  Grub2 (v1.99-2.00) is installed in the boot sector of 
                       sdc5 and looks at sector 34172346 of the same hard 
                       drive for core.img, but core.img can not be found at 
                       this location.
    Operating System:  Ubuntu 18.04.2 LTS
    Boot files:        /boot/grub/grub.cfg /etc/fstab 
                       /boot/extlinux/extlinux.conf 
                       /boot/grub/i386-pc/core.img
Run Code Online (Sandbox Code Playgroud)

修正:

好吧,让我解释一下我的配置。

  • 我不用lilo来引导我的系统。我放入lilombr的唯一原因是,它的优点是能够直接从扩展分区启动,而不是仅从主分区启动。
  • 是的,我有 4 个 MBR,即 4 个 HD,但所有 HD 的设置都相同——它将从活动分区启动,*fdisk -l输出中显示为“ ” ,这要归功于 mbr 中的 lilo。事实上,任何正常的 MBR 都可以,因为我所有的活动分区都是主分区,而不是扩展分区。但我只是保持我的选择。
  • 任何 HD 的活动分区由extlinux. 从那里我从它的启动菜单链式加载我想启动的任何东西。
  • 普通的 Linux 分区也由 引导extlinux,但不知何故我无法/dev/sdc5由 引导extlinux,所以我切换到grub2,并且它之前一直可以正常引导。
  • 当我尝试使 USB 分区可引导时,问题就开始了,我上一个问题中的“将 grub2 作为引导加载程序从分区 B 中的操作系统安装到分区 A 上的操作系统”
  • 现在分区 B 和分区 A 都不再可引导了。
  • 为了全面公开,分区 B 和分区 A 都是从我精心安装和修剪的 LUbuntu 系统中恢复的。这个“恢复”是我无法通过 启动它的主要原因extlinux,我怀疑,但无法证明。
  • Legacy grub 是一个陈旧的分区/操作系统,我已经很多年,甚至 10 多年没有接触过,但是,
  • grub4dos 是我在 U 盘上新设置的那个。它是可启动的,它允许我使用我很理解的简单语法将启动链接到我想要的任何东西。即,它与我当前的系统启动方式无关,因为我可以随时将其分离。

小智 9

我尝试在使用映像文件作为硬盘驱动器的 Virtualbox VM 中安装 Grub2 时遇到此错误。解决方案是在 grub-install 中使用 --force 选项。尽管 grub 抱怨使用阻止列表,但虚拟机现在启动正常。

sudo grub-install /dev/sda --force
sudo update-grub
Run Code Online (Sandbox Code Playgroud)