[Nix-dev] Re: Grub 2 problems

Ludovic Courtès ludo at gnu.org
Sun Nov 1 15:38:35 CET 2009


Hi Eelco,

Eelco Dolstra <e.dolstra at tudelft.nl>
writes:

> I tried Grub 2 on my home machine, but I ran into some problems:

Thanks for trying out!  ;-)

> - The extra Grub entry for my Windows partition is gone.  (It's still in
> /boot/grub/menu.lst, but it doesn't appear.)

‘menu.lst’ is no longer used; ‘grub.cfg’ is used instead.

Can you make sure your ‘extraEntries’ snippet appears in
/boot/grub/grub.cfg?

Obviously it has to be rewritten in GRUB 2 syntax anyway.

> - The NixOS entries all failed with the error "You need to load the kernel
> first."  This is probably caused by boot.loader.grub.bootDevice.  I was able to
> manually boot into NixOS by editing an entry, removing the "(hd0,0)" device
> names in the "linux" and "initrd" lines.

It might that ‘bootDevice’ is no longer needed because GRUB 2
automatically finds /boot.  However, http://grub.enbug.org/Manual does
mention “linux (hd0,2)/boot/vmlinuz-<alternate_version> root=/dev/sda2”
as a valid syntax.

> - fbcondecor no longer works, the NixOS console stays in text mode.  IIRC Grub
> is supposed to parse the "vga=" kernel command line argument, but maybe it
> doesn't do this anymore.

It works for me(TM).  Does GRUB itself enter graphics mode, with the
background image and all?  Normally it tries to enter graphics mode at
run-time, but happily keeps going if that fails:

--8<---------------cut here---------------start------------->8---
if loadfont /nix/store/zg45ky8c4zylis099j5bvmnpywmfsgg4-grub-1.97/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  insmod gfxterm
  insmod vbe
  terminal_output gfxterm
fi
--8<---------------cut here---------------end--------------->8---

(ISTR that before I had GRUB’s graphics mode working, it would remain in
text mode and the booted Linux would also remain in text more
afterward.)

> My Grub configuration:
>
>   boot = {
>     loader.grub.version = 2;
>     loader.grub.device = "/dev/sda";
>     loader.grub.bootDevice = "(hd0,0)";
>     loader.grub.copyKernels = true; # separate /boot
>     loader.grub.extraEntries =
>       ''
>         title Windows
>           chainloader (hd0,3)+1
>       '';
>   };

Mine is as simple as this:

--8<---------------cut here---------------start------------->8---
    loader.grub = {
      device = "/dev/sda";
      version = 2;
    };
--8<---------------cut here---------------end--------------->8---

No wonder yours is more likely to reveal issues.  ;-)

Thanks,
Ludo’.




More information about the nix-dev mailing list