Main image of article Analyze Your Disk Graphically
Shuffling around disk space is always a tricky business. You want to retain necessary files while at the same time archiving the ones that are redundant, out of date or no longer needed. A huge disk space demolisher is the common .iso file. Every time you try a new version of Linux and don't immediately delete it after it's installed -- boom, there goes another gig or two. It's easy enough to write some automated scripts that would go through the disk, find the target files and then prompt you to keep or delete them. Since I'm a visually-oriented kind of guy, I'd like to be able to tell at a glance where the big problems are and what I have to deal with. My solution lies in a program called Gdmap, a graphical disk mapping program that's started from the command line. It gives a graphical disk storage representation, broken out in relative file sizes, and runs on Linux, BSD and Unix-like operating systems. A similar program, called KDirStat, runs on Linux and is a part of the KDE window manager suite. WinDirStat is a direct clone of KDirStat and runs on Windows-based machines. All three are open source. Here's a screen shot of Gdmap. dgmap Screen Shot The interface is a bit strange at first. Don't worry, it's pretty intuitive once you know what's there. In my example, the highlighted, big grey/blue square is nothing more than a directory with two files. The directory name is /home/rob/ubuntu-android. One file is called ubuntu.img and is 3.34 GB in size. The other file is called /home/rob/ubuntu1204-v4-full.zip and is sized at 1.31 GB. File (or directory) size, directory name and file name are all shown at the lower left hand corner of the screen. There's a whole bunch of off-yellow squares on the left side that kind of look like lizard skin. As it turns out these are .jpg files grouped under various directories. Different file types are given different colors in gdmap. I typically pull all the files off of my Nikon DSLR and stick them in a directory with that day's date. The form mmddyyyy works great. Once I've verified that the files on the memory card all made it over to my disk, they get deleted off the card. As you can see, I take a lot of pictures, because nearly half of my /home/rob directory is consumed by graphics files. Of course, this kind of information is exactly what I need to see, because I can easily spot old .iso files and get a great feeling for how many photos are sitting on my disk (and probably need to be archived or organized). I tend to keep about a year's worth of photos on my machine for easy recall and usage.

How to Spot Directories

Directories are shown as a thin blue line around a group of files. The left most directory, called images, is about 43 GB in size and is the largest on the disk. Directories are arranged from largest, on the left, to smallest, on the right. At the extreme lower right hand corner are individual files under my base directory, which is /home/rob. If you click on a directory, Gdmap will display all the sub-directories and files. Use the top menu bar arrows to move back and forth through your viewing history and up and down through directories. The circular green arrow rescans the directory, while the tool icon gives you a menu for changing color assignments, scanning options and so on. It was surprising to see that there are all kinds of graphics files scattered all over this disk. I certainly need to do some consolidating. gdmap doesn't have any directory or file manipulation capabilities, probably with good reason. It would be pretty easy to accidentally lop off huge swathes of files if you weren't careful. I use gdmap to analyze the disk, then move things around from the command line or with the Thunar file manager. If you want a fast, intuitive way to peek into your disk drives, gdmap is the program for you. Give it a try and let everybody know what you think in the comments below.