ponkila / homestaking-infra

Ethereum home-staking infrastructure powered by Nix
MIT License
7 stars 2 forks source link

general: database snapshots #1

Open jhvst opened 1 year ago

jhvst commented 1 year ago

To avoid database corruptions on package updates, the mount points should be snapshotted before upgrade. This implies CoW filesystems such as btrfs, zfs, or bcachefs. We should probably stick to btrfs.

An example of a systemd process that runs before kexec:

      systemd.services.unmodeset = {
        enable = true;

        after = [ "umount.target" ];
        before = [ "kexec.target" ];

        serviceConfig = {
          Type = "oneshot";
          ExecStart = ''
            /run/current-system/sw/bin/modprobe -r amdgpu nvidia_drm nouveau
          '';
        };

        wantedBy = [ "kexec.target" ];
      };

Most likely, in our case we want to schedule before umount, and before kexec.

jhvst commented 9 months ago

A better idea would be to support LVM based snapshots, especially given that btrfs has performance problems.