Module Release September 2002: Filesystem Concepts and Symbolic Links
This month's 2 module release begins a series of modules on Unix filesystems. The first module, introduces or clarifies the basic filesystem concepts which crop up in this series. The second module provides a basic introduction to the nature and use of symbolic links.
The ‘concepts’ module starts by identifying a potential confusion over the term filesystem. The module deals only with the unified unix filesystem, i.e. the arrangement of local and remote files, directories and devices into a single tree-like hierarchy. The module does not concern itself with ‘filesystem types’, i.e. the formatting systems used to organise blocks of data on devices like hard drives.
The most important part of the concepts module is a simple explanation of how inodes work. Understanding inodes is the key to understanding symbolic links and the organisation of files in Unix. An inode is the data structure that describes a file on an individual filesystem. It contains information about the file, including its type (file/directory/device), size, modification time, permissions, etc. For most purposes one can regard an inode as being the file itself. By contrast a directory is, in essence, a file containing an index of the names and inode numbers for the files stored in one part of the hierarchy.
The symbolic links module demonstrates how Unix's separation of filenames in directory indexes from file data in inodes, enables both the unified filesystem and the use of symbolic links. Symbolic links enable one to present a file or directory from one part of the unified filesystem in any other branch of it (a bit like MS-Windows short-cuts). Because the LPI exam mandates knowledge of so-called ‘hard links’, they is discussed, but there really is no good reason to use hard links nor should you find anyone else doing so. Symbolic links provide all the useful functionality of hard links and none of their disadvantages, e.g. symbolic links can create direct links between resources on completely different filesystems, computers or even networks.
|