!DBFhtjpqmJNENpLDOv:nixos.org

NixOS systemd

607 Members
NixOS ❤️ systemd172 Servers

Load older messages


SenderMessageTime
31 Jan 2025
@nakibrayane:matrix.orgRayane Nakib (ريّان نقيب)
In reply to @elvishjerricco:matrix.org
Yea, there's a btrfs subvolume delete command
This command doesn't work
14:32:37
@nakibrayane:matrix.orgRayane Nakib (ريّان نقيب) even with --commit-after option 14:33:11
@elvishjerricco:matrix.orgElvishJerriccowhy not?14:33:21
@elvishjerricco:matrix.orgElvishJerricco the command is there for a reason; presumably it's capable of working 14:33:37
@nakibrayane:matrix.orgRayane Nakib (ريّان نقيب)I don't know?! I am not on my PC right now, But I will post the error message that I get when I get the chant14:34:22
@nakibrayane:matrix.orgRayane Nakib (ريّان نقيب) * 14:34:39
@nakibrayane:matrix.orgRayane Nakib (ريّان نقيب) * 14:34:51
@nakibrayane:matrix.orgRayane Nakib (ريّان نقيب) * 14:35:10
@qyliss:fairydust.spaceAlyssa Rosswfm14:36:08
@qyliss:fairydust.spaceAlyssa RossI do a very similar thing in initrd, although I'm still on the non-systemd one I think14:36:28
@elvishjerricco:matrix.orgElvishJerriccosidenote, the impermanence readme really ought to include a solid systemd initrd example.14:36:32
@qyliss:fairydust.spaceAlyssa Rosshttps://git.qyliss.net/nixlib/tree/sys/mbp.nix#n1814:37:27
@nakibrayane:matrix.orgRayane Nakib (ريّان نقيب)
In reply to @elvishjerricco:matrix.org
sidenote, the impermanence readme really ought to include a solid systemd initrd example.
And an option to just delete the old root, or keep only one version, I have limited space im my laptop, I can't have 30 days old files there.
14:37:42
@qyliss:fairydust.spaceAlyssa RossBeing able to remove a directory without being able to recurse is to me the main appeal of subvolems14:38:23
@qyliss:fairydust.spaceAlyssa Ross * 14:38:28
@nakibrayane:matrix.orgRayane Nakib (ريّان نقيب)
In reply to @qyliss:fairydust.space
Being able to remove a directory without being able to recurse is to me the main appeal of subvolumes
I couldn't make it work.
14:38:59
@elvishjerricco:matrix.orgElvishJerricco (sidenote, update that to postResumeCommands rather than postDeviceCommands, if you care at all about not having horrible breakage if you use hibernation) 14:39:08
@qyliss:fairydust.spaceAlyssa RossI don't use hybernation, but that sounds like a good change to make regardless, thank you.14:40:39
@qyliss:fairydust.spaceAlyssa Ross
In reply to @nakibrayane:matrix.org
I couldn't make it work.
You don't have nested subvolumes in there, do you?
14:41:01
@qyliss:fairydust.spaceAlyssa Rosssystemd will make some14:41:04
@qyliss:fairydust.spaceAlyssa Rosslike /var/lib/machines and /var/lib/portables14:41:15
@elvishjerricco:matrix.orgElvishJerriccowait systemd just implicitly creates subvolumes?14:41:32
@qyliss:fairydust.spaceAlyssa RossIt comes with default tmpfiles.d rules that do14:41:41
@elvishjerricco:matrix.orgElvishJerriccohuh14:41:46
@elvishjerricco:matrix.orgElvishJerriccoodd14:41:48
@qyliss:fairydust.spaceAlyssa Rossit's very annoying because things will then fail if those paths are symlinks14:42:07
@qyliss:fairydust.spaceAlyssa Rossso they need to be bind mounts instead14:42:22
@nakibrayane:matrix.orgRayane Nakib (ريّان نقيب)
  boot.initrd.systemd.services.rollback = {
    description = "Rollback BTRFS root subvolume to a pristine state";
    wantedBy = [ "initrd.target" ];
    after = [ "systemd-cryptsetup@crypted.service" ];
    before = [ "sysroot.mount" ];
    unitConfig.DefaultDependencies = "no";
    serviceConfig.Type = "oneshot";
    script = # bash
      ''
        mkdir /btrfs_tmp
        mount /dev/mapper/crypted /btrfs_tmp

        if [[ -e /btrfs_tmp/root ]]; then
          btrfs subvolume delete /btrfs_tmp/root
        fi

        btrfs subvolume create /btrfs_tmp/root
        umount /btrfs_tmp
      '';
  };

$ journalctl -b -u rollback
جانفي 31 15:59:07 HP-14s-dq2024nf systemd[1]: Starting Rollback BTRFS root subvolume to a pristine state...
جانفي 31 15:59:07 HP-14s-dq2024nf rollback-start[530]: ERROR: Could not destroy subvolume/snapshot: Directory not empty
جانفي 31 15:59:07 HP-14s-dq2024nf rollback-start[530]: Delete subvolume 324 (no-commit): '/btrfs_tmp/root'
جانفي 31 15:59:07 HP-14s-dq2024nf systemd[1]: rollback.service: Main process exited, code=exited, status=1/FAILURE
جانفي 31 15:59:07 HP-14s-dq2024nf systemd[1]: rollback.service: Failed with result 'exit-code'.
جانفي 31 15:59:07 HP-14s-dq2024nf systemd[1]: Failed to start Rollback BTRFS root subvolume to a pristine state.
15:00:41
@nakibrayane:matrix.orgRayane Nakib (ريّان نقيب) *
  boot.initrd.systemd.services.rollback = {
    description = "Rollback BTRFS root subvolume to a pristine state";
    wantedBy = [ "initrd.target" ];
    after = [ "systemd-cryptsetup@crypted.service" ];
    before = [ "sysroot.mount" ];
    unitConfig.DefaultDependencies = "no";
    serviceConfig.Type = "oneshot";
    script = # bash
      ''
        mkdir /btrfs_tmp
        mount /dev/mapper/crypted /btrfs_tmp

        if [[ -e /btrfs_tmp/root ]]; then
          btrfs subvolume delete /btrfs_tmp/root
        fi

        btrfs subvolume create /btrfs_tmp/root
        umount /btrfs_tmp
      '';
  };
$ journalctl -b -u rollback
جانفي 31 15:59:07 HP-14s-dq2024nf systemd[1]: Starting Rollback BTRFS root subvolume to a pristine state...
جانفي 31 15:59:07 HP-14s-dq2024nf rollback-start[530]: ERROR: Could not destroy subvolume/snapshot: Directory not empty
جانفي 31 15:59:07 HP-14s-dq2024nf rollback-start[530]: Delete subvolume 324 (no-commit): '/btrfs_tmp/root'
جانفي 31 15:59:07 HP-14s-dq2024nf systemd[1]: rollback.service: Main process exited, code=exited, status=1/FAILURE
جانفي 31 15:59:07 HP-14s-dq2024nf systemd[1]: rollback.service: Failed with result 'exit-code'.
جانفي 31 15:59:07 HP-14s-dq2024nf systemd[1]: Failed to start Rollback BTRFS root subvolume to a pristine state.
15:01:11
@elvishjerricco:matrix.orgElvishJerriccoyea, it seems like you've got subvolumes within that subvolume15:49:54

Show newer messages


Back to Room ListRoom Version: 6