!oNSIfazDqEcwhcOjSL:matrix.org

disko

367 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko95 Servers

Load older messages


SenderMessageTime
16 Jan 2025
@zvzg:matrix.orgSáviohttps://github.com/nix-community/disko/pull/943 binfmt emulation21:34:23
@zvzg:matrix.orgSávioI tried using QEMU, but it was too slow without KVM21:35:10
17 Jan 2025
@zvzg:matrix.orgSávioIs there a way to run into the VM after finishing the build but before exiting? I would like to modify some files in the image00:47:42
@zvzg:matrix.orgSávio* Is there a way to run commands in the VM after finishing the build but before exiting? I would like to modify some files in the image00:47:54
@zvzg:matrix.orgSáviosystem.activationScripts seems to do the trick02:00:58
@rts-kaede:thewired.chかえでちゃんis it possible to have the swap inside a luks lvm and have working hibernation?14:14:54
@rts-kaede:thewired.chかえでちゃん* is it possible to have the swap inside a luks lvm and have working hibernation with disko?14:15:28
@lassulus:lassul.uslassulusyes14:16:04
@lassulus:lassul.uslassulusI think you need to configure some kernel parameters for that, but I could be mistaken14:16:27
18 Jan 2025
@lanice:matrix.orglanice joined the room.23:03:28
@lanice:matrix.orglanice

Hi! First time using disko, started out with an example using nixos-anywhere with just one ext4 partition (besides boot), and it worked great!

My question: Is it possible to have just /nix mounted on my ext4 partition, and the rest of root (/, /var, etc.) mounted on a differend SSD with zfs?

23:05:59
@lassulus:lassul.uslassulusyeah, just point / on the other one and /nix on the one you want /nix to be, you just need to set the mountpoint23:23:15
@lanice:matrix.orglaniceThanks!23:28:42
@lanice:matrix.orglanice One other question: I've seen a few configs that used a post creat hook, something like postCreateHook = "zfs snapshot zroot/local/root@blank";, while other configs don't. What are the implications here. Is it just the inital snapshot that's missing, the "empty" one basically? Do I need that? 23:29:38
19 Jan 2025
@enzime:nixos.devEnzime people make the empty snapshot for impermanence setups where you wipe your rootfs on every boot 02:38:54
@lanice:matrix.orglaniceAh, right, I've seen that before. That makes sense, thank you! Not doing that for now.03:00:51
@lanice:matrix.orglanice

For my HDD's, I have a zpool "data" configured like this:

data = {
  type = "zpool";
  mode = {
    topology = {
      type = "topology";
      vdev = [ { members = ["hdd24tb_0" "hdd24tb_1" "hdd24tb_2"]; mode = "raidz1"; } ];
    };
  };
  rootFsOptions = {
    atime = "off";
    xattr = "sa";
    compression = "zstd";
  };
  options.ashift = "12";
  datasets = {
    "data" = { type = "zfs_fs"; mountpoint = "/data"; };
    "media" = { type = "zfs_fs";  mountpoint = "/data/media"; };
    "backup" = { type = "zfs_fs"; mountpoint = "/data/backup"; };
  };
};

After finishing the install with nixos-anywhere, when I do zfs list, the output for that pool is:

data                1.41M  43.5T   139K  /data
data/backup  128K   43.5T   128K  /data/backup
data/data       139K   43.5T   139K  /data
data/media    128K   43.5T   128K  /data/media

What confuses me is the double-use of mountpoint /data. It seems both data and data/data is mounted on /data. Why did that happen? I probably did something wrong in my disko config, I'm doing a lot of trial and error and looking at other configs.

03:21:46
@lanice:matrix.orglanice *

For my HDD's, I have a zpool "data" configured like this:

disko.devices.zpool.data = {
  type = "zpool";
  mode = {
    topology = {
      type = "topology";
      vdev = [ { members = ["hdd24tb_0" "hdd24tb_1" "hdd24tb_2"]; mode = "raidz1"; } ];
    };
  };
  rootFsOptions = {
    atime = "off";
    xattr = "sa";
    compression = "zstd";
  };
  options.ashift = "12";
  datasets = {
    "data" = { type = "zfs_fs"; mountpoint = "/data"; };
    "media" = { type = "zfs_fs";  mountpoint = "/data/media"; };
    "backup" = { type = "zfs_fs"; mountpoint = "/data/backup"; };
  };
};

After finishing the install with nixos-anywhere, when I do zfs list, the output for that pool is:

data                1.41M  43.5T   139K  /data
data/backup  128K   43.5T   128K  /data/backup
data/data       139K   43.5T   139K  /data
data/media    128K   43.5T   128K  /data/media

What confuses me is the double-use of mountpoint /data. It seems both data and data/data is mounted on /data. Why did that happen? I probably did something wrong in my disko config, I'm doing a lot of trial and error and looking at other configs.

03:22:36
@lanice:matrix.orglanice *

For my HDD's, I have a zpool "data" configured like this:

disko.devices.zpool.data = {
  type = "zpool";
  mode = {
    topology = {
      type = "topology";
      vdev = [ { members = ["hdd24tb_0" "hdd24tb_1" "hdd24tb_2"]; mode = "raidz1"; } ];
    };
  };
  rootFsOptions = {
    atime = "off";
    xattr = "sa";
    compression = "zstd";
  };
  options.ashift = "12";
  datasets = {
    "data" = { type = "zfs_fs"; mountpoint = "/data"; };
    "media" = { type = "zfs_fs";  mountpoint = "/data/media"; };
    "backup" = { type = "zfs_fs"; mountpoint = "/data/backup"; };
  };
};

After finishing the install with nixos-anywhere, when I do zfs list, the output for that pool is:

data                1.41M  43.5T   139K  /data
data/backup  128K   43.5T   128K  /data/backup
data/data  139K   43.5T   139K  /data
data/media    128K   43.5T   128K  /data/media

What confuses me is the double-use of mountpoint /data. It seems both data and data/data is mounted on /data. Why did that happen? I probably did something wrong in my disko config, I'm doing a lot of trial and error and looking at other configs.

03:24:58
@lanice:matrix.orglanice *

For my HDD's, I have a zpool "data" configured like this:

disko.devices.zpool.data = {
  type = "zpool";
  mode = {
    topology = {
      type = "topology";
      vdev = [ { members = ["hdd24tb_0" "hdd24tb_1" "hdd24tb_2"]; mode = "raidz1"; } ];
    };
  };
  rootFsOptions = {
    atime = "off";
    xattr = "sa";
    compression = "zstd";
  };
  options.ashift = "12";
  datasets = {
    "data" = { type = "zfs_fs"; mountpoint = "/data"; };
    "media" = { type = "zfs_fs";  mountpoint = "/data/media"; };
    "backup" = { type = "zfs_fs"; mountpoint = "/data/backup"; };
  };
};

After finishing the install with nixos-anywhere, when I do zfs list, the output for that pool is:

data                1.41M  43.5T   139K  /data
data/backup  128K   43.5T   128K  /data/backup
data/data    139K   43.5T   139K  /data
data/media    128K   43.5T   128K  /data/media

What confuses me is the double-use of mountpoint /data. It seems both data and data/data is mounted on /data. Why did that happen? I probably did something wrong in my disko config, I'm doing a lot of trial and error and looking at other configs.

03:25:06
@lanice:matrix.orglanice *

For my HDD's, I have a zpool "data" configured like this:

disko.devices.zpool.data = {
  type = "zpool";
  mode = {
    topology = {
      type = "topology";
      vdev = [ { members = ["hdd24tb_0" "hdd24tb_1" "hdd24tb_2"]; mode = "raidz1"; } ];
    };
  };
  rootFsOptions = {
    atime = "off";
    xattr = "sa";
    compression = "zstd";
  };
  options.ashift = "12";
  datasets = {
    "data" = { type = "zfs_fs"; mountpoint = "/data"; };
    "media" = { type = "zfs_fs";  mountpoint = "/data/media"; };
    "backup" = { type = "zfs_fs"; mountpoint = "/data/backup"; };
  };
};

After finishing the install with nixos-anywhere, when I do zfs list, the output for that pool is:

data          1.41M  43.5T   139K  /data
data/backup  128K   43.5T   128K  /data/backup
data/data    139K   43.5T   139K  /data
data/media   128K   43.5T   128K  /data/media

What confuses me is the double-use of mountpoint /data. It seems both data and data/data is mounted on /data. Why did that happen? I probably did something wrong in my disko config, I'm doing a lot of trial and error and looking at other configs.

03:25:19
@lanice:matrix.orglanice *

For my HDD's, I have a zpool "data" configured like this:

disko.devices.zpool.data = {
  type = "zpool";
  mode = {
    topology = {
      type = "topology";
      vdev = [ { members = ["hdd24tb_0" "hdd24tb_1" "hdd24tb_2"]; mode = "raidz1"; } ];
    };
  };
  rootFsOptions = {
    atime = "off";
    xattr = "sa";
    compression = "zstd";
  };
  options.ashift = "12";
  datasets = {
    "data" = { type = "zfs_fs"; mountpoint = "/data"; };
    "media" = { type = "zfs_fs";  mountpoint = "/data/media"; };
    "backup" = { type = "zfs_fs"; mountpoint = "/data/backup"; };
  };
};

After finishing the install with nixos-anywhere, when I do zfs list, the output for that pool is:

data         1.41M  43.5T   139K  /data
data/backup  128K   43.5T   128K  /data/backup
data/data    139K   43.5T   139K  /data
data/media   128K   43.5T   128K  /data/media

What confuses me is the double-use of mountpoint /data. It seems both data and data/data is mounted on /data. Why did that happen? I probably did something wrong in my disko config, I'm doing a lot of trial and error and looking at other configs.

03:25:26
@lanice:matrix.orglaniceCould it be that I should not declare the first of those datasets at all, "data" with mountpoint "/data"?03:34:28
@enzime:nixos.devEnzimeit looks like the dataset shouldn't be mounted from what you posted, maybe it's something to do with ZFS topologies, I'm not very familiar with them (possibly a bug?)04:12:42
@enzime:nixos.devEnzime the simplest fix would be to add canmount = "off" and mountpoint = "none"; to rootFsOptions 04:13:47
@lanice:matrix.orglaniceThank you, will try that! Is it possible to make those changes without reinstalling just with disko, or do I need to wipe and repartition everything?04:22:06
@enzime:nixos.devEnzime the simplest solution would be running zfs set -u canmount=off mountpoint=none data and then rebooting 04:29:20
@lanice:matrix.orglaniceRight, makes sense, thank you!04:33:40
@raj-magesh:matrix.orgRaj

Running into this error when trying to use disko to create a bootable USB (sudo nix run 'github:nix-community/disko/latest#disko-install' -- --flake '.#image' --disk nixos-usb-stick /dev/sdc):

Creating initial /etc/machine-id
efiSysMountPoint = '/boot' is not a mounted partition. Is the path configured correctly?
Traceback (most recent call last):
  File "/nix/store/diy6lcklb9r4k18l6plg6yj9chn3pg19-systemd-boot/bin/systemd-boot", line 431, in <module>
    main()
  File "/nix/store/diy6lcklb9r4k18l6plg6yj9chn3pg19-systemd-boot/bin/systemd-boot", line 411, in main
    run([CHECK_MOUNTPOINTS])
  File "/nix/store/diy6lcklb9r4k18l6plg6yj9chn3pg19-systemd-boot/bin/systemd-boot", line 58, in run
    return subprocess.run(cmd, check=True, text=True, stdout=stdout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/nix/store/686vaqa40l0vxcp1ll54cbvlrmn9kn55-check-mountpoints']' returned non-zero exit status 1.
Failed to install bootloader
disko-install failed
rmdir: failed to remove '/mnt/disko-install-root': Directory not empty

The disko config is:

{
  disko.devices = {
    nodev."/" = {
      fsType = "tmpfs";
      mountOptions = [
        "size=2G"
        "defaults"
        "mode=755"
      ];
    };
    nodev."/home/raj" = {
      fsType = "tmpfs";
      mountOptions = [
        "size=2G"
        "defaults"
        "mode=777"
      ];
    };
    disk = {
      nixos-usb-stick = {
        type = "disk";
        content = {
          type = "gpt";
          partitions = {
            ESP = {
              type = "EF00";
              priority = 0;
              end = "1G";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
                mountOptions = ["defaults" "umask=0077"];
              };
            };
            root = {
              priority = 1;
              end = "-0";
              content = {
                type = "luks";
                name = "root";
                initrdUnlock = true;
                extraFormatArgs = ["--pbkdf argon2id"];
                content = {
                  type = "btrfs";
                  extraArgs = ["-f"];
                  subvolumes = {
                    "/nix" = {
                      mountpoint = "/nix";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                    "/persist" = {
                      mountpoint = "/persist";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                    "/data" = {
                      mountpoint = "/data";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                  };
                };
              };
            };
          };
        };
      };
    };
  };
}
23:13:36
@raj-magesh:matrix.orgRaj *

Could someone please help me troubleshoot this?

I'm running into this error when trying to use disko to create a bootable USB (sudo nix run 'github:nix-community/disko/latest#disko-install' -- --flake '.#image' --disk nixos-usb-stick /dev/sdc):

Creating initial /etc/machine-id
efiSysMountPoint = '/boot' is not a mounted partition. Is the path configured correctly?
Traceback (most recent call last):
  File "/nix/store/diy6lcklb9r4k18l6plg6yj9chn3pg19-systemd-boot/bin/systemd-boot", line 431, in <module>
    main()
  File "/nix/store/diy6lcklb9r4k18l6plg6yj9chn3pg19-systemd-boot/bin/systemd-boot", line 411, in main
    run([CHECK_MOUNTPOINTS])
  File "/nix/store/diy6lcklb9r4k18l6plg6yj9chn3pg19-systemd-boot/bin/systemd-boot", line 58, in run
    return subprocess.run(cmd, check=True, text=True, stdout=stdout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/nix/store/686vaqa40l0vxcp1ll54cbvlrmn9kn55-check-mountpoints']' returned non-zero exit status 1.
Failed to install bootloader
disko-install failed
rmdir: failed to remove '/mnt/disko-install-root': Directory not empty

The disko config is:

{
  disko.devices = {
    nodev."/" = {
      fsType = "tmpfs";
      mountOptions = [
        "size=2G"
        "defaults"
        "mode=755"
      ];
    };
    nodev."/home/raj" = {
      fsType = "tmpfs";
      mountOptions = [
        "size=2G"
        "defaults"
        "mode=777"
      ];
    };
    disk = {
      nixos-usb-stick = {
        type = "disk";
        content = {
          type = "gpt";
          partitions = {
            ESP = {
              type = "EF00";
              priority = 0;
              end = "1G";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
                mountOptions = ["defaults" "umask=0077"];
              };
            };
            root = {
              priority = 1;
              end = "-0";
              content = {
                type = "luks";
                name = "root";
                initrdUnlock = true;
                extraFormatArgs = ["--pbkdf argon2id"];
                content = {
                  type = "btrfs";
                  extraArgs = ["-f"];
                  subvolumes = {
                    "/nix" = {
                      mountpoint = "/nix";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                    "/persist" = {
                      mountpoint = "/persist";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                    "/data" = {
                      mountpoint = "/data";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                  };
                };
              };
            };
          };
        };
      };
    };
  };
}
23:14:08

Show newer messages


Back to Room ListRoom Version: 10