Table of Contents

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

Introduction

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:

Approaches to file systems

There are two general types of file systems:

1. Hardware-based

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.

2. Memory-based

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.

How it works in Linux

  1. On a Linux system, all computer resources are organized into a system-wide virtual file system.
  2. 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.
    • Storage devices are block devices, which move data in chunks.
      • 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.)
      • A device driver implements a standard interface for a device, translating standard read/write operations on one side to the inner workings of the device on the other side.
  3. In the Linux file system, everything is treated as if it is a file.
    • Files can be read from or written to. (Program files can be executed – more about that in Part 2)
    • The same read/write access applies to directories that have attached devices.
  4. 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.

What's next

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