Page 1 of 1

End of year cleanup and performance check

Posted: 30 Dec 2011, 08:24
by force317
I often install and delete files on the B3, and apparantly there is no recycle bin folder or something like that, so they are completely removed immediately.

But is everything really gone, aren't there some remnants that keep taking up some disk space, so that after months of use some of the disk capacity gets filled up by these useless leftovers ?

The same can be said about the B3 updates. Are there some files leftover after every update ?

So my question is : is there a set of commands that one can run - i assume through ssh terminal - without risk for the B3 server operating system and setup files - that check the entire system, clean up al the rubbish, and perhaps even improve performance of the B3 and available disk capacity ?

Re: End of year cleanup and performance check

Posted: 30 Dec 2011, 09:16
by 6feet5
Hi,

I'm not sure I understand, but I would guess a deleted file is really gone and the space is restored. However there are probably traces left on the hard drive from the file if your concern is security (someone trying to retrieve information from the deleted file).

As for updates, they are stored in /var/cache/apt/archives.

Code: Select all

aptitude autoclean
will remove old packages and

Code: Select all

aptitude clean
will remove all packages. Note that the package will still be installed, it is only the DEB-file that is removed, so aptitude will have to download the DEB-file again if you try to reinstall a package.

/Johan

Re: End of year cleanup and performance check

Posted: 30 Dec 2011, 12:12
by Ubi
yes the file is really gone. Back in the old days we had undelete for DOS, but for posix systems there is no such thing, and recovering a deleted file isn't trivial at all. The only solution is to read raw blocks from the drive and try to find your file back. The official Unix solution to file recovery is by making backups :mrgreen:

but if you insist: http://carlo17.home.xs4all.nl/howto/undelete_ext3.html

Re: End of year cleanup and performance check

Posted: 30 Dec 2011, 14:57
by force317
No, my concern was not security or the possibility of retrieving files.

I only wanted to be sure that after deleting a file and/or directory 100% of the disk space came available
again, that's all.

Re: End of year cleanup and performance check

Posted: 04 Jan 2012, 03:52
by Kiff
Once you delete a file, it's removed and the space is free, however...

Sometimes you want to delete a file that is in use. On windows you're simply not allowed, on Linux the file is deleted but the space is not reclaimed until all filehandles are closed. This is most often seen when deleting log files, and a program (like apache) is still writing to that file.