[Nix-dev] Grub2 install error on latest unstable channel

Bjørn Forsman bjorn.forsman at gmail.com
Sun Sep 28 13:44:42 CEST 2014


Hi,

After some online searching I found the cause to this:

$ sudo nixos-rebuild switch -I nixpkgs=.
[...]
installing the GRUB 2 boot loader on /dev/disk/by-label/240gb...
Installing for i386-pc platform.
/nix/store/3aj2bp2d9vxy2hrmh9q69n5ydxh9gzd3-grub-2.02-git-1de3a4/sbin/grub-install:
warning: File system `ext2' doesn't support embedding.
/nix/store/3aj2bp2d9vxy2hrmh9q69n5ydxh9gzd3-grub-2.02-git-1de3a4/sbin/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..
/nix/store/3aj2bp2d9vxy2hrmh9q69n5ydxh9gzd3-grub-2.02-git-1de3a4/sbin/grub-install:
error: will not proceed with blocklists.
/nix/store/w7rgpbyqfcz0xfjhmcn05sp6zig8gx8w-install-grub.pl:
installation of GRUB on /dev/disk/by-label/240gb failed

For the last 1-2 years I've had boot.loader.grub.device =
"/dev/disk/by-label/240gb" in my configuration.nix. But that path
points to the first _parition_ of my disk (not the disk itself):

$ readlink -f /dev/disk/by-label/240gb
/dev/sdb1

I guess the grub we used to have managed to install to the MBR even
though I gave it the first partition. But now it doesn't.

Possible solutions:

1) Specify /dev/sdb instead of /disk/by-label/* in configuration.nix.
Downside: /dev/sdb isn't a stable name.

2) Specify /disk/by-id/*. This namespace has both partitions and raw
disk nodes, unliike the "by-label" namespace. Downside: ugly names
like "ata-KINGSTON_SH103S3120G_50026B722600AA5F".

3) Tweak install-grub.pl to change partition device nodes into disk
nodes (/dev/sdb1 => /dev/sdb) before calling grub-install. Downside:
none? (I don't know). Upside: can continue to use stable and human
friendly disk name.

Thoughts?

Best regards,
Bjørn Forsman


More information about the nix-dev mailing list