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

systemd-gpt-auto-generator fails when switching configurations #35681

Open
arximboldi opened this issue Feb 26, 2018 · 6 comments
Open

systemd-gpt-auto-generator fails when switching configurations #35681

arximboldi opened this issue Feb 26, 2018 · 6 comments

Comments

@arximboldi
Copy link
Contributor

arximboldi commented Feb 26, 2018

Issue description

I have a system with UEFI boot that, when changing the NixOs configuration with nixos-rebuild switch prints the following error:

systemd-gpt-auto-generator[1765]: Failed to dissect: Input/output error

After that the new configuration is effective, but after reboot, the system boots to the old configuration. There is no way to boot directly into the new configuration, because the switch failed to upgrade the boot partition.

Steps to reproduce

  1. Create a NixOS installation using UEFI:
boot.loader.systemd-boot.enable = true;
  1. Boot into the installation
  2. Change the configuration.nix
  3. Run nix-rebuild switch. At some point towards the end, we can see the error in the terminal: systemd-gpt-auto-generator[1765]: Failed to dissect: Input/output error.
  4. Reboot: the old configuration is effective again.

Possible solutions

The problem has been acknowledged and fixed upstream in systemd systemd/systemd#5806
A fix exists in systemd version 237.

Severity

The problem makes NixOs unusable on affected systems (in my case, an Intel Compute Card). I have tried using GRUB instead without success, since this is a UEFI-only machine. Grub in Efi mode did not work either.

I am a bit desperate, I love NixOs and want to use it here 😢

@arximboldi
Copy link
Contributor Author

I just tried a fresh installation of nixos-unstable, which includes the systemd 237, and the problem persists. :(

@arximboldi arximboldi reopened this Feb 27, 2018
@arximboldi arximboldi changed the title systemd-gpt-auto-generator fails when switching configurations (needs systemd upgrade) systemd-gpt-auto-generator fails when switching configurations Feb 27, 2018
@mfiano
Copy link

mfiano commented Mar 3, 2018

I also experience this. As such I cannot update the initrd and have to manually mount my root partition in a rescue shell via a kernel parameter.

@arximboldi
Copy link
Contributor Author

@mfiano someone just mentioned this workaround in the related systemd bug: systemd/systemd#5806 (comment)

@mfiano
Copy link

mfiano commented Mar 4, 2018

@arximboldi That someone he was referring to was me :) To get rid of the error on the terminal when doing a switch, you can set the boot parameter systemd.gpt_auto=0 as well

@stale
Copy link

stale bot commented Jun 5, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 5, 2020
@raindev
Copy link
Contributor

raindev commented Oct 22, 2022

This still happens to me on a Raspberry Pi 4 ZFS root install with systemd 250. I'm not sure if this is a problem of NixOS really. Maybe the sensible thing would be to disable systemd-gpt-auto-generator by default. NixOS generates mount points explicitly itself, I don't think the systemd generator is useful in the general case.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 22, 2022
otavio added a commit to otavio/nix-config that referenced this issue May 15, 2023
Fixes:

,----[ dmesg error ]
| [91755.057901] systemd-gpt-auto-generator[13167]: (The boot loader did
|     not set EFI variable LoaderDevicePartUUID.)
`----

Refs: NixOS/nixpkgs#35681
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants