51

I'm reading myself for the release of Jessie on Debian, so I'm extra cautious (should be said paranoid) about any message that can cause problems, namely warnings. My system is a desktop with Debian testing/unstable installed, on ext4 partitions for both /boot and /, yet I'm seeing this message while upgrading the grub-pc package in Debian:

Installing for i386-pc platform.
Installation finished. No error reported.
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..
Installation finished. No error reported.
Generating grub configuration file ...

Why is grub saying that my system is embedded? What is the cause of this? I tried to check the grub-install binary, but I couldn't make sense of it.

Braiam
  • 35,991
  • 2
    This is nor about your system being embedded. embed is a Grub command: "Embed the Stage 1.5 STAGE1_5 in the sectors after the MBR if [...]". I don't understand what is supposed to be the problem with ext2, though. – Hauke Laging Dec 14 '14 at 18:29
  • 3
    Apparently grub calls ext3 and ext4; ext2, so the warning is fine, see here. It seems the embedding vs blocklists warning is about where grub is being installed, MBR vs partition boot sector. – Mehmet Dec 14 '14 at 23:50

3 Answers3

126

Most people coming to this from a search engine are probably wondering, "why do I get this error?":

warning: File system `ext2' doesn't support embedding. 
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.. 
error: will not proceed with blocklists.

Because you did, e.g.:

grub-install /dev/sda1

instead of

grub-install /dev/sda

I.e. tried to install to a partition instead of the MBR.

Nathan Kidd
  • 1,597
  • 1
    I know I reinstalled grub, and I did it with grub-install /dev/sda. I still got the warning. – Johan Herstad Nov 30 '18 at 09:19
  • You got a warning, and it continued? Or an error? This is primarily about overcoming that error. – Nathan Kidd Nov 30 '18 at 15:16
  • I ran apt dist-upgrade on Debian, and it idiotically asked me to reselect where GRUB should go (as if I know!). I indeed selected /dev/sda1 (my /boot partition). Now it doesn't boot. If I boot a live distro and run grub-install, it gives that embedding complaint and refuses to proceed. Repairable? – Boann Feb 18 '19 at 05:36
  • @Boann, I happened to work with a similar problem here https://askubuntu.com/a/531051/149881 Maybe it will help you. – Nathan Kidd Feb 19 '19 at 17:50
  • 3
    dammit, you deserve all the beers. – Steve Jan 23 '20 at 19:48
  • I had this error for two days. Thanks for the solution. – plr May 10 '20 at 20:40
  • 1
    This error can also happen from trying to install GRUB to a disk that has no partitions. – Ben Mordecai May 12 '22 at 12:04
34

You are getting the warning because you are installing grub to a partition instead of the MBR. This means grub can not be embedded in the unused space between the MBR and the first partition. Instead it has to have the list of blocks that /boot/grub/core.img resides in placed into the MBR. This setup is subject to being broken by things like defrag and so is not recommended, hence the warning. Since it is only a warning, you can ignore it.

psusi
  • 17,303
5

I quote from Grub2's info pages:

MBR
====

The partition table format traditionally used on PC BIOS platforms is
called the Master Boot Record (MBR) format; this is the format that
allows up to four primary partitions and additional logical partitions.
With this partition table format, there are two ways to install GRUB:
it can be embedded in the area between the MBR and the first partition
(called by various names, such as the "boot track", "MBR gap", or
"embedding area", and which is usually at least 31 KiB), or the core
image can be installed in a file system and a list of the blocks that
make it up can be stored in the first sector of that partition.

Each of these has different problems. There is no way to reserve
space in the embedding area with complete safety, and some proprietary
software is known to use it to make it difficult for users to work
around licensing restrictions; and systems are sometimes partitioned
without leaving enough space before the first partition. On the other
hand, installing to a filesystem means that GRUB is vulnerable to its
blocks being moved around by filesystem features such as tail packing,
or even by aggressive fsck implementations, so this approach is quite
fragile; and this approach can only be used if the `/boot' filesystem
is on the same disk that the BIOS boots from, so that GRUB does not
have to rely on guessing BIOS drive numbers.

The GRUB development team generally recommends embedding GRUB before
the first partition, unless you have special requirements. You must
ensure that the first partition starts at least 31 KiB (63 sectors)
from the start of the disk; on modern disks, it is often a performance
advantage to align partitions on larger boundaries anyway, so the first
partition might start 1 MiB from the start of the disk.

That means to me that ext2 is not related to embedding in any way because it's either embedding or a filesystem involved.

The question arises what you have done to produce this error message (or rather: warning). I assume this can happen if Grub2 is told to install itself into a partition instead of onto the drive itself (MBR or extended partition).

Hauke Laging
  • 90,279
  • I didn't mention that my preoccupation is about the ext2 thing, I know GRUB gives crap about ext2/3/4. My interest is: 1) why the warning appears and 2) should I worry – Braiam Dec 15 '14 at 00:13