Issue #12 April 2008
How-to: Ubuntu Disk Usage
 

Also see this month's Top-5, which covers the Top 5: Disk Usage Analyzers.

If you have used your computer for any length of time, you have probably begun to amass great quantities of data -- from family photos and music to more bulky movie files. If you're anything like me, you need to check your hard disk regularly to ensure that it has adequate space for future files. Of course, if it's running short of space, it might be time to archive large files onto CD/DVDs or even to install a new internal/external hard disk. Although your disk may now have adequate space, you may want to consider the following methods to keep an eye on disk usage.

The File Browser

Your File Browser shows your personal files and folders and can be started by clicking Places > Home. In the status bar at the bottom of this window, you can see the amount of available disk space. In the screenshot below, there is 174.8 Gigabytes available. (I hope this is sufficient for storing my daughter's music collection!)

Disk Usage Analyzer

For more detailed analysis of your disk usage, Ubuntu comes with a handy accessory available from your Applications menu at Applications > Accessories > Disk Usage Analyzer.
 

This tool (Baobab by Fabio Marzocca) gives a graphical representation of your files and folders as concentric circles. After starting the program, you should see some summary information about the total size of your filesystem, and the proportion of space you have already used.

To check for large files and folders within your own Home folder, try clicking the Scan Home button:

The Disk Usage Analyzer begins to scan your files and folders.

After some time, you should receive results similar to the screenshot shown.

The results are split into two panes. On the left, your folders are listed in an order of decreasing size. The right pane shows a graphical view of your Home folder, with concentric circles representing its folders and sub-folders. Larger segments represent more disk space usage. The segment in the center represents your Home folder overall (e.g. /home/niamh) and, going out from the center, the first ring represents the main folders in your Home folder (e.g. /home/niamh/Movies), and the next ring out represents the sub-folders within your main Home folder (e.g. /home/niamh/Movies/TheElephantsDream-2006).

As you hover your mouse over each of the segments of the circles, the name of the folder it represents pops up and the amount of disk space which is being used is also shown. As you can see from the screenshot below, my daughter's movie files are using 37.1 gigabytes.

It's also possible to "drill-down" through your folders and sub-folders using the tree-view in the left pane of the results. Clicking on the little triangles beside a folder name will reveal the sub-folders it contains, and the disk usage for each of those folders.
 
 

Command Line Junkies

At the command line, you can check the usage of your disk partitions with this command:

df -h

It's also possible to get a summary of the usage of folders within a folder by typing this:

du -s *

If you would like to know more about these commands check the man pages:

man df man du

To exit from the man pages, type: q

Partition Editor

For a lower level view of your disks, and the partitions on those disks, consider using Partition Editor (GParted), available by clicking System > Administration > Partition Editor

Partition Editor gives a graphical view of your hard disks and their partitions. As you can see from the screenshot shown, my daughter's hard disk is partitioned into three main partitions. One is formatted as NTFS (a Windows partition), another is formatted as ext3 (for Ubuntu), and the third is an extended partition which Ubuntu uses for short-term Memory Swap Space. The size of each partition is shown -- with the amount of used space and free space.

If you have more than one hard disk drive in your computer, then you can view the partitions on each using the menu at the top right of Partition Editor -- where each device's name (e.g. /dev/hdc) is shown.

As you can see in this screenshot, there are locks beside the partitions listed. This means that they are in use (mounted). If you need to make changes to these partitions (be very careful), you may want to try the GParted LiveCD -- but that is for another article!

Full Circle Issue 12 Cover
- Contents -

Editorial

News

Flavour of the Year:
Ubuntu-Kubuntu '07 - '08

How-To:
-Deb Files
-Server Series Pt 4
-Ubuntu Disk Usage
-NEW SERIES: GIMP Pt 1
-Backup with Partimage

Review: Wiki on a Stick

My Opinion: Wine

My Story: Full Circle-One Year On

Interview: Travis Watkins

Ubuntu Women

Ubuntu Youth

Letters

Q and A

My Desktop

Top 5: Disk Usage Analyzers

Magazine Index 07-08

Contribute