Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NixOS: trash put/restore doesn't work on mounted volumes #117

Open
starlightsys opened this issue Apr 27, 2024 · 1 comment
Open

NixOS: trash put/restore doesn't work on mounted volumes #117

starlightsys opened this issue Apr 27, 2024 · 1 comment

Comments

@starlightsys
Copy link

Trying to use trash put and trash restore on a mounted volume (mounted on for example /run/media/username/volumename/) seemingly tries to access /run/.Trash-1000 and fails. trash list however works as expected.

Setup

NixOS 24.05.20240323.44d0940 (Uakari) x86_64
nix-channel --list:

Username: username
Mounted BtrFS volume named volumename

Put file in trash

Steps to reproduce

  1. Have an empty trash bin
  2. Navigate to the root directory of a mounted volume under /run such as /run/media/username/volumename/
  3. nix-shell -p trashy
  4. trash list
  5. touch test
  6. trash put test
  7. trash list

Observed

The file test is still present in the directory, and the trash bin is empty. trash list shows no files before or after.

trash put test gives this error:
error: Error during a `trash` operation: Unknown { description: "Path: '\"/run/.Trash-1000\"'. Message: Permission denied (os error 13)" }

Expected

The file test is removed from the directory and is then listed with trash list.

Counterexample

  1. Have an empty trash bin
  2. Navigate to ~/
  3. nix-shell -p trashy
  4. trash list
  5. touch test
  6. trash put test
  7. trash list

Observed

The file test is removed from the directory and is then listed with trash list.

Restore file from trash

Steps to reproduce

  1. Have an empty trash bin
  2. Navigate to the root directory of a mounted volume under /run such as /run/media/username/volumename/
  3. touch test
  4. Use a file explorer to put test into the trash
  5. Confirm that test shows up in the trash bin
  6. nix-shell -p trashy
  7. trash list
  8. trash restore test
  9. Type y and Enter
  10. trash list

Observed

Both before and after trash restore, the file test shows up under the path /run/, missing the media/username/volumename/ path components. The file remains in the trash bin and does not exist in the current working directory.

trash restore test gives this error:
error: Error during a `trash` operation: Unknown { description: "Path: '\"/run/test\"'. Message: Permission denied (os error 13)" }

Expected

The file test is listed with trash list, then is restored to the current working directory and is no longer listed with trash list. The trash bin is empty.

Counterexample

  1. Have an empty trash bin
  2. Navigate to ~/
  3. touch test
  4. Use a file explorer to put test into the trash
  5. Confirm that test shows up in the trash bin
  6. nix-shell -p trashy
  7. trash list
  8. trash restore test
  9. Type y and Enter
  10. trash list

Observed

The file test is listed with trash list, then is restored to the current working directory and is no longer listed with trash list. The trash bin is empty.

@scarf005
Copy link

scarf005 commented Oct 1, 2024

having the same issue on fedora kinoite 40.

trash ~/.cache/deno/
error: Error during a `trash` operation: Unknown { description: "Path: '\"/var/.Trash-1000\"'. Message: Permission denied (os error 13)" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants