!oNSIfazDqEcwhcOjSL:matrix.org

disko

349 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko87 Servers

Load older messages


SenderMessageTime
2 Nov 2025
@cf11:0x2c.orgchaoflow joined the room.19:06:04
3 Nov 2025
@lillecarl:matrix.orglillecarlhttps://github.com/nix-community/disko/blob/master/example/btrfs-subvolumes.nix Doesn't this conflict with https://btrfs.readthedocs.io/en/latest/ch-mount-options.html "Most mount options apply to the whole filesystem and only options in the first mounted subvolume will take effect. This is due to lack of implementation and may change in the future. This means that (for example) you can’t set per-subvolume nodatacow, nodatasum, or compress using mount options. This should eventually be fixed, but it has proved to be difficult to implement correctly within the Linux VFS framework." quite a bit? Which is the first mounted volume for example?22:00:37
@lillecarl:matrix.orglillecarl* https://github.com/nix-community/disko/blob/master/example/btrfs-subvolumes.nix Doesn't this conflict with https://btrfs.readthedocs.io/en/latest/ch-mount-options.html "Most mount options apply to the whole filesystem and only options in the first mounted subvolume will take effect. This is due to lack of implementation and may change in the future. This means that (for example) you can’t set per-subvolume nodatacow, nodatasum, or compress using mount options. This should eventually be fixed, but it has proved to be difficult to implement correctly within the Linux VFS framework." quite a bit? Which is the first mounted volume for example?22:01:59
@lillecarl:matrix.orglillecarlAaaaaaa 💡 It's different when we're creating the volumes AOT with these options maybe?22:02:50
@lillecarl:matrix.orglillecarl* Aaaaaaa 💡 It's different when we're creating the volumes AOT with these options maybe? Edit: I don't think so, the example seems to be slightly invalid22:07:34
4 Nov 2025
@blimbus:matrix.orgblimbus

Hello, I use disko for all my machines running preservation with tmpfs and btrfs. I've been reoing my homelab and decided to try out bcachefs but currently my system just boots to emergency mode. As I said I'm new to bcachefs, so if I am doing anything obviously wrong that anyone can point out that would be greatly appreciated. Running the same configurations for preservation that I daily drive on my machine so I dont think its anything there. Not sure if I'm just doing subvolumes incorrectly or something like that.

{
  disko.devices = {
    disk = {
      nix = {
        type = "disk";
        device = "/dev/disk/by-id/nvme-WD_BLACK_SN770_1TB_234252800502";
        content = {
          type = "gpt";
          partitions = {
            boot = {
              size = "1G";
              type = "EF00";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
                mountOptions = ["umask=0077"];
              };
            };

            root = {
              size = "100%";
              content = {
                type = "bcachefs";
                filesystem = "root";
                label = "root";
                extraFormatArgs = ["--discard"];
              };
            };
          };
        };
      };

      # NVME raid drives
      nvme-6749 = {
        type = "disk";
        device = "/dev/disk/by-id/nvme-CT2000P310SSD8_24514CF66749";
        content = {
          type = "bcachefs";
          filesystem = "np1";
          label = "np1.6749";
          extraFormatArgs = ["--discard"];
        };
      };

      nvme-7818 = {
        type = "disk";
        device = "/dev/disk/by-id/nvme-CT2000P310SSD8_24514CF67818";
        content = {
          type = "bcachefs";
          filesystem = "np1";
          label = "np1.7818";
          extraFormatArgs = ["--discard"];
        };
      };

      nvme-7847 = {
        type = "disk";
        device = "/dev/disk/by-id/nvme-CT2000P310SSD8_24514CF67847";
        content = {
          type = "bcachefs";
          filesystem = "np1";
          label = "np1.7847";
          extraFormatArgs = ["--discard"];
        };
      };

      nvme-7917 = {
        type = "disk";
        device = "/dev/disk/by-id/nvme-CT2000P310SSD8_24514CF67917";
        content = {
          type = "bcachefs";
          filesystem = "np1";
          label = "np1.7917";
          extraFormatArgs = ["--discard"];
        };
      };

      # HDD raid drives
      hdd-3ALH = {
        type = "disk";
        device = "/dev/disk/by-id/ata-ST4000VN006-3CW104_ZW603ALH";
        content = {
          type = "bcachefs";
          filesystem = "dp1";
          label = "dp1.3ALH";
          extraFormatArgs = ["--discard"];
        };
      };

      hdd-40NG = {
        type = "disk";
        device = "/dev/disk/by-id/ata-ST4000VN006-3CW104_ZW6040NG";
        content = {
          type = "bcachefs";
          filesystem = "dp1";
          label = "dp1.40NG";
          extraFormatArgs = ["--discard"];
        };
      };
    };

    bcachefs_filesystems = {
      root = {
        type = "bcachefs_filesystem";
        extraFormatArgs = [
          "--compression zstd:1"
        ];
        subvolumes = {
          nix = {
            mountpoint = "/nix";
          };
          root = {
            mountpoint = "/nix/persist";
          };
          home = {
            mountpoint = "/nix/persist/home";
          };
        };
      };

      np1 = {
        type = "bcachefs_filesystem";
        extraFormatArgs = [
          "--compression zstd:1"
          "--erasure_code"
          "--data_replicas 1"
          "--metadata_replicas 2"
        ];
        subvolumes = {
          root = {
            mountpoint = "/nix/persist/npool";
          };
        };
      };

      dp1 = {
        type = "bcachefs_filesystem";
        extraFormatArgs = [
          "--compression zstd:10"
          "--replicas 2"
        ];
        subvolumes = {
          root = {
            mountpoint = "/nix/persist/dpool";
          };
        };
      };
    };

    nodev."/" = {
      fsType = "tmpfs";
      mountOptions = [
        "defaults"
        "size=6G"
        "mode=755"
      ];
    };
  };
}
02:20:30
@zimward:zimward.moezimward bcachefs didn't like to format my drive (its an relatively old nvme), that was about 6months ago. can you verify that the partition has been formatted? 15:54:31
@zimward:zimward.moezimward* bcachefs didn't like to format my drive (its an relatively old nvme), that was about 6months ago. can you verify that the partition/drives has been formatted?15:55:25
@zimward:zimward.moezimward* bcachefs didn't like to format my drive (its an relatively old nvme), that was about 6months ago. can you verify that the partition/drives have been formatted?15:55:33
@blimbus:matrix.orgblimbus
In reply to @zimward:zimward.moe
bcachefs didn't like to format my drive (its an relatively old nvme), that was about 6months ago. can you verify that the partition/drives have been formatted?
Yeah if I boot into the installer I can mount the drives and see files on them, bcachefs show-super or whatever the info command is also looks correct, I can post some outputs later when I am home from work but not sure how helpful they will be. I'll try to simplify my config and try again.
17:39:03
@whispers:catgirl.cloud@whispers:catgirl.cloud joined the room.20:07:56
@dawnofmidnight:catgirl.cloud@dawnofmidnight:catgirl.cloud left the room.20:08:01
6 Nov 2025
@nhnn:nhnn.devnhnn changed their profile picture.15:18:46
7 Nov 2025
@disco_stick:matrix.orgredesign your logo changed their display name from LARPing tech Simps like Hacker News users to seaweed salad.00:07:28
10 Nov 2025
@no-mood:matrix.orgno-moodOkay I'm going crazy, I just reinstalled my system with nixos-anywhere since it didn't boot anymore 18:01:38
@no-mood:matrix.orgno-moodI get: Stage 2 init script (/mnt-root/nix/store/... not found)18:02:03
@no-mood:matrix.orgno-mood

This is my config:

{ inputs, ... }:
let
  ssdDevice = "/dev/disk/by-id/nvme-SAMSUNG_MZVLB256HAHQ-000H1_S425NX2M363531";
  hddDevice = "/dev/disk/by-id/ata-ST2000DM008-2UB102_ZK20P7NY";
  wdDevice = "/dev/disk/by-id/ata-WDC_WD10EARS-00Y5B1_WD-WCAV5S128768";
in
{
  imports = [
    inputs.disko.nixosModules.disko
  ];

  boot.supportedFilesystems = [ "bcachefs" ];

  disko.devices = {
    disk = {
      # NVMe SSD - Fast tier for metadata and caching
      nvme = {
        type = "disk";
        device = ssdDevice;
        content = {
          type = "gpt";
          partitions = {
            ESP = {
              priority = 1;
              name = "ESP";
              size = "512M";
              type = "EF00";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
                mountOptions = [ "umask=0077" ];
              };
            };
            # NVMe partition for bcachefs (fast tier)
            main = {
              size = "100%";
              content = {
                type = "bcachefs";
                filesystem = "main_bcachefs";
                label = "ssd.nvme";
                extraFormatArgs = [ "--discard" ];
              };
            };
          };
        };
      };

      # HDD - Bulk storage tier
      hdd = {
        type = "disk";
        device = hddDevice;
        content = {
          type = "gpt";
          partitions = {
            # HDD partition for bcachefs (storage tier)
            main = {
              size = "100%";
              content = {
                type = "bcachefs";
                filesystem = "main_bcachefs";
                label = "hdd.storage";
              };
            };
          };
        };
      };

      # Western Digital HDD - Separate btrfs filesystem
      WD10EARS = {
        type = "disk";
        device = wdDevice;
        content = {
          type = "gpt";
          partitions = {
            main = {
              size = "100%";
              content = {
                type = "btrfs";
                extraArgs = [ "-f" ];
                subvolumes = {
                  "@" = {
                    mountpoint = "/mnt/wd10ears";
                    mountOptions = [
                      "compress=zstd"
                      "noatime"
                    ];
                  };
                };
              };
            };
          };
        };
      };
    };

    bcachefs_filesystems = {
      main_bcachefs = {
        type = "bcachefs_filesystem";
        extraFormatArgs = [
          "--compression=lz4"
          "--background_compression=zstd:6"
          # Tiering configuration
          "--background_target=hdd"
          "--foreground_target=ssd"
          "--promote_target=ssd"
          "--metadata_target=ssd"
        ];
        subvolumes = {
          # Root filesystem - equivalent to @root
          "@root" = {
            mountpoint = "/";
            mountOptions = [
              "noatime"
            ];
          };

          # Nix store - equivalent to @nix
          "@nix" = {
            mountpoint = "/nix";
            mountOptions = [
              "noatime"
            ];
          };

          # Backups directory
          "@backups" = {
            mountpoint = "/var/backups";
            mountOptions = [
              "noatime"
            ];
          };
        };
      };
    };
  };

}
18:02:47
@no-mood:matrix.orgno-moodI've discussed this in #users:nixos.org and it seems that subvolumes are created but are not used; all my files store in the root, and the subvolumes are empty18:04:14
@no-mood:matrix.orgno-mood* Okay I'm going crazy, I just reinstalled my system with nixos-anywhere (using bcachefs) since it didn't boot anymore 18:04:32
@no-mood:matrix.orgno-moodLink to that discussion: https://matrix.to/#/!6oudZq5zJjAyrxL2uY:0upti.me/$nd9QnFGo3-5Q9JB3tgef3V0_PyyaGoEqR_rdyyPITCY?via=laas.fr&via=matrix.org&via=node.marinchik.ink18:06:42
@no-mood:matrix.orgno-moodNow I just don't know how to fix, I even tried to move files from the root to the subvolumes; it still fails18:07:12
@blimbus:matrix.orgblimbusI've been having the same issue, I cant get my system to boot with root on bcachefs using disko. The filesystem exists, I can mount create and view files but the system just doesnt boot. I can boot off another fs and have disko create and mount drives other than root. Was trying to debug more before I posted anything.21:57:34
@blimbus:matrix.orgblimbus *

I've been having the same issue, I cant get my system to boot with root on bcachefs using disko. The filesystem exists, I can mount create and view files but the system just doesnt boot. I can boot off another fs and have disko create and mount drives other than root. Was trying to debug more before I posted anything.

Been feeling a little crazy cause I couldn't find any mention of the issue, almost glad to see its not just me

22:01:25
11 Nov 2025
@no-mood:matrix.orgno-moodOkay I'm pretty sure it's related to: https://github.com/nix-community/disko/issues/104500:27:23
@whispers:catgirl.cloud@whispers:catgirl.cloud left the room.00:28:16
@no-mood:matrix.orgno-moodAnd (thanks ElvishJerrico and dramforever) actually I think people didn't realized this because mount were broken: https://github.com/NixOS/nixpkgs/pull/41439100:29:01
@no-mood:matrix.orgno-moodThe issue is indeed related to the subvolumes: I think they are created, but they aren't mounted end all the files go into the root as descrived in the issue. I couldn't get them to work even by moving the files where they should be (inside the subvolumes)00:30:36
@no-mood:matrix.orgno-moodNow I got it to work (in the 5th install of the day) by avoiding subvolumes until this is fixed :)00:31:15
@no-mood:matrix.orgno-moodAs I expected you're creating subvolumes. It should be the same issue00:32:53
12 Nov 2025
@chris:kruining.euChris P BaconI have been wanting to add disko to my flake for a while now, but I am uncertain as how to do that without losing any data on disk. I have been running nixos at home for about 2 years now and I would like to up my game by introducing disko, with future installs/reinstalls in mind. But I am afraid that when I add it that my disks will get formatted according to the disk config I will have created. Is there an onboarding/getting started guide somewhere for adding disko to existing systems?07:09:13

Show newer messages


Back to Room ListRoom Version: 10