NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.16k stars 14.19k forks source link

IO Error (open failed path://.snapshots errno:2 (No such file or directory)). #213989

Open Freed-Wu opened 1 year ago

Freed-Wu commented 1 year ago

Describe the bug

snapper cannot automatically create the .snapshots

Steps To Reproduce

Steps to reproduce the behavior:

  services.snapper.configs = {
    root = {
      subvolume = "/";
      extraConfig = ''
        ALLOW_GROUPS="wheel"
        TIMELINE_CREATE=yes
        TIMELINE_CLEANUP=yes
      '';
    };
  };
$ snapper create
IO Error (open failed path://.snapshots errno:2 (No such file or directory)).

Expected behavior

Not IO Error

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Related PR: https://github.com/NixOS/nixpkgs/pull/78046

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.7, NixOS, 23.05 (Stoat), 23.05pre447289.9b97ad7b433`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.12.0`
 - channels(wzy): `"nixos, nixpkgs"`
 - channels(root): `"nixos, nixpkgs"`
 - nixpkgs: `/home/wzy/.nix-defexpr/channels/nixpkgs`
Freed-Wu commented 1 year ago

Notify maintainers

Last modifier: @markuskowa

sj14 commented 9 months ago

For anyone else finding this, the workaround is to create a subvolume of the given path manually:

sudo btrfs subvolume create /<PATH>/.snapshots