!oNSIfazDqEcwhcOjSL:matrix.org

disko

339 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko86 Servers

Load older messages


SenderMessageTime
10 Nov 2025
@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
@lassulus:lassul.uslassulusthey are not getting formatted if you add disko, but they will get mounted according to it07:21:57
@lassulus:lassul.uslassulusso if you add something that is not what you currently have, you could not boot it07:22:16
@lassulus:lassul.uslassulusbut rollback should still work in that case07:22:23
@chris:kruining.euChris P Baconso besides not being able to boot (which I could solve with a live-usb and mounting manually), there are no dangers to my data when adopting disko? cool!07:23:59
@lassulus:lassul.uslassuluswell there is also rollback when booting, you can just boot an older generation without the usb07:27:56
@lassulus:lassul.uslassulusbut disko is not run automatically, only nixos-anywhere or disko-install is running disko07:28:17
@lassulus:lassul.uslassulusor if you run it manually07:28:21
@chris:kruining.euChris P Baconooooooooooh, gotcha07:28:41
@chris:kruining.euChris P Baconawesome, tnx!07:28:48
@lassulus:lassul.uslassulusa downside of that model is: if you add new volumes, pools, mount or something in your disko config, it will not automatically apply without reinstalling07:29:33
@lassulus:lassul.uslassulusin theory you can run the format script again, it has some checks to not delete data07:29:58
@lassulus:lassul.uslassulusbut that is not super tested, so better do it with backups07:30:10
@chris:kruining.euChris P BaconAgreed. That is also not my goal. what I want to do is to migrate my current snowfall based config for my machines at home to a clan based one, and the only hurdle I saw was the adoption of disko. But knowing that disko is not really ran outside of install or manual invocations I can happily do my migration. If and when I ever do end up reconfiguring my disk I get it that the best course of action is to first to a backup, but then again, this would have been the flow if I'd done it all manually anyway! So again, thanks for dispelling my worries!07:35:57
@inayet:matrix.orgInayet changed their display name from inayet to Inayet.12:38:55
13 Nov 2025
@brian:bmcgee.ie@brian:bmcgee.ie left the room.09:40:01
@debtquity:matrix.orgdebtquity joined the room.20:24:28

There are no newer messages yet.


Back to Room ListRoom Version: 10