disko icon indicating copy to clipboard operation
disko copied to clipboard

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

Open ghostbuster91 opened this issue 1 year ago • 2 comments

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.

ghostbuster91 avatar Aug 18 '24 00:08 ghostbuster91

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?

iFreilicht avatar Aug 22 '24 15:08 iFreilicht

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

ghostbuster91 avatar Aug 22 '24 19:08 ghostbuster91