Results 1 to 8 of 8

Thread: (18.04) How to clean HDD from deep(?) temporary files?

  1. #1
    Join Date
    May 2019
    Beans
    7

    (18.04) How to clean HDD from deep(?) temporary files?

    I know that in Ubuntu 18 there is an option to clean temporary files and dust bin, but it seems there are more deeper temporary files or whatever, that they are not deleted by that.
    What happened to me today is that I was copying some files from on PC to another by LAN on my public folder. Then I've copied those files from public folder to another HDD which I bigger and I couldn't mount to LAN and then deleted the files from public folder. This however freed only like 10% space of the space those files were taking.
    I found a option in settings to clean cache and dustbin, but it didn't helped. Restarting the PC also didn't changed anything.
    How can I understand what is really happening?

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    16,295
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: (18.04) How to clean HDD from deep(?) temporary files?

    If you deleted the files using a GUI, it is possible they were just moved to a Trash bin. If you delete them using shell commands, they are gone.

    If the underlying file system is btrfs, all bets are off. Btrfs lies about storage use unless you use btrfs commands. The normal, standard, 40 yr old commands, df and du don't get the truth from btrfs.

  3. #3
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    6,276
    Distro
    Kubuntu 18.04 Bionic Beaver

    Re: (18.04) How to clean HDD from deep(?) temporary files?

    Quote Originally Posted by nikt3 View Post
    Then I've copied those files from public folder to another HDD which I bigger and I couldn't mount to LAN and then deleted the files from public folder.
    It isn't clear at all what you mean here.

    It's possible that, because you couldn't mount whatever it was, you've copied the files to the mount point rather than to whatever it was that you wanted mounted there.

  4. #4
    Join Date
    May 2019
    Beans
    7

    Re: (18.04) How to clean HDD from deep(?) temporary files?

    @CatKiller
    Thanks for the concern.
    Yes, it wasn't clear I admit, I was writing in a hurry.
    In short I have 2 partitions one ext4 and another ntfs and I wanted to move them to ntfs partition but after copy finished and deletion from ext4 the spaces on ext4 reduced only by ~10% of the files that were really there.
    The ntfs partition isn't mounted on a startup automatically and I have to click on it from nautilus.


    So if as you've pointed something about mounted locations, maybe there was something with that, but if so, how to understand it and where to search for those residue files?

  5. #5
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    6,276
    Distro
    Kubuntu 18.04 Bionic Beaver

    Re: (18.04) How to clean HDD from deep(?) temporary files?

    So the way mounting works is that you have a mount point. This is just a certain place in the filesystem tree. When you mount a filesystem, the mount point will show the contents of that filesystem instead of what would already be there. So, for example, if you had a bunch of files that you'd copied to a directory, mounting a different filesystem over the top would hide those, and so you might think that you should copy them again.

    The thing to do would be to check whether you have files at your mount point even when that other filesystem isn't mounted there.

    It's possible that you've got files in some Trash folder somewhere or something, but inadvertently-duplicated files is easily done when you have other filesystems temporarily mounted.

  6. #6
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    16,295
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: (18.04) How to clean HDD from deep(?) temporary files?

    I'm not sure if any of the stuff below is relevant. Probably not.

    Above you said that you copied and deleted.
    Lower you say that you moved. Those are different and behave differently depending on the file system(s) involved.

    "Moving" within the same file system is instantaneous. The process doesn't have to move any data at all, just update 1 or more of the inodes for who their "parent" is.

    "Copying" across file systems or within the same file system always has to copy the data, update the parent, and correct the permissions. That takes longs. "Moving" across file systems works this way.

    "Deleting" can mean different things dependent on which tool(s) are used to accomplish it. If you 'rm' on the command line, it is fast, no data gets moved to "Trash" or whatever they call it in your Locale. If you use a GUI to delete, then it may or may not move the files to the "Trash". There are many different implementations and attempts to standardize just don't work. Some "delete" commands in a GUI will move the files to Trash, but only if they are inside the same file system as your HOME directory. Others will copy the deleted files from wherever they are into the Trash inside your HOME, but many GUIs don't do this because it is slow. I looked this up a few weeks ago and was surprised at the different implementations of "Trash".
    https://superuser.com/questions/3241...the-difference explains and links to explanations of the different "trash" implementations.

    As you can see, being extremely precise is necessary.

    CatKiller explained mount points nicely. Only thing I'd add is that a mount point is just a directory. It should be empty, but that actually doesn't matter. It is easy to mount a file system onto any directory, full, empty, whatever. This has the effect of hiding all the files contain inside it from anyone who doesn't know that umount is necessary to see those files. Forensic tools that read the disk directly will see all the files, so it isn't really a security thing. 99.999999% of the time, mounting over existing files and sub directories is a mistake. I've done it accidentally back when I did local backups to external devices. I've seen the automatic mount tools do it too, but not recently. Anyways, this is one of the reasons that I don't allow gvfs to control mounts on any of my systems. Burn me once, ... humans can learn from our experiences.

  7. #7
    Join Date
    May 2019
    Beans
    7

    Re: (18.04) How to clean HDD from deep(?) temporary files?

    Thank you once again @CatKiller and @TheFu for precise, useful and detailed explanation. I will ponder on them and try to fully understand. Also I wish and I will try to be also more precise in the future.
    I've also found those files in .local/share/Trash, but now I will have to read how to delete them from there GUI way if possible. Terminal way I understand now.
    Thank you for being such a great help for me and others!

  8. #8
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    16,295
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: (18.04) How to clean HDD from deep(?) temporary files?

    There is usually an "Empty Trash" option if you right-click on the trash bin. Caja has this. It also have both "Move to Trash" and "Delete" options in the GUI.

    I doubt the world would end if you use a file manager to get into the Trash bin directory, select everything and delete it.

    Many GUI file managers will have preferences where you can elect how the Trash Bin is used, if at all.

    I'm old school and never use the Trash. If I'm afraid that I need to keep a file, I don't delete it. If I want it gone at some future time, say in 2 months, then I'll schedule an 'at' job to do that. I use this for govt paperwork like auto emission test results. I know I need a copy until they send the auto registration, but after that, it isn't needed. Or if I post a file for a friend to one of my websites, send them a link, then schedule the file to be removed in 2 weeks. At that point I completely consider it handled for forget about the files.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •