Home > Filesystems, Hard Disk > Linux Out Of Space

Linux Out Of Space

You know the scene. Your system is just too slow, processes are queuing up, you can’t create a new text file because your computer ran out of space.

This is not a system failure nor a mistake on the operating system and you’re desperate trying to find those unused and less important files to delete.

The most obvious action to take is start jumping from directory to directory removing files you don’t require, but after awhile this becomes a painful task.

Before you start removing files, you need to actually know how many free space is left and, in case you have a partitioned system, which filesystems are the affected ones. You know, its always easier to divide a problem to a smaller pieces and attack only the significant ones.

Fortunately this is performed very easily in Linux with the df command.

Open a terminal and type df -h to show the disk space usage report. The -h option tells the system to format the values in human readable form.

As you can see, the problem lies in the /usr filesystem.

Now lets have a look at the directory used space. What we want to know is exactly which folders are the ones using the most disk space; The du command will helps us a lot in this situation.

$ cd /usr
$ du -Sm | sort -n

du shows the estimated disk usage on the current folder. After executing the command you will see a list of the directories ordered by disk space usage.

In the first column you will see the directory size (in Megabytes) followed by the folder name. The last record will always be a single . (dot) representing the total size of all the files and folders where you executed the command.

Now we have delimited the problem to just a few folders, the repairing tasks should cause you no trouble.

Finally, think outside the box, nowadays storage media is cheap and there may be nothing you can do but go buy another hard drive.

  1. kapman
    August 23, 2008 at 21:56

    Storag media is very cheap. I just installed two terabytes to help out with home movies and storage. I installed a Samsung and a WD.
    The descriptions are here:
    Instructions about installing an additional controller are here:
    Great post!

  2. grzbiet
    November 13, 2009 at 22:49

    when comes to finding space `filelight` is ingenious tool.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: