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

Not a Btrfs subvolume. It's a Bind Mount. nixos-generate-config.pl gets it wrong. #372559

Open
Sepero opened this issue Jan 10, 2025 · 3 comments
Labels
0.kind: bug Something is broken

Comments

@Sepero
Copy link

Sepero commented Jan 10, 2025

Describe the bug

On a Btrfs filesystem, the perl code below does not understand the difference between a mounted subvolume, and a regular directory that has been bind mounted.

die "Failed to retrieve subvolume info for $mountPoint\n";

Steps To Reproduce

Having a bind mounted /nix or /boot directory causes rebuild to fail.

Expected behavior

Recognize that directory is bind mounted, and not a subvolume.

Related

Possibly related bugs. #53177 #341481

Notify maintainers

@bjornfor @anthonyroussel @Atemu @Mic92 @lheckemann @roberth @mberndt123 @ajs124 @name-snrl @lukegb @RaitoBezarius @SuperSandro2000 @Luflosi @catap @Ma27 @Artturin @worldofpeace @edolstra @prusnak

@Sepero Sepero added the 0.kind: bug Something is broken label Jan 10, 2025
@bjornfor
Copy link
Contributor

Having a bind mounted /nix or /boot directory causes rebuild to fail.

Do you manually bind mount /nix or /boot in the installer? If so, why?

(When I started using NixOS there was this idea that nixos-generate-config should/could be re-run to update after hardware changes, but IME that never worked; it generated fileSystems config that I didn't want in hardware-configuration.nix. So I never run it outside of the installer environment. And in the installer environment the mounts are much simpler / well known.)

@ElvishJerricco
Copy link
Contributor

Do you manually bind mount /nix or /boot in the installer? If so, why?

The main issue here isn't so much to do with the specific mounts, but rather that any bind mount you'd like to configure cannot come from a btrfs source, or else nixos-generate-config is going to get something wrong. It'll either yell that it isn't a (sub)volume, or it'll create a bad bind mount if it's actually incidentally a bind mount.

TL;DR: We're not really handling bind mounts right here at all.

@Sepero
Copy link
Author

Sepero commented Jan 11, 2025

The script nixos-generate-config.pl does not appear to intelligently acknowledge the existence of bind mounted directories on Btrfs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

3 participants