| 10 May 2026 |
sudoforge | or do you simply mean that instead of deleting the root subvol on boot (like i do currently), you create another snapshot of it | 16:50:58 |
Albert Larsan | I have this version (https://git.sr.ht/~albertlarsan68/dotfiles/tree/main/item/nixos/scripts/root-reset.sh) that snapshots the root before rolling it back (with a failed attempt at preserving nested subvolumes). It runs after hibernation resume and before mounting sysroot. .The modern version (for the new machines) is at https://git.sr.ht/~albertlarsan68/dotfiles/tree/flake-parts/item/nixos-modules/impermanence/rollback.sh and literrally mvs the /root submodule to a dated folder, then deletes old versions. | 16:52:53 |
Albert Larsan | The modern version does properly save nested submodules | 16:53:46 |
sudoforge | got it | 16:55:18 |
sudoforge | i don't care about preserving the root subvol. that's the whole point of impermanence, after all :) | 16:55:42 |
sudoforge | btrfs subvolume delete /mnt/root
btrfs subvolume snapshot /mnt/root-blank /mnt/root
this snippet is from the systemd unit that runs in initrd before sysroot, and just unconditionally deletes the subvol and restores it from the blank snapshot (this is taken at disk formatting time; the above disko config handles this with a postCreateHook)
| 16:58:38 |
Albert Larsan | Saving the old snapshot saved me more than once, when my computer crashed, I could mount the old snapshot and recover some files that way. | 17:07:27 |
Albert Larsan | That is why I only keep the latest boot on old version and the last 1 day of boots for the modern version. | 17:09:33 |
sudoforge | makes sense | 17:11:03 |
trumee | sudoforge: how do you specify the swapfile for resume? | 17:29:05 |
sudoforge | https://search.nixos.org/options?channel=unstable&query=resumeDevice#show=option%253Aboot.resumeDevice | 17:30:20 |
sudoforge | see also:
- https://search.nixos.org/options?channel=unstable&query=postResume#show=option%253Aboot.initrd.postResumeCommands
- https://search.nixos.org/options?channel=unstable&query=postDevice#show=option%253Aboot.initrd.postDeviceCommands
| 17:32:42 |
trumee | For a file offset is needed it seems. | 17:39:13 |
sudoforge | yes | 17:42:54 |
Albert Larsan | Also why I don’t bother with swapfiles, only a swap partition | 17:43:49 |
Albert Larsan | Don’t have to find the offset (and make sure btrfs doesn’t break the file) | 17:44:14 |
sudoforge | for sure, a swap partition is simpler | 17:44:18 |
sudoforge | trumee since you seem newer to all of this i'm going to recommend that you use a swap partition | 17:44:39 |
sudoforge | make it a little bigger than the RAM you have on the machine (or the RAM you plan to have on the machine) | 17:50:56 |
sudoforge | i guess, this is where the lvm-under-luks-before-your-fs comes into play | 17:51:13 |
Albert Larsan | You can only have a single hibernation swap, so add your ram and all other swap (including zram if you use that), add a little overhead, and you end up with 64GB of swap for 24 GB of RAM :) | 17:53:07 |
sudoforge | i have 64GiB of RAM (i bought it before the rampocalypse, don't hurt me) and haven't ran into issues with 72GiB | 17:55:19 |
sudoforge | but yeah | 17:55:20 |
Albert Larsan | Good for you, I really want to steal a 16G stick from another one of my laptops. | 17:56:31 |
Albert Larsan | I only need like 16 on it (for The Sims 3) | 17:56:57 |
sudoforge | i do have 2x16GB SODIMM i have been puzzled about what i'd use it for | 17:58:56 |
sudoforge | so, i mean | 17:59:13 |
sudoforge | i'd sell it if you need it. at a reasonable price (1 or two bitcoins) | 17:59:33 |
sudoforge | * i'd sell it if you need it. at a reasonable price (1 or 2 bitcoins) | 17:59:40 |
Albert Larsan | DDR5 5600? | 18:00:46 |