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

disk/by-partlabel does not contain entries created with size 100% #736

Open
ghostbuster91 opened this issue Aug 18, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@ghostbuster91
Copy link

ghostbuster91 commented Aug 18, 2024

Note: this has only be tested on oracle VM

Following configuration:

disk = {
      sda = {
        type = "disk";
        device = builtins.elemAt disks 0;
        content = {
          type = "gpt";
          partitions = {
            boot = {
              size = "1M";
              type = "EF02";
              priority = 1;
            };
            root = {
              size = "100%";
              content = {
                type = "btrfs";
                extraArgs = [
                  "-f"
                  "-L NixOS" # Filesystem label
                ];
                subvolumes =
                  let
                    commonOptions = [
                      "compress=zstd"
                      "noatime"
                      "nodiscard" # Prefer periodic TRIM
                    ];
                  in
                  {
                    # Root subvolume
                    "/@" = {
                      mountpoint = "/";
                      mountOptions = commonOptions;
                    };

                    # Persistent data
                    "/@persist" = {
                      mountpoint = "/persist";
                      mountOptions = commonOptions ++ [
                        "nodev"
                        "nosuid"
                        "noexec"
                      ];
                    };
                  };
              };
              priority = 3;
            };
          };
        };
      };
    };

fails when trying to lookup /dev/disk/by-partlabel/disk-sda-root
no amount of calling:

  • partprobe /dev/sda
  • partx -u /dev/sda
  • udevadm trigger

is able to fix it. The first partition disk-sda-boot appears there normally.

After changing size from 100% to some concrete value like 140G everything works fine.

@iFreilicht
Copy link
Contributor

I cannot reproduce this. My config contains a total of seven partitions, five of which are created with size = "100%";, and they all show up:

ls -1 /dev/disk/by-partlabel
disk-boot-drive-boot
disk-boot-drive-nixos
disk-nix-store-nix-store
disk-nix-store-swap
disk-scratch-drive-scratch
disk-tank-1-tank-1
disk-tank-2-tank-2

Maybe this is specific to btrfs?

@ghostbuster91
Copy link
Author

Can be, I haven't seen it with other filesystems. I will try my zfs config with size = 100% and report the results

@iFreilicht iFreilicht added the bug Something isn't working label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants