logo
OpenSource Apache Embedded?C Linux MySQL No deposit no GamStop bonuses Perl PHP Samba

Module Release February 2003: Maintain the Integrity of Filesystems

This month's offering is primarily about keeping your filesystems in good order. To do that, of course, you have to know a thing or two about how filesystems work internally and how they store data on physical disks.

The module begins with a reminder about how inodes are used to index file data on disks, recording metadata about the file. e.g., its type (file/directory/device), modification time, permissions, etc.

The module identifies common threats to the integrity of a filesystem, (e.g., running out of space, corruption, running out of available inodes, etc.) plus the most obvious insurance against them: monitoring and checking.

The df command provides the means to check both disk space (its primary purpose) and get information about the inodes on mounted filesystems. By contrast the du command shows information about disk space used in a directory tree, with its various options providing different viewpoints.

Having identified a problem, the fsck (filesystem check) command allows you to find and repair filesystem corruption. The command has two parts; the ?driver? program fsck which handles any filesystem type, and a ?backend? program which caters for specific filestystem types (e.g., the backend program for the ext2 filesystem type is e2fsck, but it is usually invoked through fsck).

The module ends with an explanation of how to run fsck and a set of exercises to practice the main commands involved in maintaining filesystem integrity.