[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to resume GRUB2 upgrade apparently blocked by /boot filesystem t
From: |
Jordan Uggla |
Subject: |
Re: how to resume GRUB2 upgrade apparently blocked by /boot filesystem type=ext2? |
Date: |
Thu, 4 Feb 2016 19:22:43 -0800 |
On Thu, Feb 4, 2016 at 1:28 PM, Tom Roche <address@hidden> wrote:
>
> [footnotes follow .sig]
>
> summary: a recent package update/upgrade on a Debian box installed
> kernel-related packages (including GRUB packages), then failed to install
> GRUB. How to recover?
>
> details:
>
> As detailed here[1], I have an otherwise-up-to-date Debian box on which I
> unwisely put filesystem type=ext2 on the `/boot` partition:
>
> $ mount | grep -e '^/dev/'
> /dev/sda3 on /boot type ext2 ...
> ...
>
> That appears to block upgrade of GRUB2: when I recently ran `sudo apt-get
> dist-upgrade`, it successfully installed several kernel-related packages, but
> then
>
> Setting up grub-common (2.02~beta2-22+deb8u1) ...
> Setting up grub2-common (2.02~beta2-22+deb8u1) ...
> Setting up grub-pc-bin (2.02~beta2-22+deb8u1) ...
> Setting up grub-pc (2.02~beta2-22+deb8u1) ...
> Installing for i386-pc platform.
> Installation finished. No error reported.
Note here that grub-install has run correctly once, presumably because
"sudo grub-install /dev/sda" was run, which is correct. Grub's boot
sector should always be installed to the MBR (device /dev/sda) not to
any partition (like /dev/sda3). Because it has run successfully once,
you probably will have no problem booting again, but "sudo
grub-mkconfig -o /boot/grub/grub.cfg" (which on Debian can also be run
as simply "sudo update-grub") will need to be run again to actually
have your new kernel show up at boot.
> 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..
Here grub-install is being run a second time and is failing, probably
because "sudo grub-install /dev/sda3" was invoked. This is incorrect,
as it is trying to install grub's boot sector to a partition. To
prevent this error from appearing again, you should simply remove
"/dev/sda3" from the list of install devices for the grub-pc package,
which I will explain in more detail below.
>
> At about this point, my console went to character-mode-graphics to present a
> dialog with title=`Configuring grub-pc` and body telling me that `GRUB failed
> to install`:
>
> Do you want to continue anyway? If you do, your computer may not start up
> properly.
> Writing GRUB to boot device failed - continue?
>
> I hit button=No. At this point, I have 3 questions based on 2 assumptions.
> The assumptions are
I don't actually no what answering "no" to this does, but it may have
prevented grub-mkconfig from being run.
>
> 1. I won't be able to boot my new kernel until I enable whatever does the
> post-package-install actions to complete successfully (and not put up another
> `Configuring grub-pc` dialog).
Probably true, again as grub-mkconfig may not have been run.
> 2. As part of that enablement, I should first update my {`/dev/sda3`,
> `/boot`} from filesystem type=ext2 to something else.
Definitely not.
There is no filesystem for which it really makes sense to install
grub's boot sector to a partition, and with ext3 and ext4 you will get
an identical error. With btrfs you wouldn't get this error messages,
as btrfs allows for a reliable embedding area, but your BIOS will
still load the code in your MBR, so that's where grub's boot sector
should be installed.
What you should do is run "sudo dpkg-reconfigure grub-pc
--frontend=text" (I use --frontend=text here because I find it less
confusing that the curses interface) and when prompted for install
devices choose only "/dev/sda" and do *not* include /dev/sda3 in the
list of install devices. This should remove this error message (and
prevent it from happening on future upgrades), as well as completing
the configuration of grub-pc (so grub-mkconfig will be run and your
new kernel will be in the newly generated grub.cfg).
--
Jordan Uggla (Jordan_U on irc.freenode.net)