I noticed that if I run nixos-rebuild switch
a few times without rebooting, switches become slower and slower. While investigating something else I noticed that I have quite a few duplicate lines in my mount
output (and mount
takes a while to run as well)
❯ time mount | rg /boot | wc -l
32769
mount 0.05s user 5.11s system 99% cpu 5.161 total
rg /boot 0.00s user 0.01s system 0% cpu 5.161 total
wc -l 0.00s user 0.00s system 0% cpu 5.161 total
I started paying attention to the output ofnixos-rebuild switch
and I noticed this
updating GRUB 2 menu...
mount: /boot/efis/nvme-WDC_WDS100T2B0C-00PXH0_21111Y801086-part1: /dev/nvme0n1p1 already mounted on /boot/efis/nvme-WDC_WDS100T2B0C-00PXH0_21111Y801086-part1.
dmesg(1) may have more information after failed mount system call.
And this seems to be the relevant message in my dmesg
output
[123887.715384] systemd-gpt-auto-generator[951618]: EFI loader partition unknown, exiting.
[123887.715389] systemd-gpt-auto-generator[951618]: (The boot loader did not set EFI variable LoaderDevicePartUUID.)
I googled around but I’m not quite sure what it is that I should do. I think I should set that EFI variable but I’m at a loss at how to do that. I looked at the manual for efivar
and there’s a flag to provide a name, but the name should be of “in the form 8be4df61-93ca-11d2-aa0d-00e098032b8c-Boot0000” and I’m not sure how to come up with the right name myself.
fwiw, here’s my current configuration GitHub - alejandro-angulo/dotfiles at 00762bbc4ed870dd32303bf749f3f565d507b907 (this is not necessarily the commit that introduced that mount warning in my switch output – not sure when that started).
And here are the two duplicate lines I noticed in mount’s output
/dev/nvme0n1p1 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/nvme0n1p1 on /boot/efis/nvme-WDC_WDS100T2B0C-00PXH0_21111Y801086-part1 type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
(I guess remount-ro
explains the duplicate mounts)
EDIT: Oh I forgot to mention, the relevant files in my config should be in the systems/x86_64-linux/gospel
directory: https://github.com/alejandro-angulo/dotfiles/tree/00762bbc4ed870dd32303bf749f3f565d507b907/systems/x86_64-linux/gospel