O'Reilly logo

Ten Steps to Linux Survival by James Lehmer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Step 7: Filesystems

You have just seen how to look at real-time system state in terms of processes, memory, and networking. Now I show how to check out the filesystems, with an eye toward disk utilization.

Displaying Filesystems

On any computer system, running out of disk space can cause many problems. On Linux, two commands are helpful in determining disk utilization.

The df (display filesystems) command shows the mounted files systems along with statistics on space usage, as you can see in Figure 7-1.

df command
Figure 7-1. df command

The main device you’re interested in is the first one, which shows /dev/vda1 mounted on /. Note the columns showing disk size, Used, Available, and Use%.

Figure 7-2 shows an example where disk utilization may be causing trouble.

df full command
Figure 7-2. df showing full disk drive

The /dev/vda1 device is 100% full!

Where Did All the Disk Space Go?

Once you’ve seen that there may be a problem with disk space, how do you find out where it is being used? You can use the du (disk utilization) command for that. By default, it descends through every directory and shows you disk usage for every subdirectory under which it is invoked (think DIR /S on CMD.EXE). That can generate a lot of output and can take a long time to run.

What we really want to do is start at the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required