disko icon indicating copy to clipboard operation
disko copied to clipboard

luks + btrfs + mode=format then error: /dev/mapper/crypted: No such file or directory

Open Alex0159 opened this issue 1 year ago • 5 comments

Doesn't work only when --mode format. If --mode disko then it works fine!

command: sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko/refs/tags/v1.6.1 -- --mode format /tmp/disk-config.nix

disk-config.nix

{
  disko.devices = {
    disk = {
      vdb = {
        type = "disk";
        device = "/dev/sda";
        content = {
          type = "gpt";
          partitions = {
            ESP = {
              size = "512M";
              type = "EF00";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
                mountOptions = [
                  "defaults"
                ];
              };
            };
            luks = {
              size = "100%";
              content = {
                type = "luks";
                name = "crypted";
                settings = {
                  allowDiscards = true;
                };
                content = {
                  type = "btrfs";
                  extraArgs = [ "-f" ];
                  subvolumes = {
                    "/root" = {
                      mountpoint = "/";
                      mountOptions = [ "compress=zstd" "noatime" ];
                    };
                    "/home" = {
                      mountpoint = "/home";
                      mountOptions = [ "compress=zstd" "noatime" ];
                    };
                    "/nix" = {
                      mountpoint = "/nix";
                      mountOptions = [ "compress=zstd" "noatime" ];
                    };
                  };
                };
              };
            };
          };
        };
      };
    };
  };
}
full log output

these 2 derivations will be built:
  /nix/store/sm8aff0vs5x9www3zp0h1v31fp8sv9p6-disko-format.drv
  /nix/store/8f5phkjkf14j0fzl51pki1xhrfhsscch-disko-format.drv
these 97 paths will be fetched (91.00 MiB download, 422.86 MiB unpacked):
  /nix/store/61s8cmgwj8kslqkqs80a2whwysqd354k-audit-3.1.2
  /nix/store/ddnli8jf61g96xlmfgfnav5cf041pq95-bash-interactive-5.2p26
  /nix/store/nd7ass1isid4vswpkfm82za4mcdwhzsm-binutils-2.41
  /nix/store/7chcrb7ra9w7xyyzfrhw0vnv2chb6324-binutils-2.41-lib
  /nix/store/2vkh4388dshscjx942dqvgsl24hnkkq9-binutils-wrapper-2.41
  /nix/store/bxabn71ypbij5i62r5cs0h390nxg1fsy-btrfs-progs-6.8.1
  /nix/store/f04qx31pp9r27yzzks4bqmm8ic3f0vqr-cracklib-2.9.11
  /nix/store/v1089yp5xkfmdjd92iy5yzndxa3k6pxh-cryptsetup-2.7.1
  /nix/store/q5k86f5q7ggzfb4dv9wivi8q4bdvz1r1-cryptsetup-2.7.1-bin
  /nix/store/whkfih9b9z6hxygc132yfl4rdp7s25dc-db-4.8.30
  /nix/store/1wfza83aqrd26yr2wbdkknsqw7y176bk-dns-root-data-2023-11-27
  /nix/store/v6zxh44lxf3aqx1s13srgy1q1pyr7rng-dosfstools-4.2
  /nix/store/gd6czldzbk9ls8hs7il3vjmzd9az9cqy-e2fsprogs-1.47.0
  /nix/store/fk2dqykgli2rqxwlzc5vjn829acdzhzm-elfutils-0.191
  /nix/store/7yysb8igbmgvshkyy90ipdgnb7mg6zw1-expand-response-params
  /nix/store/9hgsinpfgyvsd92v0wlvmxv9wnaal68r-gcc-13.2.0
  /nix/store/8mjb3ziimfi3rki71q4s0916xkm4cm5p-gcc-wrapper-13.2.0
  /nix/store/as2pg1bk7cxq4a0rfk8n7rwak9r2wvqq-getent-glibc-2.39-31
  /nix/store/nkdgysx90pln2l562l7lsk021hbxjdg8-glibc-2.39-31-bin
  /nix/store/s3pvsv4as7mc8i2nwnk2hnsyi2qdj4bq-glibc-2.39-31-dev
  /nix/store/q66l12afk5bly0aprvdxjkjrsz2dbma8-glibc-2.39-31-getent
  /nix/store/mwpwq9zxxjqdfgigqvqk0zv3q8yrw8r5-gmp-6.3.0
  /nix/store/82rfcrmzk1j9g771b6j686npvy8rfyhp-gmp-with-cxx-6.3.0
  /nix/store/cvb16fqf890lh99nvql3vcg6f2liw4xb-gnupg-2.4.5
  /nix/store/pw8asivc7x1fx1hg6xc9456mpxn8pimq-gnutls-3.8.4
  /nix/store/pb39d5y2kvhkc4d1i252b6x2sp7k75gy-gptfdisk-1.0.9
  /nix/store/06s2nxj7qdxzclmwjrv0gnr9z9w8rq9s-iptables-1.8.10
  /nix/store/i9zf5xl74g1ripwfzl45wsj74b9fyyv2-isl-0.20
  /nix/store/q595nw2fzmzh2l2p8glfgzc9v5hl7dxf-jq-1.7.1
  /nix/store/cbgw9mvxl7s93l700xwr71syg1ppbs5l-jq-1.7.1-bin
  /nix/store/0q856fk6f12jw1lrb49i5hky9xhssdw0-jq-1.7.1-doc
  /nix/store/89b3jfhcgv02zlscsipwifsk1yscxk33-jq-1.7.1-lib
  /nix/store/fh2pylnsv887ycj0spvr7vl3622ydyx7-jq-1.7.1-man
  /nix/store/h0d2y9qfsj24kck6fwhp1kj12m7r50ry-json-c-0.17
  /nix/store/riacgg091nv1cm2lcbgc1bmsakim5hb1-kbd-2.6.4
  /nix/store/gs471pmlahj0mjdwwqdx0d7v68816cdj-kexec-tools-2.0.28
  /nix/store/jj6bcp8cy4s8pi5svaq2gnkpl9bd5fw2-kmod-31
  /nix/store/d792d9hp5x3g8s1w1jibvydjcw547863-kmod-31-lib
  /nix/store/2pikbp8syzcc3lhasfax73n4m5mpi6g4-libapparmor-3.1.7
  /nix/store/4bsrrn0jh4clzf0yh2ahykgkzmzc7sby-libargon2-20190702
  /nix/store/am21nikxnsdkzm5r3b2g1rcaj2xv2zd0-libassuan-2.5.7
  /nix/store/h5xqs0ykls7yk0wqpnz24wnvmxv29mk1-libbpf-1.4.0
  /nix/store/si81szrjym2wksdxf8m6yqz8y383idlx-libbsd-0.11.8
  /nix/store/01xhvvrfkpfghp6r9iywahl9vd1ypgm0-libcap-2.69-lib
  /nix/store/6qkzv8h8qbwb8zp79fscgq27il1zjrqg-libcap-ng-0.8.5
  /nix/store/jxcxdqpdk2047r62lapa5hd75f8sdqh0-libcbor-0.11.0
  /nix/store/bxkwk74hyfaqz1lr326r3qr5091dj45a-libevent-2.1.12
  /nix/store/ym7yrwqvzcb3i3js4x322nyd4c5k944l-libffi-3.4.6
  /nix/store/hrmxzlv4knyhxkza8ijdmf96vb3zjs9d-libfido2-1.14.0
  /nix/store/f836lnjsaads44kxf54bma4rmi7l97jd-libgcrypt-1.10.3
  /nix/store/1x14bgfzih78bsrbxdbp5isf4910dc1c-libgpg-error-1.48
  /nix/store/m5lri8cxiknksbzsw5d1i4bgk8ydqfcq-libmd-1.1.0
  /nix/store/axw73qqqg0avz8rwdqzypr3p70smzd31-libmicrohttpd-0.9.77
  /nix/store/10lgjfkjw4va7pw04shwy3m6fgp8mvps-libmnl-1.0.5
  /nix/store/307k767vw31xjvyzdadl27wqds4cpd45-libmpc-1.3.1
  /nix/store/dmxh0byg2v7sm890ak88d8wpxzy07rnn-libnetfilter_conntrack-1.0.9
  /nix/store/8wkzwn7q5sbnrlprpviclnm5vyh16m7x-libnfnetlink-1.0.2
  /nix/store/hvdkyxqagy018cd5jwfgzb08skda0v4j-libnftnl-1.2.6
  /nix/store/8cskcl0nxf365ak19g4fccrh9n11yfhz-libnl-3.8.0
  /nix/store/8p5frfp1pdf79i1ka0lyfdfa755wvfas-libpcap-1.10.4
  /nix/store/5cqgjfln0wsqrsf7inqwk9dg0dh9dk75-libpwquality-1.4.5-lib
  /nix/store/rhhi7ky5kmabz3gw7gf6lrj4yii4k7c5-libtasn1-4.19.0
  /nix/store/fjxs9vk02ldpz0xyd3yh5pnzvhq9gmby-libxcrypt-4.4.36
  /nix/store/dpmf4xvdgd6k8vq4l0vc5aiq1smj3qs9-linux-headers-6.7
  /nix/store/5a0xhcjclygjx14y4nl06sa57in6jx2z-linux-pam-1.6.1
  /nix/store/4gjl6kkb910nqfly4wxq6n7k33mp52h8-lvm2-2.03.23-lib
  /nix/store/9ncj23fg425ml84b18d18ziqwmsgjcs5-lz4-1.9.4
  /nix/store/69vkirvnj9iy3c402n0j1aiy06zk6f05-lzo-2.10
  /nix/store/p82mcqxqmiy9y8d5nbyhmia3w9cr8zzs-make-binary-wrapper-hook
  /nix/store/cpsl8rvkbgs2z1vnvk232azhvw0j06n9-mpfr-4.2.1
  /nix/store/bansz88nyaibv57nv65s445f979cbdsh-ncurses-6.4
  /nix/store/a2vhcn41bwq9fglz2fz9vjl89q5m5q79-nettle-3.9.1
  /nix/store/spcxz0qy1dlh9ki022z8bb05fbpyg86l-npth-1.7
  /nix/store/rhkja77sgby8jy0ifbfrw4znh2m6vxx0-oniguruma-6.9.9-lib
  /nix/store/bvdpi00bwnhsga3jmw7h8gg5awhs5h75-p11-kit-0.25.3
  /nix/store/0ny93bgk7ax8wa2qvjkyb4zwyh6dkvb2-parted-3.6
  /nix/store/ggw72j3wkx123jgb0sdxl7jk4jyiv9rb-pcsclite-2.1.0-lib
  /nix/store/v60001b1k0y05z6b1p33p6p4n76pax8p-popt-1.19
  /nix/store/lfahiwrjb754r40jsw2420kqksj19ws5-qrencode-4.1.1
  /nix/store/9gwriddks3qrf5vp6xfgb98rxv06qy1n-readline-8.2p10
  /nix/store/ni2x5a5x9j72l3s4wc7vs1r27b5hqzxi-shadow-4.14.6
  /nix/store/7kq9hvrhcy8g1v0jd07nr54279asg9vc-systemd-255.4
  /nix/store/ppf4k669sbm1kyggr7pbi34ycb62j6gp-systemd-minimal-255.4
  /nix/store/lsp7hk1ppjv403q8h191p929wycbk0r3-systemd-minimal-libs-255.4
  /nix/store/1a4y0rc03bckd5mh4kz11wdlcp31zzdi-tcb-1.2
  /nix/store/3a5xyr1m20j0nynra9ixrzir6x32yqfr-tpm2-tss-4.0.1
  /nix/store/jg8vvfj0956s6xmdmg2hwvn6jlipyz64-unbound-1.19.3-lib
  /nix/store/m1rwzr3vzvlj8a7q9yyx2jpd3mnx41y4-util-linux-2.39.3-bin
  /nix/store/3dnv665sh0rxiwzn07syi7r1kcn1s317-util-linux-2.39.3-lib
  /nix/store/shgp1v6na0md1arxil4r21avyl9a86rv-util-linux-2.39.3-login
  /nix/store/8pbbv3jx5m7cqplrksryiml0sgjv4q3f-util-linux-2.39.3-mount
  /nix/store/sp2h5r9f8x6mzfiqywv1ssaj6nhvyqqi-util-linux-2.39.3-swap
  /nix/store/ys012ym65rapli9pk6x7356pyc96mm4b-util-linux-minimal-2.39.3-lib
  /nix/store/2pik1pw6w0dagkgfcmlga03997m3fwg3-util-linux-minimal-2.39.3-login
  /nix/store/mqfwb4ply3xdasvh5zy154mhvpcqxk44-util-linux-minimal-2.39.3-mount
  /nix/store/854dsca032cfnna42mlq33gf5p0hggb5-util-linux-minimal-2.39.3-swap
  /nix/store/0j3yimfjqwv4wh4v3xdqrdsb4sp90yw9-zstd-1.5.6-bin
copying path '/nix/store/0q856fk6f12jw1lrb49i5hky9xhssdw0-jq-1.7.1-doc' from 'https://cache.nixos.org'...
copying path '/nix/store/q595nw2fzmzh2l2p8glfgzc9v5hl7dxf-jq-1.7.1' from 'https://cache.nixos.org'...
copying path '/nix/store/fh2pylnsv887ycj0spvr7vl3622ydyx7-jq-1.7.1-man' from 'https://cache.nixos.org'...
copying path '/nix/store/v6zxh44lxf3aqx1s13srgy1q1pyr7rng-dosfstools-4.2' from 'https://cache.nixos.org'...
copying path '/nix/store/61s8cmgwj8kslqkqs80a2whwysqd354k-audit-3.1.2' from 'https://cache.nixos.org'...
copying path '/nix/store/whkfih9b9z6hxygc132yfl4rdp7s25dc-db-4.8.30' from 'https://cache.nixos.org'...
copying path '/nix/store/7yysb8igbmgvshkyy90ipdgnb7mg6zw1-expand-response-params' from 'https://cache.nixos.org'...
copying path '/nix/store/gs471pmlahj0mjdwwqdx0d7v68816cdj-kexec-tools-2.0.28' from 'https://cache.nixos.org'...
copying path '/nix/store/d792d9hp5x3g8s1w1jibvydjcw547863-kmod-31-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/01xhvvrfkpfghp6r9iywahl9vd1ypgm0-libcap-2.69-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/6qkzv8h8qbwb8zp79fscgq27il1zjrqg-libcap-ng-0.8.5' from 'https://cache.nixos.org'...
copying path '/nix/store/jj6bcp8cy4s8pi5svaq2gnkpl9bd5fw2-kmod-31' from 'https://cache.nixos.org'...
copying path '/nix/store/fjxs9vk02ldpz0xyd3yh5pnzvhq9gmby-libxcrypt-4.4.36' from 'https://cache.nixos.org'...
copying path '/nix/store/bansz88nyaibv57nv65s445f979cbdsh-ncurses-6.4' from 'https://cache.nixos.org'...
copying path '/nix/store/dpmf4xvdgd6k8vq4l0vc5aiq1smj3qs9-linux-headers-6.7' from 'https://cache.nixos.org'...
copying path '/nix/store/69vkirvnj9iy3c402n0j1aiy06zk6f05-lzo-2.10' from 'https://cache.nixos.org'...
copying path '/nix/store/7chcrb7ra9w7xyyzfrhw0vnv2chb6324-binutils-2.41-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/f04qx31pp9r27yzzks4bqmm8ic3f0vqr-cracklib-2.9.11' from 'https://cache.nixos.org'...
copying path '/nix/store/1wfza83aqrd26yr2wbdkknsqw7y176bk-dns-root-data-2023-11-27' from 'https://cache.nixos.org'...
copying path '/nix/store/fk2dqykgli2rqxwlzc5vjn829acdzhzm-elfutils-0.191' from 'https://cache.nixos.org'...
copying path '/nix/store/nkdgysx90pln2l562l7lsk021hbxjdg8-glibc-2.39-31-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/q66l12afk5bly0aprvdxjkjrsz2dbma8-glibc-2.39-31-getent' from 'https://cache.nixos.org'...
copying path '/nix/store/mwpwq9zxxjqdfgigqvqk0zv3q8yrw8r5-gmp-6.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/82rfcrmzk1j9g771b6j686npvy8rfyhp-gmp-with-cxx-6.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/h0d2y9qfsj24kck6fwhp1kj12m7r50ry-json-c-0.17' from 'https://cache.nixos.org'...
copying path '/nix/store/2pikbp8syzcc3lhasfax73n4m5mpi6g4-libapparmor-3.1.7' from 'https://cache.nixos.org'...
copying path '/nix/store/4bsrrn0jh4clzf0yh2ahykgkzmzc7sby-libargon2-20190702' from 'https://cache.nixos.org'...
copying path '/nix/store/jxcxdqpdk2047r62lapa5hd75f8sdqh0-libcbor-0.11.0' from 'https://cache.nixos.org'...
copying path '/nix/store/bxkwk74hyfaqz1lr326r3qr5091dj45a-libevent-2.1.12' from 'https://cache.nixos.org'...
copying path '/nix/store/ym7yrwqvzcb3i3js4x322nyd4c5k944l-libffi-3.4.6' from 'https://cache.nixos.org'...
copying path '/nix/store/1x14bgfzih78bsrbxdbp5isf4910dc1c-libgpg-error-1.48' from 'https://cache.nixos.org'...
copying path '/nix/store/as2pg1bk7cxq4a0rfk8n7rwak9r2wvqq-getent-glibc-2.39-31' from 'https://cache.nixos.org'...
copying path '/nix/store/m5lri8cxiknksbzsw5d1i4bgk8ydqfcq-libmd-1.1.0' from 'https://cache.nixos.org'...
copying path '/nix/store/10lgjfkjw4va7pw04shwy3m6fgp8mvps-libmnl-1.0.5' from 'https://cache.nixos.org'...
copying path '/nix/store/8wkzwn7q5sbnrlprpviclnm5vyh16m7x-libnfnetlink-1.0.2' from 'https://cache.nixos.org'...
copying path '/nix/store/8cskcl0nxf365ak19g4fccrh9n11yfhz-libnl-3.8.0' from 'https://cache.nixos.org'...
copying path '/nix/store/rhhi7ky5kmabz3gw7gf6lrj4yii4k7c5-libtasn1-4.19.0' from 'https://cache.nixos.org'...
copying path '/nix/store/i9zf5xl74g1ripwfzl45wsj74b9fyyv2-isl-0.20' from 'https://cache.nixos.org'...
copying path '/nix/store/9ncj23fg425ml84b18d18ziqwmsgjcs5-lz4-1.9.4' from 'https://cache.nixos.org'...
copying path '/nix/store/cpsl8rvkbgs2z1vnvk232azhvw0j06n9-mpfr-4.2.1' from 'https://cache.nixos.org'...
copying path '/nix/store/nd7ass1isid4vswpkfm82za4mcdwhzsm-binutils-2.41' from 'https://cache.nixos.org'...
copying path '/nix/store/h5xqs0ykls7yk0wqpnz24wnvmxv29mk1-libbpf-1.4.0' from 'https://cache.nixos.org'...
copying path '/nix/store/a2vhcn41bwq9fglz2fz9vjl89q5m5q79-nettle-3.9.1' from 'https://cache.nixos.org'...
copying path '/nix/store/5a0xhcjclygjx14y4nl06sa57in6jx2z-linux-pam-1.6.1' from 'https://cache.nixos.org'...
copying path '/nix/store/am21nikxnsdkzm5r3b2g1rcaj2xv2zd0-libassuan-2.5.7' from 'https://cache.nixos.org'...
copying path '/nix/store/f836lnjsaads44kxf54bma4rmi7l97jd-libgcrypt-1.10.3' from 'https://cache.nixos.org'...
copying path '/nix/store/spcxz0qy1dlh9ki022z8bb05fbpyg86l-npth-1.7' from 'https://cache.nixos.org'...
copying path '/nix/store/s3pvsv4as7mc8i2nwnk2hnsyi2qdj4bq-glibc-2.39-31-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/si81szrjym2wksdxf8m6yqz8y383idlx-libbsd-0.11.8' from 'https://cache.nixos.org'...
copying path '/nix/store/hvdkyxqagy018cd5jwfgzb08skda0v4j-libnftnl-1.2.6' from 'https://cache.nixos.org'...
copying path '/nix/store/dmxh0byg2v7sm890ak88d8wpxzy07rnn-libnetfilter_conntrack-1.0.9' from 'https://cache.nixos.org'...
copying path '/nix/store/rhkja77sgby8jy0ifbfrw4znh2m6vxx0-oniguruma-6.9.9-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/8p5frfp1pdf79i1ka0lyfdfa755wvfas-libpcap-1.10.4' from 'https://cache.nixos.org'...
copying path '/nix/store/bvdpi00bwnhsga3jmw7h8gg5awhs5h75-p11-kit-0.25.3' from 'https://cache.nixos.org'...
copying path '/nix/store/ggw72j3wkx123jgb0sdxl7jk4jyiv9rb-pcsclite-2.1.0-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/v60001b1k0y05z6b1p33p6p4n76pax8p-popt-1.19' from 'https://cache.nixos.org'...
copying path '/nix/store/307k767vw31xjvyzdadl27wqds4cpd45-libmpc-1.3.1' from 'https://cache.nixos.org'...
copying path '/nix/store/lfahiwrjb754r40jsw2420kqksj19ws5-qrencode-4.1.1' from 'https://cache.nixos.org'...
copying path '/nix/store/9gwriddks3qrf5vp6xfgb98rxv06qy1n-readline-8.2p10' from 'https://cache.nixos.org'...
copying path '/nix/store/lsp7hk1ppjv403q8h191p929wycbk0r3-systemd-minimal-libs-255.4' from 'https://cache.nixos.org'...
copying path '/nix/store/jg8vvfj0956s6xmdmg2hwvn6jlipyz64-unbound-1.19.3-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/5cqgjfln0wsqrsf7inqwk9dg0dh9dk75-libpwquality-1.4.5-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/1a4y0rc03bckd5mh4kz11wdlcp31zzdi-tcb-1.2' from 'https://cache.nixos.org'...
copying path '/nix/store/cvb16fqf890lh99nvql3vcg6f2liw4xb-gnupg-2.4.5' from 'https://cache.nixos.org'...
copying path '/nix/store/3dnv665sh0rxiwzn07syi7r1kcn1s317-util-linux-2.39.3-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/ys012ym65rapli9pk6x7356pyc96mm4b-util-linux-minimal-2.39.3-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/2pik1pw6w0dagkgfcmlga03997m3fwg3-util-linux-minimal-2.39.3-login' from 'https://cache.nixos.org'...
copying path '/nix/store/89b3jfhcgv02zlscsipwifsk1yscxk33-jq-1.7.1-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/06s2nxj7qdxzclmwjrv0gnr9z9w8rq9s-iptables-1.8.10' from 'https://cache.nixos.org'...
copying path '/nix/store/0j3yimfjqwv4wh4v3xdqrdsb4sp90yw9-zstd-1.5.6-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/9hgsinpfgyvsd92v0wlvmxv9wnaal68r-gcc-13.2.0' from 'https://cache.nixos.org'...
copying path '/nix/store/ddnli8jf61g96xlmfgfnav5cf041pq95-bash-interactive-5.2p26' from 'https://cache.nixos.org'...
copying path '/nix/store/ni2x5a5x9j72l3s4wc7vs1r27b5hqzxi-shadow-4.14.6' from 'https://cache.nixos.org'...
copying path '/nix/store/pw8asivc7x1fx1hg6xc9456mpxn8pimq-gnutls-3.8.4' from 'https://cache.nixos.org'...
copying path '/nix/store/hrmxzlv4knyhxkza8ijdmf96vb3zjs9d-libfido2-1.14.0' from 'https://cache.nixos.org'...
copying path '/nix/store/4gjl6kkb910nqfly4wxq6n7k33mp52h8-lvm2-2.03.23-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/2vkh4388dshscjx942dqvgsl24hnkkq9-binutils-wrapper-2.41' from 'https://cache.nixos.org'...
copying path '/nix/store/gd6czldzbk9ls8hs7il3vjmzd9az9cqy-e2fsprogs-1.47.0' from 'https://cache.nixos.org'...
copying path '/nix/store/3a5xyr1m20j0nynra9ixrzir6x32yqfr-tpm2-tss-4.0.1' from 'https://cache.nixos.org'...
copying path '/nix/store/pb39d5y2kvhkc4d1i252b6x2sp7k75gy-gptfdisk-1.0.9' from 'https://cache.nixos.org'...
copying path '/nix/store/mqfwb4ply3xdasvh5zy154mhvpcqxk44-util-linux-minimal-2.39.3-mount' from 'https://cache.nixos.org'...
copying path '/nix/store/854dsca032cfnna42mlq33gf5p0hggb5-util-linux-minimal-2.39.3-swap' from 'https://cache.nixos.org'...
copying path '/nix/store/cbgw9mvxl7s93l700xwr71syg1ppbs5l-jq-1.7.1-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/riacgg091nv1cm2lcbgc1bmsakim5hb1-kbd-2.6.4' from 'https://cache.nixos.org'...
copying path '/nix/store/shgp1v6na0md1arxil4r21avyl9a86rv-util-linux-2.39.3-login' from 'https://cache.nixos.org'...
copying path '/nix/store/8pbbv3jx5m7cqplrksryiml0sgjv4q3f-util-linux-2.39.3-mount' from 'https://cache.nixos.org'...
copying path '/nix/store/sp2h5r9f8x6mzfiqywv1ssaj6nhvyqqi-util-linux-2.39.3-swap' from 'https://cache.nixos.org'...
copying path '/nix/store/v1089yp5xkfmdjd92iy5yzndxa3k6pxh-cryptsetup-2.7.1' from 'https://cache.nixos.org'...
copying path '/nix/store/0ny93bgk7ax8wa2qvjkyb4zwyh6dkvb2-parted-3.6' from 'https://cache.nixos.org'...
copying path '/nix/store/axw73qqqg0avz8rwdqzypr3p70smzd31-libmicrohttpd-0.9.77' from 'https://cache.nixos.org'...
copying path '/nix/store/bxabn71ypbij5i62r5cs0h390nxg1fsy-btrfs-progs-6.8.1' from 'https://cache.nixos.org'...
copying path '/nix/store/ppf4k669sbm1kyggr7pbi34ycb62j6gp-systemd-minimal-255.4' from 'https://cache.nixos.org'...
copying path '/nix/store/q5k86f5q7ggzfb4dv9wivi8q4bdvz1r1-cryptsetup-2.7.1-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/7kq9hvrhcy8g1v0jd07nr54279asg9vc-systemd-255.4' from 'https://cache.nixos.org'...
copying path '/nix/store/m1rwzr3vzvlj8a7q9yyx2jpd3mnx41y4-util-linux-2.39.3-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/8mjb3ziimfi3rki71q4s0916xkm4cm5p-gcc-wrapper-13.2.0' from 'https://cache.nixos.org'...
copying path '/nix/store/p82mcqxqmiy9y8d5nbyhmia3w9cr8zzs-make-binary-wrapper-hook' from 'https://cache.nixos.org'...
building '/nix/store/sm8aff0vs5x9www3zp0h1v31fp8sv9p6-disko-format.drv'...
building '/nix/store/8f5phkjkf14j0fzl51pki1xhrfhsscch-disko-format.drv'...
++ mktemp -d
+ disko_devices_dir=/tmp/tmp.yJIusInNkc
+ trap 'rm -rf "$disko_devices_dir"' EXIT
+ mkdir -p /tmp/tmp.yJIusInNkc
+ device=/dev/sda
+ imageSize=2G
+ name=vdb
+ type=disk
+ device=/dev/sda
+ efiGptPartitionFirst=1
+ type=gpt
+ blkid /dev/sda
/dev/sda: PTUUID="a034c9da-5ca3-4d37-9d80-c07140f06aff" PTTYPE="gpt"
+ sgdisk --align-end --new=1:0:+512M --change-name=1:disk-vdb-ESP --typecode=1:EF00 /dev/sda
The operation has completed successfully.
+ partprobe /dev/sda
+ udevadm trigger --subsystem-match=block
+ udevadm settle
+ sgdisk --align-end --new=2:0:-0 --change-name=2:disk-vdb-luks --typecode=2:8300 /dev/sda
The operation has completed successfully.
+ partprobe /dev/sda
+ udevadm trigger --subsystem-match=block
+ udevadm settle
+ device=/dev/disk/by-partlabel/disk-vdb-ESP
+ extraArgs=()
+ declare -a extraArgs
+ format=vfat
+ mountOptions=('defaults')
+ declare -a mountOptions
+ mountpoint=/boot
+ type=filesystem
+ blkid /dev/disk/by-partlabel/disk-vdb-ESP
+ grep -q TYPE=
+ additionalKeyFiles=()
+ declare -a additionalKeyFiles
+ askPassword=1
+ device=/dev/disk/by-partlabel/disk-vdb-luks
+ extraFormatArgs=()
+ declare -a extraFormatArgs
+ extraOpenArgs=()
+ declare -a extraOpenArgs
+ initrdUnlock=1
+ keyFile=
+ name=crypted
+ passwordFile=
+ settings=(['allowDiscards']='1')
+ declare -A settings
+ type=luks
+ blkid /dev/disk/by-partlabel/disk-vdb-luks
+ blkid /dev/disk/by-partlabel/disk-vdb-luks -o export
+ grep -q '^TYPE='
+ device=/dev/mapper/crypted
+ extraArgs=('-f')
+ declare -a extraArgs
+ mountOptions=('defaults')
+ declare -a mountOptions
+ mountpoint=
+ type=btrfs
+ blkid /dev/mapper/crypted -o export
+ grep -q '^TYPE='
+ mkfs.btrfs /dev/mapper/crypted -f
btrfs-progs v6.8.1
See https://btrfs.readthedocs.io for more information.

ERROR: mount check: cannot open /dev/mapper/crypted: No such file or directory
ERROR: cannot check mount status of /dev/mapper/crypted: No such file or directory
+ rm -rf /tmp/tmp.yJIusInNkc


Alex0159 avatar Jul 21 '24 14:07 Alex0159

I'm getting a similar error with the official luks-lvm.nix example.

# nix --experimental-features "nix-command flakes" run github:nix-community/disko/refs/tags/v1.6.1 -- --mode format /tmp/disk-config.nix
these 2 derivations will be built:
  /nix/store/d0myk938hlzyrna5gmhahx6cpz8b6ni0-disko-format.drv
  /nix/store/y9mbfiqycb80n7sdrvlpvnd6v52mqig4-disko-format.drv
building '/nix/store/d0myk938hlzyrna5gmhahx6cpz8b6ni0-disko-format.drv'...
building '/nix/store/y9mbfiqycb80n7sdrvlpvnd6v52mqig4-disko-format.drv'...
++ mktemp -d
+ disko_devices_dir=/tmp/tmp.pDM1lRROjI
+ trap 'rm -rf "$disko_devices_dir"' EXIT
+ mkdir -p /tmp/tmp.pDM1lRROjI
+ device=/dev/sda
+ imageSize=2G
+ name=main
+ type=disk
+ device=/dev/sda
+ efiGptPartitionFirst=1
+ type=gpt
+ blkid /dev/sda
/dev/sda: PTUUID="c1731586-8988-450b-ab9c-4a5420af0b12" PTTYPE="gpt"
+ sgdisk --align-end --new=1:0:+500M --change-name=1:disk-main-ESP --typecode=1:EF00 /dev/sda
The operation has completed successfully.
+ partprobe /dev/sda
+ udevadm trigger --subsystem-match=block
+ udevadm settle
+ sgdisk --align-end --new=2:0:-0 --change-name=2:disk-main-luks --typecode=2:8300 /dev/sda
The operation has completed successfully.
+ partprobe /dev/sda
+ udevadm trigger --subsystem-match=block
+ udevadm settle
+ device=/dev/disk/by-partlabel/disk-main-ESP
+ extraArgs=()
+ declare -a extraArgs
+ format=vfat
+ mountOptions=('defaults')
+ declare -a mountOptions
+ mountpoint=/boot
+ type=filesystem
+ grep -q TYPE=
+ blkid /dev/disk/by-partlabel/disk-main-ESP
+ additionalKeyFiles=()
+ declare -a additionalKeyFiles
+ askPassword=
+ device=/dev/disk/by-partlabel/disk-main-luks
+ extraFormatArgs=()
+ declare -a extraFormatArgs
+ extraOpenArgs=()
+ declare -a extraOpenArgs
+ initrdUnlock=1
+ keyFile=
+ name=crypted
+ passwordFile=
+ settings=(['keyFile']='/tmp/secret.key')
+ declare -A settings
+ type=luks
+ blkid /dev/disk/by-partlabel/disk-main-luks
+ blkid /dev/disk/by-partlabel/disk-main-luks -o export
+ grep -q '^TYPE='
+ device=/dev/mapper/crypted
+ type=lvm_pv
+ vg=pool
+ blkid /dev/mapper/crypted
+ grep -q TYPE=
+ pvcreate /dev/mapper/crypted
File descriptor 3 (mnt:[4026531841]) leaked on pvcreate invocation. Parent PID 2090: /nix/store/h3bhzvz9ipglcybbcvkx
File descriptor 4 (/) leaked on pvcreate invocation. Parent PID 2090: /nix/store/h3bhzvz9ipglcybbcvkx
  No device found for /dev/mapper/crypted.
+ rm -rf /tmp/tmp.pDM1lRROjI

solomon-b avatar Aug 16 '24 21:08 solomon-b

But blkid /dev/mapper/crypted itself works afterwards?

Mic92 avatar Aug 17 '24 04:08 Mic92

But blkid /dev/mapper/crypted itself works afterwards?

Using the Luks-LVM example I get:

# blkid /dev/mapper/crypted

solomon-b avatar Aug 18 '24 23:08 solomon-b

In the error that I have, for some reason the password request does not occur. I tried removing the "not" from the condition "if" and it worked:

if blkid "${config.device}" >/dev/null || ! (blkid "${config.device}" -o export | grep -q '^TYPE=');
or
if ! blkid "${config.device}" >/dev/null || (blkid "${config.device}" -o export | grep -q '^TYPE=');

It's here https://github.com/nix-community/disko/blob/51994df8ba24d5db5459ccf17b6494643301ad28/lib/types/luks.nix#L115

I tested it on VM. My "${config.device}" = /dev/disk/by-partlabel/disk-vdb-luks My output:

blkid /dev/disk/by-partlabel/disk-vdb-luks -o export

DEVNAME=/dev/disk/by-partlabel/disk-vdb-luks
UUID=4067280e-b73e-4383-87f3-140230f2f553
TYPE=crypto_LUKS
PARTLABEL=disk-vdb-luks
PARTUUID=e18d4c7a-8552-41e8-98e5-ca0b7be1bc97

Alex0159 avatar Sep 22 '24 12:09 Alex0159

upd. One more condition can be added: || [ $askPassword == 1 ] like this if ! blkid "${config.device}" >/dev/null || ! (blkid "${config.device}" -o export | grep -q '^TYPE=') || [ $askPassword == 1 ]; then

Alex0159 avatar Sep 22 '24 12:09 Alex0159

For posterity: Using nixos-anywhere, I've observed that running the command twice fixes the problem consistently (n=4) , potentially because the format mode isn't run again, and that despite the initial error, the configuration creates a valid usable filesystem.

felixdorn avatar Oct 05 '24 00:10 felixdorn