Emptying the trash can lead to have files still on disk in expunged

Bug #422012 reported by mikey
96
This bug affects 20 people
Affects Status Importance Assigned to Milestone
nautilus (Ubuntu)
Triaged
Low
Unassigned
thunar (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: nautilus

When moving files to the Trash which are belong to another user and you don't have access to, nautilus moves the files into a folder ~/.local/share/Trash/expunged. The problem is that there is no warning that this is happening and the location of the files is far from obvious.

I only discovered the folder by using disk analyser and finding that there was a massive folder in ~/.local/share/Trash/expunged. It transpired after deleting the offending files that there had been some 70Gb worth of files!!!

Would it not make far more sense from a function point of view to move the files into the Trash as per normal but just fail to empty them? At least you would be able to see them and know that you needed to do something!

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please answer these questions:

 * Is this reproducible?
 * If so, what specific steps should we take to recreate this bug?

 This will help us to find and resolve the problem.

Changed in nautilus (Ubuntu):
assignee: nobody → Ubuntu Desktop Bugs (desktop-bugs)
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
mikey (abc-mikey) wrote :

Hi,

I've not been able to reproduce this issue. It may have been a problem at some previous stage or to do with some unusual permissions on the files in question.

I will report back if I find it having happened again.

Revision history for this message
Dante (dante-dant) wrote :

I can confirm that I get the same behaviour. The files on the "expunged" folder have some problems with permissions.

I had to open the folder as administrator to delete it.

Revision history for this message
Toni Sagristà Balanzat (tonisb) wrote :

Today I emptied the Trash but the files were "deleted" too fast and no disk activity was noticed, so I started investigating and I found all the Trash contents inside the folder ~/.local/share/Trash/expunged.

There was no problem with the permissions of the files as I have been able to remove the whole expunged folder with a "rm .local/share/Trash/expunged/ -Rv" without a single warning executed as the same user logged in the desktop.

For now I have not been able to reproduce the problem.

Revision history for this message
Sebastien Bacher (seb128) wrote :

could you try if that's still an issue in karmic or lucid?

Revision history for this message
Jimmy Xu (jimmyxu) wrote :

How to reproduce:

jimmy@jimmy:~/tmp$ mkdir test
jimmy@jimmy:~/tmp$ mkdir test/root
jimmy@jimmy:~/tmp$ touch test/root/file
jimmy@jimmy:~/tmp$ sudo chown root:root test/root/ test/root/file

Then delete ~/tmp/test in nautilus and empty the Trash. Now the Trash can seems to be empty, but the folder has been silently moved to:

jimmy@jimmy:~/.local/share/Trash/expunged$ ls
3010044318
jimmy@jimmy:~/.local/share/Trash/expunged$ ls -al 3010044318/root/
total 8
drwxr-xr-x 2 root root 4096 2010-05-20 21:42 .
drwx------ 3 jimmy jimmy 4096 2010-05-20 21:42 ..
-rw-r--r-- 1 root root 0 2010-05-20 21:42 file

It's all here.

Changed in nautilus (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Jimmy Xu (jimmyxu) wrote :

My version information:

Linux jimmy 2.6.34-2-generic #9-Ubuntu SMP Thu May 13 23:46:20 UTC 2010 x86_64 GNU/Linux

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu maverick (development branch)
Release: 10.10
Codename: maverick

nautilus:
  Installed: 1:2.30.1-0ubuntu1

Revision history for this message
SunnyBUG (sunnybug) wrote :

It's still here with 10.04

Revision history for this message
José Lou Chang (obake) wrote :

I have experienced the same issues in Ubuntu 10.04 and Ubuntu 10.10.

I though that maybe the directory "Expunged" was a folder that stored big files, since I saw that in one of the user's Expunged folder included video files.

So, what can we do here?

1) Inform the user that their files might be moved to ~/Trash/expunged?
2) Change the trash behavior, so that if it is a big file it will get deleted without moving it to another directory?
3) Move all files to the normal Trash directory?

But, first we need to know what kind of files and in what condition does the files get moved to "Expunged"

Revision history for this message
José Lou Chang (obake) wrote :
Revision history for this message
David Ordenes D. (radioboy-2) wrote :

I've just found in .local/share/Trash/expunged/ the contents of builds of some programs I had to compile to install.

Revision history for this message
MestreLion (mestrelion) wrote :

8 months since bug was confirmed. Any news on it?

By the way, where ccan i find the rationale / specification on this "expunged" folder? Is it for big files, other-users files, both, none, something else?

Last but not least: shouldnt these files be deleted on reboot?

Revision history for this message
Emre Kucukarpaci (ekkucukarpaci) wrote :

This happened to me not on my main drive but on a USB thumb drive I use for backup, formatted with FAT32. The backup program kept telling me the drive was full, so I suspected if the files were not actually deleted, so I searched for a bit and found 5GB of files in "/media/DriveLabel/.Trash-1000/expunged".

Revision history for this message
jpfle (jpfle) wrote :

I confirm this behavior with Thunar too.

Changed in thunar (Ubuntu):
status: New → Confirmed
Revision history for this message
Åsmund Stavdahl (smund3) wrote :

I confirm the issue with 11.10, GNOME/Nautilus 3.2.1.

Revision history for this message
Martin von Wittich (martin.von.wittich) wrote :

As far as I understand (unfortunately, I can't find any documentation on this) files that are deleted from the trash are first moved to "expunged" (because moving files is fast), and then are slowly deleted from "expunged" (slowly because deleting a lot of files takes time and doing it too fast could slow down the whole computer).

This means that having files in "expunged" is not necessarily a problem, as long as these files get deleted over time. If there are files in "expunged" that do not vanish over time, the output from the following command could probably help the maintainers in figuring this bug out:

LANG=C ls -l ~/.local/share/Trash/expunged

Revision history for this message
Jan Claeys (janc) wrote :

What happens is that when a directory hierarchy is "deleted" in nautilus (or any other application that uses the method explained by Martin in comment 16), it gets moved to the $trash/files directory, and then when the trash gets emptied, that hierarchy is moved to the $trash/expunged directory, after which it should be deleted. Unfortunately, deleting all those files is not always possible when somewhere down the tree there are files or directories with permissions that don't allow them to be deleted by the desktop user, and then those files remain there forever, without any warning for the user...

Revision history for this message
John Walker (crew-j) wrote :

THe bug is stll here in 2019, on 18.04.1!

I had loads of files in .local/share/Trash/expunged.

Removing them, they vanished, (rapidly), but the disc space occupied has not been released. 256GB on this machine, and it has run out of space. Backups of home/user are taking up 192GB.

Changed in nautilus (Ubuntu):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → nobody
Revision history for this message
Sebastien Bacher (seb128) wrote :
summary: - Protected files hidden by Trash
+ Emptying the trash can lead to have files still on disk in expunged
Changed in nautilus (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Christian Lampe (lampe2020) wrote (last edit ):

Same behaviour on Ubuntu 22.04.1 LTS with nemo 5.2.4-1 ...
The files seem to be moved there if you delete a directory of yours with files from other users in it from the trash.

Proposal for behaviour changes:
1. Not create and use the "expunged" folder at all and just fail to delete other users' files from your own trash.
2. Continue to use the "expunged" folder but warn the user when and why and which files are being moved there (and maybe even continuing to show them in "trash:///").

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.