Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hetzner: installing grub fails if /dev/sda isn't used #12

Open
nh2 opened this issue May 7, 2018 · 3 comments
Open

hetzner: installing grub fails if /dev/sda isn't used #12

nh2 opened this issue May 7, 2018 · 3 comments

Comments

@nh2
Copy link
Contributor

nh2 commented May 7, 2018

With nixops 1.5.2 I tried this:

    deployment.hetzner.partitions = ''
      clearpart --all --initlabel --drives=sda,sdb,sdc,sdd

      part raid.1 --grow --ondisk=sdc
      part raid.2 --grow --ondisk=sdd

      raid / --level=1 --device=md0 --fstype=ext4 --label=root raid.1 raid.2
    '';

doing nothing with device sda, and got:

machine1> installing the GRUB 2 boot loader on /dev/sda...
machine1> Installing for i386-pc platform.
machine1> /nix/store/67nrc9srnpab6x3zrlprqi4al74pkb0k-grub-2.02/sbin/grub-install: error: unable to identify a filesystem in hostdisk//dev/sda; safety check can't be performed.
machine1> /nix/store/yvg8cplwgj0z8j2x4fdix4bjwgcmwi8h-install-grub.pl: installation of GRUB on /dev/sda failed

CC @aszlig

@nh2
Copy link
Contributor Author

nh2 commented May 7, 2018

I think the issue is that nixpart always includes all disks in boot.loader.grub.devices, no matter if they are used or not:

root@rescue ~ # cat kickstart 
clearpart --all --initlabel --drives=sdc,sdd

part raid.1 --grow --ondisk=sdc
part raid.2 --grow --ondisk=sdd

raid / --level=1 --device=md0 --fstype=ext4 --label=root raid.1 raid.2

root@rescue ~ # nixpart -p - < kickstart 
{
  swapDevices = [
  ];
  boot.loader.grub.devices = [
    "/dev/sda"
    "/dev/sdb"
    "/dev/sdc"
    "/dev/sdd"
  ];
  fileSystems = {
    "/" = {
      fsType = "ext4";
      label = "root";
    };
  };
}

@aszlig
Copy link
Member

aszlig commented May 7, 2018

@nh2: This is probably due to https://github.com/NixOS/nixpart/blob/v0.4.1/nixpart#L59, so it needs to check whether it's actually a device that is going to be partitioned.

@aszlig
Copy link
Member

aszlig commented May 15, 2018

@nh2: Can you dump what the repr of device.format is when you have this setup?

@grahamc grahamc transferred this issue from NixOS/nixops Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants