Fight for the Internet 1!

Saturday, November 6, 2010

Harddrive Space Disappearance and Freespace

Overview
This is just a quick list of places to look to free up space on your harddrive when using KDE. (In this article, I am dealing with version 4, but some of it does work for version 3 too.) This can be helpful if you ever suffer an anomaly of used space you just can't seem to locate and free up under the great KDE desktop.

Background Information
Sometimes rarely in Linux (running KDE) I receive the message that I'm running low on diskspace on my root (/) partition. (I only give it about 15 GBs total.) After emptying my Trash, most of the space on root (/) was still in use. So I began to dig around to find out the cause of this.

Akonadi
Size: 140.9 MB (on my system)
Location: ~/.kde/share/apps/akonadi
Though I own a Droid X smartphone, I do not use any of KDE's utilities to synchronize my devices. So I was quite surprised to see it taking up that much space. Please note, this is not the location of the installed program, just some data it had accrued about me personally and stored in my home directory.

Nepomuk
Size: 378.2 MB (on my system)
Location: ~/.kde/share/apps/nepomuk
Since no services in KDE actually use Nepomuk (and no programs I know of connect to it), currently is a 100% completely useless service. Don't let it run on your system, since it will only take up space and resources that you cannot use.

Thumbnails
Size: 4.6 GB (on my system)
Location: ~/.thumbnails
Now this one makes sense. I collect literally tens-of-thousands of images and regularly browse them, so I'm not surprised this is so large. Still, it would be nice to specify a limit to the size of this folder.

Clearing out this folder took a bit of skill. I had over 100,000 files in this directory total, and even doing `rm .thumbnails/normal/*` threw a rarely seen error: "Argument list too long"

The simple solution is just to delete the sub folder 'normal' and 'large' inside of '.thumbnails'. I could tell you some nifty console commands to hack around this, but this works just fine.


Apt cache (a.k.a. the System Package Cache)
Size: 1.3 GB (on my system)
Location: /var/cache/apt/archives/
If you are not a seasoned and knowledgeable Linux user, chances are you don't know about this one. Whenever you install any new updates or packages through any number of GUI / Graphical front-ends (such as Synaptic or Software Management) or through command-line program like dpkg or apt, all downloaded files (called packages) have to be placed somewhere while downloading. This location varies a little between Linux distributions, like Ubuntu versus Red Hat. Under Ubuntu and Debian (and any Debian forks) are placed in /var/cache/apt/archives. This can become very full with lots of temporary download files. There are a couple of ways to clear this folder out. My favorite is simply from command line:
sudo apt-get clean
Yum/DNF cache (a.k.a. the System Package Cache)
Size: 1.3 GB (on my system)
Location: /var/cache/yum/
If you are not a seasoned and knowledgeable Linux user, chances are you don't know about this one. Whenever you install any new updates or packages through any number of GUI / Graphical front-ends (such as Synaptic or Software Management) or through command-line program like dpkg or apt, all downloaded files (called packages) have to be placed somewhere while downloading. This location varies a little between Linux distributions, like Ubuntu versus Red Hat. Under Ubuntu and Debian (and any Debian forks) are placed in /var/cache/yum. This can become very full with lots of temporary download files

You should manually clear any folders of files you don't need.

Wine
Size: 5.0 GB (on my system)
Location: ~/.wine
The Wine folder. I was pretty surprised by this one also. All my Windows applications are installed in non-home-directory locations and I haven't done much with Wine lately, so this folder should have been relatively small. After doing some quick checking, I found the folder (.wine/drive_c/users/MY_USER_NAME/Local Settings/Temporary Internet Files) to be the culprit. I suspect this came from updating a videogame of mine recently, since it had a multiple Gigabytes to download and install.

Trash Files (Lost/Forgotten)
Size: 2.0 GB (on my system)
Location: ~/.local/share/Trash/files/
Even after emptying the Trash through the regular interface, some large files persisted. I found them here and manually deleted them. (Side Note: I have to say, though I generally love KDE, their trash system is fairly broken with two major problems. The first is if you open the Trash to look inside, it copies all the files to the /tmp/kde-username/ folder, consuming harddrive space. In my case, I let my trash become huge, so this immediately fills up all freespace on the root / partition. This is a terrible bug they absolutely should have fixed years ago. The other problem is, like this situation, occasionally letting files slip through the cracks and not be correctly deleted.)

KTorrent Magnet Links
Size: 8.3 GB (on my system)
Location: ~/.kde/share/apps/kio_magnet
There is a bug with the KDE IO Slave for using Magnet Links in Ktorrent. Instead of downloading files using the temporary storage directory as specified within KTorrent, it dumps them to this location. That's a serious problem. The easy fix to remove this directory, and create a symbolic link (with the same name) to some temporary folder wherever you want.


Hope that helps you clear up some space on your home-directories and root partitions.

Update 1: Added the Wine section.
Update 2: Added the forgotten Trash files section.
Update 3: Added KIO_Magnet /KDE Magnet Links section.

No comments:

Post a Comment