A Look Inside Linux series
A series of short topics on how Linux works and how to make it work
the way you want it to, which I present during the weekly sessions of the
Linux User Net. The target audience is Hams who are new to Linux
and want to know more about it, as well as experienced Linux users who can learn more
about their chosen operating system. These are my notes for the presentations. (Russ, KC7MM)
13. The Linux file system 1: Overview
I began to use Linux after a dozen or so years with MSDOS and Windows. Not surprisingly, my understanding of a file system was that it was a way of organizing data files on disk drives.
As a result, it took me long time to truly appreciate what the Linux file system actually is, and how I could take advantage of it to improve my use of Linux computers.
I'd like to help you quickly shoot up the learning curve that I climbed so laboriously. I want to show you things about the Linux file system that you can use to set up a Linux box that meets your particular needs.
Let's get started.
The need for a file system
Before you can make good use of the Linux file system, you need to understand what it is and how it works. For people like me, who came to Linux from Windows, it requires significant reorientation. So, let's start at the beginning.
In order to work, computers need a way to:
Organize and access data for operations, communication, and storage.
Access the system's hardware resources:
Approaches to file systems
There are two general types of file systems:
These are installed in partitions on physical storage devices.
This is the type most of us are familiar with. It's used to format disk drives, USB keys, and other block devices, so that data files can be written and read.
In MSDOS and Windows:
NTFS or FAT.
Based on the concept of named drives – C:, D:
Formatted with one drive per partition.
Local drives are available as soon as partitioned and formatted
Network drives have to be mapped before they can be used. (This can cause problems if network isn't available.)
To access, need to switch between drives.
A memory-based file system is virtual structure that works system-wide – quite literally “One file system to rule them all”.
This is the underlying concept employed for all Unix-style operating systems – including Linux, of course.
Created by the kernel at boot time
. It exists only when the computer is running, is reconstructed at every boot-up.
Is the sole means of access to all system resources, such as memory, data ports, storage devices.
Resources are accessed by being mounted
to a directory
in the file system tree.
For example, in the case of a storage device, its partitions are mounted to file system directories, one partition per directory. These directories can be located anywhere in the file system.
Programs can use a resource by reading data from, and writing data to, its directory.
How it works in Linux
On a Linux system, all computer resources are organized into a system-wide virtual file system.
Resources are accessed by being connected to locations on the Linux file system.
Files are data storage units that are given a unique identity and organized inside directories. Data is stored by writing it to a file, and is acquired by reading from a file.
A device's partitions are mounted to file system directories, one partition per directory. These directories can be located anywhere in the file system.
Programs can access storage by reading data from, and writing data to, its directory.
I/O ports are tied to directories by their device drivers. Programs interact with them by performing read and write operations on their directories. (Note this is the same as for storage.)
In the Linux file system, everything is treated as if it is a file.
The result of all this is that programs running under Linux need only know how to read from and write to files and directories, without knowing any details of what goes on behind them.
Next time, we'll look at the structure of the Linux file system. We'll concentrate on the bits that we users are likely to encounter when installing and running our Amateur Radio software.
Return to series index