LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-04-2021, 09:02 PM   #1
jasonc3a
LQ Newbie
 
Registered: Oct 2018
Distribution: Debian, Fedora, Raspbian, LMDE, Bhodi, Ubuntu
Posts: 25

Rep: Reputation: Disabled
Creating a Trash Directory for Linux on a TrueNAS NFS Share Drive


I have a vdev running on my TrueNAS system, set up as an NFS share. When I connect to it on a Linux machine and attempt to send a file to trash, I get the warning
Quote:
Unable to find or create trash directory for media/{user}/{mountpoint}
I attempted to create a trash bin for the uid and gid I’m connecting as on my Linux machine (1000) by going to the highest possible folder in the heirarchy of the mountpoint and trying:
Code:
$ sudo mkdir .-p /.Trash-1000/{expunged,files,info}
and attempted to delete a test file, but I got the same warning.
Looking at how the share was configured in Sharing/NFS/Edit on TrueNAS, I saw that “Mapall User” was set to “nobody,” as was “Mapall Group.” My understand is that “Mapall *” sets whatever user accessing the shared drive as that specified user and group. Looking under Accounts/Users and Accounts/Groups, the UID and GID of “nobody” are both 65534. I tried
Code:
$ sudo mkdir .-p /.Trash-65534/{expunged,files,info}
Nothing changed, so I thought that it might have to do with the permissions so I tried
Code:
$ sudo chmod -R 770 ./.Trash-65534/
I did this for both iterations of the .Trash-* directory, and this didn’t change the message either. Is there something that I’m missing about setting up a trash directory? It seems like it should be simple, but I can’t figure it out.
 
Old 03-05-2021, 12:56 AM   #2
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,818
Blog Entries: 1

Rep: Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068
Have you considered deleting files instead of trashing them? Trashing reclaims no disk space. It merely moves files out of the location formerly occupied.
 
1 members found this post helpful.
Old 03-05-2021, 08:47 AM   #3
jasonc3a
LQ Newbie
 
Registered: Oct 2018
Distribution: Debian, Fedora, Raspbian, LMDE, Bhodi, Ubuntu
Posts: 25

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by mrmazda View Post
Have you considered deleting files instead of trashing them? Trashing reclaims no disk space. It merely moves files out of the location formerly occupied.
That's what I'm doing now, but I prefer to have an extra step when getting rid of files. A keyboard in a house with cats means it's only a matter of time until something bad happens.
I'm also used to organizing by consolidating informative fun several smaller files into larger ones when working on D&D stuff and similar things. I like to be able to double check I haven't made an error before wiping it all out but looking in the trashbin. To do that now i have to make a folder and cut and paste everything into it before deleting it. It's the same as a trashbin but more annoying.
finally, it just seems like a thing that should work. I'd classify this while going as a problem, and if I can't solve a problem I'd at least like to understand why it can't be solved. I'm sure there's something to be learned that I could apply later on, but I'm just at a loss on where to go.
 
Old 03-05-2021, 08:05 PM   #4
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Just a bit of info that may or may not be part of your issue.

If you are managing files from the command line the trash folder never gets used unless you are using a script to remove files that relocates them to the trash folder.

If you are using the file manager, such as nautilus, the location where the trash folder is normally created must be writable by the user or the trash folder cannot be created and files cannot be stored there.

From what you have said, I suspect this is a permissions issue and your user cannot write to the trash.

I have seen this when I first use a USB drive in that even though it gets mounted under my user name it sometimes still is owned by root. I have to go to the /run/media/user directory and "chown user:user mountpoint" before my user is able to write to that device. After having done this once then everytime it is mounted after that the user permissions are retained. Deleting files with the file manager on that device then creates the trash folder and it works.

I would recommend you remove all the trash folders you have manually created, check ownership of the mountpoint directory with the device mounted and change it if needed, then try again to delete something with the file manager and it should properly work.
 
2 members found this post helpful.
Old 03-07-2021, 07:59 PM   #5
jasonc3a
LQ Newbie
 
Registered: Oct 2018
Distribution: Debian, Fedora, Raspbian, LMDE, Bhodi, Ubuntu
Posts: 25

Original Poster
Rep: Reputation: Disabled
Quote:
If you are using the file manager...
Yes, I am.
Quote:
From what you have said, I suspect this is a permissions issue and your user cannot write to the trash.
I am assuming taking ownership would solve it, but I simply cannot manage to do so. When I attempt a fix on the TrueNAS end, I'm not even allowed to mount the drive, much less make changes. When I try to change it in fstab with options like uid=...etc... it also makes no difference (though I don't think uid and the like have an affect on nfs filesystems anyways).

Last edited by jasonc3a; 03-07-2021 at 08:26 PM.
 
Old 03-07-2021, 08:24 PM   #6
jasonc3a
LQ Newbie
 
Registered: Oct 2018
Distribution: Debian, Fedora, Raspbian, LMDE, Bhodi, Ubuntu
Posts: 25

Original Poster
Rep: Reputation: Disabled
So, I can allow myself to create a trash folder if I set the "mapall user" to "root" and leave the "mapall group" blank. That seems kind of insecure, though. Does anybody have enough familiarity with TrueNAS to know what's going on with these config options? I set it all up the best that I could through a combination of man mount, man fstab, and the TrueNAS user guide, but I'm pretty well at the limit of my knowledge on this kind of thing.
 
Old 03-18-2021, 05:46 PM   #7
jasonc3a
LQ Newbie
 
Registered: Oct 2018
Distribution: Debian, Fedora, Raspbian, LMDE, Bhodi, Ubuntu
Posts: 25

Original Poster
Rep: Reputation: Disabled
Well, having looked all over the internet for as long as reasonable, and having tried everything I can think of, ending up back where I started from, I'm going to conclude that it is simply impossible to do in case somebody ever goes looking for an answer.
 
Old 06-27-2022, 02:35 AM   #8
ChameleonScales
LQ Newbie
 
Registered: Jun 2022
Posts: 1

Rep: Reputation: 0
I think this shouldn't be marked as solved. jasonc3a's conclusion is not definite. Maybe there is a solution.
The may be clues on this page https://serverfault.com/questions/51...nted-nfs-share
Also, I should add that in my case, while Nautilus, Thunar and the "gio trash" command are unable to send a file to trash, Dolphin however, can. I guess it doesn't use the .Trash-1000 folder like the others.

Last edited by ChameleonScales; 06-27-2022 at 04:24 AM.
 
Old 07-01-2022, 03:15 PM   #9
jasonc3a
LQ Newbie
 
Registered: Oct 2018
Distribution: Debian, Fedora, Raspbian, LMDE, Bhodi, Ubuntu
Posts: 25

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ChameleonScales View Post
I think this shouldn't be marked as solved. jasonc3a's conclusion is not definite. Maybe there is a solution.
The may be clues on this page https://serverfault.com/questions/51...nted-nfs-share
Also, I should add that in my case, while Nautilus, Thunar and the "gio trash" command are unable to send a file to trash, Dolphin however, can. I guess it doesn't use the .Trash-1000 folder like the others.
Thank you, I read through and tried working with all of the information you provided with that link. Unfortunately, there is still no progress. The problem itself is pretty uninteresting and likely not worth the time it would take to replicate and solve for the people knowledgeable enough to do so, so unless I solve this myself, I doubt this will ever have a satisfying resolution. I still work on it occasionally, but it looks so far like my answer of "sorry, I gave up" might be the closest we're getting for a while. Thanks again for the link.
 
  


Reply

Tags
nas, nfs, trash



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trash is Full. Empty Trash before moving more files/folders to Trash. wdarledge Slackware 45 12-13-2017 03:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration