I accidentally deleted a directory with
rm -rf /media/directory
When using
ls -lh /media
the space appears to be free, but when I use df
or open the file manager nautilus
or pantheon
, it shows that the previously occupied space is still allocated.
I googled this problem and some says that some process is still using these data, so it won't be freed till unmount, restart or killing the process itself. I did none of these still, is there any way to recover it?
– xquilt Dec 05 '20 at 18:01lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs Output information may be incomplete.
grep
withlsof
. For example, to search for a file named "awesome.pdf" you could uselsof | grep 'awesome.pdf'
or you could search for directory:lsof | grep '/media/'
If the actual files don't list after you run the command, then you will have to useforemost
orphotorec
, preferably from a live USB session. – mchid Dec 05 '20 at 18:21