I am trying to set up a new server and figured it was a good excuse to learn declarative drive partitioning with disko
when I install I get this error at the end
Loading nix database
installing the boot loader…
setting up /etc…
Not checking switch inhibitors (action = boot)
updating GRUB 2 menu…
installing the GRUB 2 boot loader on /dev/sdh…
Installing for i386-pc platform.
Installation finished.
No error reported.
installing the GRUB 2 boot loader on /dev/sda…Installing for i386-pc platform.
/nix/store/y3samy417i3j233p258flhyfwhjvxznd-grub-2.12/sbin/grub-install: error: cannot copy /nix/store/y3samy417i3j233p258flhyfwhjvxznd-grub-2.12/share/locale/de@hebrew/LC_MESSAGES/grub.mo’ to /boot/grub/locale/de@hebrew.mo’: No space left on device
./nix/store/h9hpszayic4fbcwdax2j1g0cnfhjknhx-install-grub.pl: installation of GRUB on /dev/sda failed: No such file or directory
Failed to install bootloader
disko-install failed
rmdir: failed to remove ‘/mnt/disko-install-root’: Directory not empty
wich to me makes no sense because at no point do I ever ask grub to install on /dev/sda in fact this drive is part of a zfs pool
I tried to figure this out but I’m not seeing any reason it’d be touching anything other than /dev/sdh. But I’m not too familiar with disko.
Sidenote: Why configure both boot.loader.grub.efiSupport = true; and set boot.loader.grub.devices to something other than [ "nodev" ];? Seems easier to just do the EFI thing and not deal with BIOS boot at all.
Sidenote sidenote: And if you’re just doing EFI I would strongly recommend against grub. It’s pretty badly maintained and it’s definitely the buggiest boot loader nixos offers. systemd-boot is a lot better.
the device im trying to install on doesnt suport efi thats what I found online to make nixos work on legacy bios (yes it is very old its an HP proliant G6 from 2010)
While not setting the boot device to "nodev", which would be the only correct value for EFI boot.
Please revise your configuration and adjust it to your actual hardware capabilities. If your system can not do EFI, don’t configure EFI stuff, that’d be the first step.
Once you fixed that, and your issue from OP remains, we can continue debugging.
I set up grub in MBR compatibility mode wich is what the 1M EF02 partition called boot does
this follows the hybrid example from the disko github as well as this article and answers from this thread the EFI stuff is expected to enable the install to still boot in EFI mode if I put the hard drive in another machine
I will get back to you on wether the unexpected behavior still happens with the boot device set to “nodev”
Non-EFI systems basically don’t know about the partition table at all, so you’re free to use whatever you want, so long as you can still put a boot loader in the boot sector, which is exactly what boot.loader.grub.device = "/dev/foo"; does. From there, it’s grub that needs to be able to understand your partition table, and of course grub does know how to handle GPT.
To add to the above, though, in gpt, the gpt partition table takes up the space grub would normally occupy after the mbr but before the first partitioned block. So you need to allocate a tiny partition for it to use instead. There’s a gpt partition type specifically for signalling this use, and grub-install will use it if it exists during a non-efi install.
Leave the ESP alone for now. Don’t bother installing grub on it. If you want to convert to EFI later you can change the settings and install it then.
Change the mount point of the ESP to /boot/efi. This will mean grub’s menus and the kernels and initrds will be on your main root partition, and thus won’t run into space limits. Grub can just grab them from your nix store directly.
If you want to convert to EFI later, you can just set up the installAsRemoveable-type setup, and run a nixos-rebuild --install-bootloader to get it to put the single file on the ESP that it needs to, and keep using it the same way otherwise.
It might be possible to induce nixos to install both the EFI and the non-EFI versions simultaneous ly, but I don’t know of a way to do it.
setting my esp to mount at /boot/efi does get rid of the space issues but my bootloader still tries to install on /dev/sda (my data1 drive if I set /dev/sdc to be data1 it tries to install to it instead) wich makes absolutely no sense to me
installing the boot loader...
setting up /etc...
Not checking switch inhibitors (action = boot)
updating GRUB 2 menu...
installing the GRUB 2 boot loader on /dev/sdh...
Installing for i386-pc platform.
Installation finished. No error reported.
installing the GRUB 2 boot loader on /dev/sda...
Installing for i386-pc platform.
/nix/store/y3samy417i3j233p258flhyfwhjvxznd-grub-2.12/sbin/grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
/nix/store/y3samy417i3j233p258flhyfwhjvxznd-grub-2.12/sbin/grub-install: error: embedding is not possible, but this is required for cross-disk install.
/nix/store/h9hpszayic4fbcwdax2j1g0cnfhjknhx-install-grub.pl: installation of GRUB on /dev/sda failed: No such file or directory
Failed to install bootloader
disko-install failed
rmdir: failed to remove '/mnt/disko-install-root': Directory not empty
I really dont understand how or why it thinks this drive should have a bootloader on it when it doesnt have anything telling it to put anything there except a ZFS pool
I also tried starting it even though it fails to install it kind of does boot it gets past grub into systemd and even chroots successfully but it crashes to emergency mode and fails to open the emergency mode terminal