nix-community / disko

Declarative disk partitioning and formatting using nix [maintainers=@Lassulus @Enzime]
MIT License
1.65k stars 181 forks source link

neededForBoot flag #192

Open jsimonetti opened 1 year ago

jsimonetti commented 1 year ago

Hi,

Is there a way to make a fileSystem marked neededForBoot? Right now I am having some issues because a filesystem is not mounted soon enough.

lilyinstarlight commented 1 year ago

I currently set the nixos options for it just fine, since disko doesn't really need it for formatting or mounting

See my config:

https://github.com/lilyinstarlight/foosteros/blob/9dc10cbc68b56c02cd10642061a14b7fddf8adb5/hosts/bina/disks.nix#L117-L118

jnsgruk commented 1 year ago

I'm interested in this too, for a slightly different reason.

I have a setup where I have a root disk that is just plain btrfs on a smaller SSD. I then have a data drive that is larger, and LUKS encrypted.

Because Disko automatically adds an initrd.luks.devices entry, I'm prompted for a passphrase on every boot. In reality, I don't need that drive to be unlocked at the initrd phase, and normally just have an /etc/crypttab file that specifies a key file. I'd like to be able to specify an encrypted drive that doesn't end up requiring unlocking during the initrd part of the boot.

Hopefully that makes sense? The inclusion of a neededForBoot = false type option could change the behaviour here to not modify the initrd config?

yangm97 commented 1 year ago

Can't use @lilyinstarlight's strategy for zfs "native" mounts, gotta use a "legacy" mount instead.

jpds commented 3 months ago

@yangm97 If you want to use ZFS native mounts, simply set: boot.initrd.systemd.enable = true.