| 10 Dec 2024 |
BeatLink | like --ignore-device=/dev/sda | 19:55:39 |
BeatLink | and that could be repeated numerous times | 19:55:49 |
| 11 Dec 2024 |
| kagehisa joined the room. | 10:06:32 |
| marijan changed their profile picture. | 14:20:18 |
| SkamDart joined the room. | 21:03:43 |
SkamDart | 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 | 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 | 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 | * 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 | Friendly recommendation, don't use swap files | 01:47:09 |
netpleb | swap files specifically? or swap in general? I do not know enough about either really to have an opinion. | 04:07:06 |
BeatLink | Swap on CoW filesystems like BTRFS and ZFS is a bad idea | 04:07:47 |
BeatLink | swap is a write heavy requirement and CoW amplifies writes | 04:08:03 |
BeatLink | it will thrash your storage devices, especially if its SSDs | 04:08:13 |
BeatLink | if you must use swap, create a dedicated partition for it | 04:08:39 |
netpleb | I 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 |
BeatLink | Im not sure but that output you posted does show that the kernel have some safeguards to prevent mixing swap and CoW | 04:10:49 |
BeatLink | The 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 filesystem | 04:12:51 |
BeatLink | that way when the root filesystem is decrypted, a keyfile is available to decrypt swap | 04:13:02 |
BeatLink | or do what I do and go without swap which is possible on modern hardware | 04:13:26 |
BeatLink | or even zram | 04:13:44 |
BeatLink | the only downside with the two options is no hibernation | 04:14:04 |
netpleb | 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 |
BeatLink | sounds good | 04:14:31 |
kagehisa | 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 | 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 | Is it possible by any chance to give a postCreateHook access to this "transformed" keyfile path? | 08:19:19 |
BeatLink | is this in disko or in nixos generally? | 10:58:44 |
BeatLink | oh right disko | 10:58:55 |
kagehisa | disko and in my case disko via nixos-anywhere | 11:31:04 |