Giter VIP home page Giter VIP logo

Comments (7)

dryya avatar dryya commented on May 23, 2024 2

I just tested again with the same config, and couldn't reproduce the issue. I was doing it from an installed nixos though, not a live USB, which makes me wonder if that was the issue, maybe if something could have been pointing to a path on the USB's store?

I will try to test again from a USB later and report back!

from disko.

Mic92 avatar Mic92 commented on May 23, 2024

@lilyinstarlight any idea?

from disko.

Mic92 avatar Mic92 commented on May 23, 2024

Can you provide the difference in /etc/fstab? nixos-rebuild build will produce a result/ link and cat result/etc/fstab contains the mount configuration.

from disko.

lilyinstarlight avatar lilyinstarlight commented on May 23, 2024

@lilyinstarlight any idea?

Nope, I've no idea. Evaluating that disko.nix locally in a minimal config gives mostly the same fileSystems config so I don't know how one would be working but not the other

The only differences in the evaluated config really are the inclusion of the @snapshot subvolume in the disko-based config, the subvol= options being like subvol=/@ in the disko-based config instead of subvol=@, and the use of /dev/sdaN in the disko-based config instead of using by-uuid

None of those differences should matter afaik. In case anyone else notices something I don't, here's the evaluated config JSON from using the snippets provided:

config.fileSystems
{
  "/": {
    "autoFormat": false,
    "autoResize": false,
    "depends": [],
    "device": "/dev/mapper/nixos",
    "encrypted": {
      "blkDev": null,
      "enable": false,
      "keyFile": null,
      "label": null
    },
    "formatOptions": "",
    "fsType": "btrfs",
    "label": null,
    "mountPoint": "/",
    "neededForBoot": false,
    "noCheck": false,
    "options": [
      "compress=zstd",
      "noatime",
      "subvol=/@"
    ]
  },
  "/boot": {
    "autoFormat": false,
    "autoResize": false,
    "depends": [],
    "device": "/dev/sda1",
    "encrypted": {
      "blkDev": null,
      "enable": false,
      "keyFile": null,
      "label": null
    },
    "formatOptions": "",
    "fsType": "vfat",
    "label": null,
    "mountPoint": "/boot",
    "neededForBoot": false,
    "noCheck": false,
    "options": [
      "defaults"
    ]
  },
  "/home": {
    "autoFormat": false,
    "autoResize": false,
    "depends": [],
    "device": "/dev/mapper/nixos",
    "encrypted": {
      "blkDev": null,
      "enable": false,
      "keyFile": null,
      "label": null
    },
    "formatOptions": "",
    "fsType": "btrfs",
    "label": null,
    "mountPoint": "/home",
    "neededForBoot": false,
    "noCheck": false,
    "options": [
      "compress=zstd",
      "noatime",
      "subvol=/@home"
    ]
  },
  "/nix": {
    "autoFormat": false,
    "autoResize": false,
    "depends": [],
    "device": "/dev/mapper/nixos",
    "encrypted": {
      "blkDev": null,
      "enable": false,
      "keyFile": null,
      "label": null
    },
    "formatOptions": "",
    "fsType": "btrfs",
    "label": null,
    "mountPoint": "/nix",
    "neededForBoot": false,
    "noCheck": false,
    "options": [
      "compress=zstd",
      "noatime",
      "subvol=/@nix"
    ]
  },
  "/snapshots": {
    "autoFormat": false,
    "autoResize": false,
    "depends": [],
    "device": "/dev/mapper/nixos",
    "encrypted": {
      "blkDev": null,
      "enable": false,
      "keyFile": null,
      "label": null
    },
    "formatOptions": "",
    "fsType": "btrfs",
    "label": null,
    "mountPoint": "/snapshots",
    "neededForBoot": false,
    "noCheck": false,
    "options": [
      "compress=zstd",
      "noatime",
      "subvol=/@snapshots"
    ]
  },
  "/swap": {
    "autoFormat": false,
    "autoResize": false,
    "depends": [],
    "device": "/dev/mapper/nixos",
    "encrypted": {
      "blkDev": null,
      "enable": false,
      "keyFile": null,
      "label": null
    },
    "formatOptions": "",
    "fsType": "btrfs",
    "label": null,
    "mountPoint": "/swap",
    "neededForBoot": false,
    "noCheck": false,
    "options": [
      "defaults",
      "subvol=/@swap"
    ]
  }
}
config.boot.initrd.luks.devices
{
  "nixos": {
    "allowDiscards": false,
    "bypassWorkqueues": false,
    "crypttabExtraOpts": [],
    "device": "/dev/sda2",
    "fallbackToPassword": false,
    "fido2": {
      "credential": null,
      "credentials": [],
      "gracePeriod": 10,
      "passwordLess": false
    },
    "gpgCard": null,
    "header": null,
    "keyFile": null,
    "keyFileOffset": null,
    "keyFileSize": null,
    "name": "nixos",
    "postOpenCommands": "",
    "preLVM": true,
    "preOpenCommands": "",
    "yubikey": null
  }
}

from disko.

ghostbuster91 avatar ghostbuster91 commented on May 23, 2024

I have just tested it and it works fine after updating the configuration to the latest disko release and setting grub.enabledCryptodisk to true.

Although, the btrfs swap subvolume isn't mounted automatically as swap space. After some reading it seems that one should use that subvolume to keep there the swap file. However, it is not clear to me how to make that swapfile mounted on boot, since the etc/fstab configuration is managed by the disko module.

from disko.

Lassulus avatar Lassulus commented on May 23, 2024

I just set this in my configuration:

  swapDevices = [{
    device = "/swapfile";
  }];

after creating the swapfile with btrfs filesystem mkswapfile -s 50g /swapfile not sure if we want declarative swapfile creating in disko? probably yes, but not sure how the interface should look like

from disko.

dryya avatar dryya commented on May 23, 2024

Sorry I didn't report back on this issue for a while - I can confirm what ghostbuster said, which is that the issue seems to have been solved in the meantime, although I'm not quite sure what fixed it. And regarding the swapfile, I did exactly the same thing. Feel free to close!

from disko.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.