Skip to content

8.3 System Monitoring

1. fstab

This file is located at /etc/fstab. This is a filesystem table containing system configuration in Unix-like Operating System. We can find data about filesystems and their mount points. Each line contains:

<file system> This is the device or partition to mount. We might see something like /dev/sda1.

<mount point> The location where the filesystem will be mounted.

<type> This is the filesystem type such as ext4 or ntfs.

<options> Mount options such as defaults or errors=remount-ro.

<dump> AND <pass> The last two columns are represented with 0 or 1. These fields are used by commands dump and fsck for filesystem backup and checking.

2. df

Command df (Disk Free) displays information on how much space is used and available on filesystems.

3. du

Command du (Disk Usage) can be used to estimate file/directory space usage on Unix-like OS. The calculation is done recursively. It might seem like this do the same thing as command df. However, it has some differences:

df information is broader including filesystem data, while du is focused on (even specific) file/directory space usage. • df operates at filesystem level, while du operates on file/directory level. • df is useful to identify which filesystem that is almost full. Then, use du to pinpoint the area that consumes the most space.

4. /proc/cpuinfo and /proc/meminfo

These two files are important to observe information about CPU (processor) and memory (RAM). Some of the information included in cpuinfo includes: Processor type, CPU speed, CPU cores, cache sizes, etc. While meminfo contains information such as: Total memory, free and used memory, buffer and cache, swap space usage, etc.

5. vmstat and free

These two commands can also be used to access information about system memory (RAM). Please let them try running the commands. How are these different from /proc/meminfo? Here are some differences:

meminfo provides detailed information on memory usage and memory-related statistics. vmstat has a wider range of statistics including CPU activity and disk I/O. free provides detailed information about physical and swap memory. Basically the details are different.

vmstat is useful for real-time monitoring, while free is good for quick memory status check. meminfo is very useful for systematic access of information via programming.

6. uname

uname prints system information on the kernel of the system and its OS. Encourage them to read the manual to use the command to find various information.

7. dmesg

This command dmesg has been used before in Device Driver (kernal driver) section. This can be used to access the kernel log. One usage of this is to show the latest kernel error messages.