!oNSIfazDqEcwhcOjSL:matrix.org

disko

365 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko94 Servers

Load older messages


SenderMessageTime
10 Dec 2024
@beat_link:matrix.orgBeatLinklike --ignore-device=/dev/sda19:55:39
@beat_link:matrix.orgBeatLinkand that could be repeated numerous times19:55:49
11 Dec 2024
@kagehisa:matrix.orgkagehisa joined the room.10:06:32
@marijan:matrix.orgmarijan changed their profile picture.14:20:18
@skamdart:matrix.orgSkamDart joined the room.21:03:43
@skamdart:matrix.orgSkamDart

Running this https://gist.github.com/SkamDart/30af3d3e4d93ee2dbd732ff3645bb29e config and getting the following error

/nix/store/32ycfg2axcjxdii9irj0fddbcb2xlr9z-disko-format-mount/bin/disko-format-mount: line 6
3: mkfs.fat32: command not found

nothing came up in my nix-locate search and mkfs.fat32 isn't provided by dosfstools or e2fsprogs.

does it make more sense to write a custom _create attribute that calls out to mkfs.fat -F 32 or am I missing the obvious way to do this?

21:13:36
@netpleb:matrix.orgnetpleb

in my disks.nix I have a btrfs setup like the example https://github.com/nix-community/disko/blob/master/example/luks-btrfs-subvolumes.nix but only recently noticed when trying to nixos-rebuild switch that I get this error:

Dec 11 15:26:26 aleph0 systemd[1]: Activating swap /.swapvol/swapfile...
Dec 11 15:26:26 aleph0 kernel: BTRFS warning (device dm-2): swapfile must not be copy-on-write
Dec 11 15:26:26 aleph0 swapon[367622]: swapon: /.swapvol/swapfile: swapon failed: Invalid argument
Dec 11 15:26:26 aleph0 systemd[1]: \x2eswapvol-swapfile.swap: Swap process exited, code=exited, status=255/EXCEPTION
Dec 11 15:26:26 aleph0 systemd[1]: \x2eswapvol-swapfile.swap: Failed with result 'exit-code'.

Does disko need to set some mount option differently for the swap subvolume?

23:46:16
12 Dec 2024
@netpleb:matrix.orgnetpleb I found the issue. At the bottom of this answer it says: "Swap file can't be located on a btrfs raid of any sort." 00:04:11
@netpleb:matrix.orgnetpleb * I found the issue. At the bottom of this answer it says: "Swap file can't be located on a btrfs raid of any sort." But alas I recently transitioned mine to a raid setup. Will now move swap over to a non-raid partition and hopefully it will solve the issue. 00:04:55
@magic_rb:matrix.redalder.orgmagic_rbFriendly recommendation, don't use swap files01:47:09
@netpleb:matrix.orgnetpleb swap files specifically? or swap in general? I do not know enough about either really to have an opinion. 04:07:06
@beat_link:matrix.orgBeatLink Swap on CoW filesystems like BTRFS and ZFS is a bad idea 04:07:47
@beat_link:matrix.orgBeatLinkswap is a write heavy requirement and CoW amplifies writes04:08:03
@beat_link:matrix.orgBeatLinkit will thrash your storage devices, especially if its SSDs 04:08:13
@beat_link:matrix.orgBeatLinkif you must use swap, create a dedicated partition for it04:08:39
@netpleb:matrix.orgnetplebI see, thanks. I had read some of the btrfs docs and it seems like it is aware of files which are used for swap and alters behavior accordingly (disabling CoW and such), but maybe that is more in theory than in practice?04:10:13
@beat_link:matrix.orgBeatLinkIm not sure but that output you posted does show that the kernel have some safeguards to prevent mixing swap and CoW04:10:49
@beat_link:matrix.orgBeatLinkThe best way to solve it is to create a new luks partition on the end of your disk, set its content to be a swap partition and then set the luks keyfile to a location on the root filesystem04:12:51
@beat_link:matrix.orgBeatLinkthat way when the root filesystem is decrypted, a keyfile is available to decrypt swap04:13:02
@beat_link:matrix.orgBeatLinkor do what I do and go without swap which is possible on modern hardware04:13:26
@beat_link:matrix.orgBeatLinkor even zram04:13:44
@beat_link:matrix.orgBeatLinkthe only downside with the two options is no hibernation04:14:04
@netpleb:matrix.orgnetpleb Thanks, yes that is what I will do in future deployments. I am not sure how often my swap on this btrfs system is even used right now so I will probably not worry about repartitioning this deployment. 04:14:19
@beat_link:matrix.orgBeatLinksounds good04:14:31
@kagehisa:matrix.orgkagehisa Hi, I'm having a bit of an unusual question in regards to the LUKS option passowrdFile. Is it somehow possible to let the passworFile be used by a postCreateHook?
In my special case it would be to call systemd-cryptenroll --unlock-key-file=<path to file> ....
08:12:17
@kagehisa:matrix.orgkagehisa I have tried using the keyfile path directly in the hook but as far as I understand this doesn't work. Especially when I look at the ouptut of nixos-anywhere it seems the passwordFile is read in and then distributed by an internal mechanism (haven't found the code bits for that) to something like this: --key-file /dev/fd/63 08:17:53
@kagehisa:matrix.orgkagehisa Is it possible by any chance to give a postCreateHook access to this "transformed" keyfile path? 08:19:19
@beat_link:matrix.orgBeatLink is this in disko or in nixos generally? 10:58:44
@beat_link:matrix.orgBeatLinkoh right disko10:58:55
@kagehisa:matrix.orgkagehisadisko and in my case disko via nixos-anywhere11:31:04

Show newer messages


Back to Room ListRoom Version: 10