Where is the trash can for root partition?
Those files you removed may actually still be opened by another process. In that case the file space will become available when that process closes it's handle to the file.
You can lookup these files with lsof
:
lsof |grep "var/log"|grep deleted
Aliases will not be invoked when using sudo
:
$ alias a=ls
$ sudo a
sudo: a: command not found
This means that the files were actually deleted rather than moved to some trash can.
If there are processes who are still keeping the files opened, e.g. for writing to them, then the space used by the files will not be reclaimed until those processes have either closed the files or exited.
According to trash-put manpage, trash-put puts the files on the trash, which is defined by the FreeDesktop.org Trash Specification.
In chapter Trash directories, Trashing follows such fallback process:
- Home trash, located in
$XDG_DATA_HOME/Trash
. In your case, it may be/root/Trash
for root. It's also possible that sudo passed$XDG_DATA_HOME
through, so also try looking for it under your own trash. It is the main trash used. - For directories not sharing the same mount root as
$XDG_DATA_HOME
, a trash in the top directories of the mounted directories may be used.$topdir/.Trash/$UID
may be tried first.- If the test fails (e.g.
$topdir/.Trash
doesn't exist), use$topdir/.Trash-$UID
. In your case, try looking for it in/.Trash-0
, sincesudo
makes your UID root.
Update:
Binging 'root trash' gives me more.
From a really old tutorial which mentions gksudo nautilus '/root/.Trash/'
, the .Trash
(instead of Trash
as in fd.o) directory under root's $XDG_DATA_HOME
may be a good option to start with.
According to a really old question in Chinese in which .Trash-root
is created for the asker's removable disk, some implementations use username instead of the numeric UID.