KC7MM Wiki

Amateur Radio with KC7MM

User Tools

Site Tools


linuxusernet:inside_linux:linuxfs_1

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:

  • Organize and access data for operations, communication, and storage.
  • Access the system's hardware resources:
    • Disk drives and other devices for data storage.
    • Ports to exchange data with external devices.

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.

  • 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.
  • In Linux:
    • Choose from many options: EXT4, btrfs, etc.
    • Formatted with one file system per partition.
    • No access until it's mounted to a location in the Linux file system.

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.

  • 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

  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

linuxusernet/inside_linux/linuxfs_1.txt · Last modified: 2022/04/08 16:28 by KC7MM