The .Trash-1000 folder cannot be removed

Non release banter
User avatar
gnintilgyes
Black ninja
Black ninja
Posts: 74
Joined: 14 Sep 2022, 17:52
Distribution: Porteus v5 MATE/Cinnamon

The .Trash-1000 folder cannot be removed

Post#16 by gnintilgyes » 09 Nov 2022, 15:17

beny wrote:
09 Nov 2022, 11:04
hi Rava you have to change directory before rm ,you can't remove the hidden directory the .trash-100 or 0 is an usual step to usb devices, you can't have into hard disk because the usb hold removed files until the user can use it again and because is hidden you have to have root account to see it,and fat 32 don't help with this task,ok but the user can do what he want..... a work for gparted
As @beny said here, the ".Trash-1000" cannot be removed because it's part of the "Trash Bin" mechanism in Linux desktop. Almost all other penguins and D.E.'s are this way. The user could ask to "Empty Trash" but the ".Trash-1000" or like-named folder, with its "secret" contents must remain. Note that my experience on Slackware 32-bit allows the desktop icon of the trash to be deleted! It's like a stomach eating itself.

EDIT: I just remembered one of the D.E. file managers (don't remember which one) has an option "Offer delete command which bypasses Trash". This feature is dangerous because it could bite the user very hard when suddenly he/she needs one file that was permanently deleted and he/she expected the Trash to cover it.

User avatar
Rava
Contributor
Contributor
Posts: 4414
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.0 x86_64 + 4.0 i586
Location: Forests of Germany

The .Trash-1000 folder cannot be removed

Post#17 by Rava » 09 Nov 2022, 16:10

gnintilgyes wrote:
09 Nov 2022, 15:17
As @beny said here, the ".Trash-1000" cannot be removed because it's part of the "Trash Bin" mechanism in Linux desktop.
Really?

Have you booted into init 3 mode aka multiuser network but without starting the GUI like I wrote above more than once?

I have done the above with creating the empty files on my external devices for years and never ever ran into any issue, be it XFCE, Mate or Openbox, be it Porteus or Tiny Core or Puppy.

But I always did the creation of the empty files prior manually starting X. :)
And since no DE ever saw any of my USB drives at first, I did not have to delete any folders and could start by creating my empty files instead.
gnintilgyes wrote:
09 Nov 2022, 15:17
I just remembered one of the D.E. file managers (don't remember which one) has an option "Offer delete command which bypasses Trash". This feature is dangerous because it could bite the user very hard when suddenly he/she needs one file that was permanently deleted and he/she expected the Trash to cover it.
When you open a terminal and run a rm -r /folder/ you will also delete stuff. No move to Trash when using rm.
The user must know what he does and what consequences certain settings or actions pose.

User avatar
gnintilgyes
Black ninja
Black ninja
Posts: 74
Joined: 14 Sep 2022, 17:52
Distribution: Porteus v5 MATE/Cinnamon

The .Trash-1000 folder cannot be removed

Post#18 by gnintilgyes » 09 Nov 2022, 17:21

Rava wrote:
09 Nov 2022, 16:10
Really?

Have you booted into init 3 mode aka multiuser network but without starting the GUI like I wrote above more than once?

I have done the above with creating the empty files on my external devices for years and never ever ran into any issue, be it XFCE, Mate or Openbox, be it Porteus or Tiny Core or Puppy.
When I started with Slackware 32-bit I had to deal with that, discovered how to create the regular user, disable "gpm" which was annoying (and still couldn't find out why the touchpad was disabled sometimes after Plasma finished loading) and figured out how to do "init 4" so the system booted and started into the desktop.

You're far more experienced than me, but I've said something based on my experience. A long time ago on Ubuntu Studio 32-bit something happened to me similar to what @roro reported, because I also didn't like those extra files/folders having to do with Trash. I had thought it was a GNOME quirk. I did something which had to do with a bunch of zero-length files called "GOUTPUTSTREAM" or alike and the OS failed to clean up after itself. I don't know that much about "inodes" and stuff like that but isn't there a limit to how many files/folders a system could have? Those zero-length files would have something to say about it if each one gets a "inode". Maybe it's just exaggeration.

Inode

Funny that this article says nothing about zero-length files.

User avatar
Rava
Contributor
Contributor
Posts: 4414
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.0 x86_64 + 4.0 i586
Location: Forests of Germany

The .Trash-1000 folder cannot be removed

Post#19 by Rava » 09 Nov 2022, 21:30

gnintilgyes wrote:
09 Nov 2022, 17:21
Funny that this article says nothing about zero-length files.
A zero-length file might occupy an inode but it still doesn't occupy data area of the partition it is on. It's main existence is it's entry in the directory it is sitting in.

Usually having enough available inodes is of no issue, only when you have tons of small files (really small ones) you could ever run into issues, and with my approach we speak of less than 10 files per partition. When we look at the total numbers of files and folders thatare in an average partition, less than 10 files is like nothing.

And the folders that would be created and the files in these folders and possible sub-folders with more files would all also occupy inodes, so with my approach when you want to disable Trash (by Linux and by Windoze) and System Volume Information on an USB device you have less write cycles and also you have less data area occupied. And that's a win-win in my book.

But to each their own.

My approach worked for me for years so I recommend it to others (but use it via init mode 3 so that anything from the GUI is not yet running and thus cannot interfere)
Cheers!
Yours Rava

roro
White ninja
White ninja
Posts: 28
Joined: 04 Aug 2022, 08:41
Distribution: Porteus 5.0 XFCE

The .Trash-1000 folder cannot be removed

Post#20 by roro » 20 Nov 2022, 12:30

Clicking on the Trash entry in the left sidebar yields the option to Empty Trash
Yes!

I emptied the Trash
and now the entire boot USB device is read-only.
So I have to reboot.

It's terrible, the Trash only does harm.
Why was he introduced in Porteus 5.0. ???

I suspect the folder 215389628 in .Trash-1000/expunged is the abuser
/mnt/sdb1/.Trash-1000/expunged/215389628/

But the abuser can not be removed.

User avatar
Rava
Contributor
Contributor
Posts: 4414
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.0 x86_64 + 4.0 i586
Location: Forests of Germany

The .Trash-1000 folder cannot be removed

Post#21 by Rava » 20 Nov 2022, 12:36

roro wrote:
20 Nov 2022, 12:30
Clicking on the Trash entry in the left sidebar yields the option to Empty Trash
Yes!

I emptied the Trash
and now the entire boot USB device is read-only.
So I have to reboot.
you should also post that into the Porteus-v5.0x86_64_bugs reports thread since using the GUI for what the GUI offers the user - should not lead to a read-only boot device. Thus this is a bug.
roro wrote:
20 Nov 2022, 12:30
Why was he introduced in Porteus 5.0. ???
Good question, some claim it is needed so that users who want Port to act like Windoze feel more at home? (I disagree to that notion, Linux is not Windoze and most of us do not want the tonload of buggy behaviour Windoze gives its users to be part of Linux.)

And as you just proven Thrash does more harm than good.
Cheers!
Yours Rava

User avatar
babam
Shogun
Shogun
Posts: 445
Joined: 16 Nov 2016, 10:30
Distribution: Porteus 5.0rc3 Xfce K5.19.6
Location: Rainy city

The .Trash-1000 folder cannot be removed

Post#22 by babam » 20 Nov 2022, 15:12

Flash drives have very limited write cycles, so it's best to avoid changes cheatcode.
I suggest to use changes with changes-ro or just use changes=EXIT:

I've been using Trash on Porteus for over 3 years and haven't had any issues.
Sorry, my English is bad.

roro
White ninja
White ninja
Posts: 28
Joined: 04 Aug 2022, 08:41
Distribution: Porteus 5.0 XFCE

The .Trash-1000 folder cannot be removed

Post#23 by roro » 20 Nov 2022, 17:26

Hi Rava,
This bug occurs occasionally, but not always.
Such bugs are difficult to find.
My question: Is it possible to remove the Trash from the system.
It's hardly of any use
thanks

User avatar
Rava
Contributor
Contributor
Posts: 4414
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.0 x86_64 + 4.0 i586
Location: Forests of Germany

The .Trash-1000 folder cannot be removed

Post#24 by Rava » 20 Nov 2022, 17:53

roro wrote:
20 Nov 2022, 17:26
My question: Is it possible to remove the Trash from the system.
It's hardly of any use
My approach works on a per-partition basis and it never failed me nor ever did it cause issues.

But for it to succeed you have to start any Linux in init mode 3 like adding the "3" cheatcode in Porteus to your line with the commands to the kernel because it is important that no part of your DE is started by itself.

E.g. instead of this in your porteus.cfg

Code: Select all

APPEND initrd=initrd.xz 
use this

Code: Select all

APPEND initrd=initrd.xz 3
or edit the line during boot by manually adding the " 3" at the end whatever your APPEND line for your current setup might be.

Then no GUI will be auto-started, you only get the text based virtual console.

Log in as root on one of the Virtual Consoles and remove all .Trash folders from all devices you want Trash disabled.
Like so:

Code: Select all

cd /mnt/sda1
when /mnt/sda1 is the partition you want the Trash to be disabled.
Rava wrote:
07 Nov 2022, 04:27
When .Trash-1000 directory is empty:

Code: Select all

rmdir .Trash-1000
or when it's not empty

Code: Select all

rm -r .Trash-1000
check if it's gone.
Then create an empty file with

Code: Select all

touch  .Trash-1000
When there is a file the folder cannot be created thus trash on that device is disabled.
Two examples from my current system, one on sda the other on sdb:

Code: Select all

root@porteus:/# cd /mnt/sda4/
root@porteus:/mnt/sda4# ls -ld .Trash-1000 
-rwxrwxrwx 1 guest root 0 2022-01-31 05:36 .Trash-1000
root@porteus:/mnt/sdb4# cd /mnt/sdb3/
root@porteus:/mnt/sdb3# ls -ld .Trash-1000 
-rwxrwxrwx 1 guest root 0 2022-01-09 02:37 .Trash-1000
Added in 20 minutes 35 seconds:
Here the example how it works in the GUI - my DE being XFCE 4.16 but it should not differ to any of the standard DEs in Porteus.
First I create a dummy file in a new folder on /mnt/sdb4 that is an ext3 partition:

Code: Select all

guest@porteus:~$ cd /mnt/sdb4/tmp/
guest@porteus:/mnt/sdb4/tmp$ mkdir Trash-test
guest@porteus:/mnt/sdb4/tmp$ cd Trash-test/
guest@porteus:/mnt/sdb4/tmp/Trash-test$ touch dummyfile.txt
guest@porteus:/mnt/sdb4/tmp/Trash-test$ ls -l dummyfile.txt 
-rw-r--r-- 1 guest users 0 2022-11-20 19:03 dummyfile.txt
As wrote in the above quoted post of mine
Rava wrote:
07 Nov 2022, 04:27
At least in XFCE Thunar distinguishes between fake delete (move to trash) and real delete.
Now I again make that test, I only press [delete] and not [shift]+[delete], normally thunar would give no warning window and the file would be moved to Trash, but since the .Trash-1000 folder cannot be created and thus the file could not be moved to Trash, I get this warning window instead:
Image
after confirming the delete via [Delete] in Thunar the Trash is still empty and when I again look into /mnt/sdb4/

Code: Select all

guest@porteus:/mnt/sdb4$ ls -l .Trash-1000 
-rw-r--r-- 1 root root 0 2021-10-12 16:58 .Trash-1000
there is still only an empty ".Trash-1000" file like before and no .Trash-1000 folder got created.
Cheers!
Yours Rava

User avatar
gnintilgyes
Black ninja
Black ninja
Posts: 74
Joined: 14 Sep 2022, 17:52
Distribution: Porteus v5 MATE/Cinnamon

The .Trash-1000 folder cannot be removed

Post#25 by gnintilgyes » 20 Nov 2022, 21:31

roro wrote:
20 Nov 2022, 17:26
My question: Is it possible to remove the Trash from the system.
It's hardly of any use
thanks
Why not just ignore it? There is a desktop setting to hide the icon, or pretend it doesn't exist.
Rava wrote:
20 Nov 2022, 12:36
Good question, some claim it is needed so that users who want Port to act like Windoze feel more at home?

And as you just proven Thrash does more harm than good.
I disagree with this. TL;DR

I'm fairly torpid about backing up and making sure some files are needed while I'm working on something, and some of these files are megabytes in size. "Trash" then is used as some kind of placeholder. Sometimes I delete a file and have to visit the "Trash" to get it back. In the course of music creation, some apps don't render properly from plug-ins, must be given accurate settings. This happens to me a lot. If there was a wave file that was supposed to be in stereo, because the user forgot to set things properly, and was sent to "Trash" because of that, it would be much preferred when the moody music-creation program now doesn't want to cooperate. If that mono wave file were deleted via "rm" terminal command or [SHIFT][DELETE] trick then, oh well, I don't know what one of you guys would do except scream out of a window.

A side-note is that I use Fedora MATE sometimes for music production, and I don't depend on any live distro for this kind of thing. I'm a hobbyist, ie. prefer Wine with Windows 32-bit VST plug-ins instead of trying to record anything with Ardour, or wasting time tweaking settings for ALSA and Jack, or dealing anyhow with 64-bit in any format.

How about when the user started working on a document that previously didn't have images, looks great at the moment but he/she wants to get fancier? Then the user starts adding images but the performance of the word processor is too slow, or "it's just not right" so he/she spends all night adjusting it. Then a glitch happens damaging most of the document. It's better to back up, eh? But if a copy resides in the "Trash" that was that plain old document before the harmful modifications, it could be a real life-saver.

The same could be said about "undo" function, but back to the case of the music-creation program, such a thing either is too impractical to exist, or the user could return to a point which is not entirely satisfactory. Dealing with plug-ins is not reliable at all. A program such as Audacity or MusE would be great for recalling only out of slicing and dicing wave files. But when plug-ins are involved, those two, and many others will require the user to seriously think about a backup plan.

This is not a likely case for most of you. I'm only explaining some of my experiences.

User avatar
Ed_P
Contributor
Contributor
Posts: 7324
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 4.0 & 5.0 ISOs
Location: Western NY, USA

The .Trash-1000 folder cannot be removed

Post#26 by Ed_P » 20 Nov 2022, 22:59

Rava wrote:
20 Nov 2022, 18:14
roro wrote:
20 Nov 2022, 17:26
My question: Is it possible to remove the Trash from the system.
It's hardly of any use
My approach works on a per-partition basis and it never failed me nor ever did it cause issues.
Rava wrote:
20 Nov 2022, 18:14
Then create an empty file with

Code: Select all

touch  .Trash-1000
roro wants to REMOVE the Trash from the system. I interpret that to mean he doesn't want the .Trash-1000 folder on the USB drive period. Whether created by Porteus or a user's bash command he doesn't want it showing in a Linux nemo window, a Porteus menu or a Windows file manager window. Manually creating it does nothing to make it disappear.
Ed

User avatar
Rava
Contributor
Contributor
Posts: 4414
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.0 x86_64 + 4.0 i586
Location: Forests of Germany

The .Trash-1000 folder cannot be removed

Post#27 by Rava » 20 Nov 2022, 23:45

Ed_P wrote:
20 Nov 2022, 22:59
Manually creating it does nothing to make it disappear.
Manually creating .Trash-1000 as an empty file disables the Trash on that device, so in your words, it disables it on that device.
And even when you plug that USB drive into any other Linux system, the Trash on that device is still disabled.

When you disable it by hacking into your current Porteus, it is only disabled on that very Porteus.

When you plug your USB drive into some other Linux system (and usually that is what external drives are for) you still get a Trash folder on it and files are moved into that folder when they are "deleted" since on that system most likely a Trash functionality using a folder in its root called .Trash-1000 is still enabled.

But you can sure tell us about a way to disable any kind of Trash functionality not only in roro's current system but also in any other system his USB external drive could ever be plugged in.
I am fascinating to hear your approach in solving that. Especially when it's about the Linux system of other people where you have no access rights and no permission to alter the system.

Because my approach does solve that issue, and you can even choose to have a certain drive still enabled to use Trash on it, or you can choose to disable it on every internal and external drive and partition you own if you so wish.
Cheers!
Yours Rava

User avatar
gnintilgyes
Black ninja
Black ninja
Posts: 74
Joined: 14 Sep 2022, 17:52
Distribution: Porteus v5 MATE/Cinnamon

The .Trash-1000 folder cannot be removed

Post#28 by gnintilgyes » 24 Nov 2022, 20:22

I was in the process of checking out this clone of a clone of Debian LOL:

https://gnuinos.org/

I noticed belatedly there was no Trash. It complained about "gvfs" missing or something else in order to support that and to allow me to mount a partition on the internal HDD. It sucked, had to do it manually at terminal. Cannot do that, there's no "gcc", no "fdisk", the only text editor is Geany, suspiciously Inkscape and MPV are provided while most other distros don't "by default", no immediate way to change the screen brightness and more. Too bad because I like its XFCE theme.

For advanced Linux users only: To stay on topic, maybe configure "gvfs" or disable it, so Trash doesn't exist? LOL but this might be only for Debian-based stuff.

What is Unix/Linux without "gcc"? Came across another Russian one that expected me to go online to get "gcc" and a couple of other things missing.

Almost forgot: since they want to run away from what is not "libre" or not GPL-licensed or whatever, there is no way to get wifi functionality on that OS!

Post Reply