Fundamentals 35 min read

Understanding Linux: Kernel, Shell, Filesystem, and Core Components

This article provides a comprehensive overview of Linux’s core architecture, detailing the kernel, shell, memory and process management, virtual file system, various file system types, directory structures, partitioning, mounting procedures, and link mechanisms, offering readers a solid foundation for mastering Linux systems.

IT Architects Alliance
IT Architects Alliance
IT Architects Alliance
Understanding Linux: Kernel, Shell, Filesystem, and Core Components

Linux System Overview

Linux is typically divided into four major parts: kernel, shell, file system, and applications. These layers work together to allow users to run programs, manage files, and interact with hardware.

1. Kernel

The kernel is the core of the OS, handling process scheduling, memory management, device drivers, file systems, and networking. Its source code resides in ./linux/kernel, with architecture‑specific code in ./linux/arch.

1.1 Memory Management

Linux uses virtual memory, dividing physical memory into 4 KB pages. The slab allocator abstracts these pages for efficient allocation. When memory runs out, pages are swapped to disk. Source code is in ./linux/mm.

1.2 Process Management

Processes are scheduled using time slices; the scheduler selects the next runnable process based on priority. Linux provides inter‑process communication mechanisms such as signals, pipes, shared memory, semaphores, and sockets. System calls like fork, exec, kill, and exit are exposed via the SCI layer.

1.3 File System Layer

Linux adopts a unified virtual file system (VFS) that abstracts underlying file system implementations. VFS presents a common API (open, close, read, write) and sits above concrete file systems such as ext2, ext3, FAT, VFAT, NTFS, etc. The VFS code lives in ./linux/fs.

1.4 Device Drivers

Device drivers run in kernel space with high privileges, providing hardware‑specific operations while exposing generic interfaces to the rest of the OS. Errors in drivers can crash the system.

1.5 Network Stack

The network subsystem implements BSD sockets and the full TCP/IP protocol suite. It consists of protocol layers and network device drivers, all located under ./linux/net.

2. Shell

The shell is the user interface that interprets commands and forwards them to the kernel. Common shells include Bourne Shell, Bash (the default on most distributions), Korn Shell, and C Shell.

3. Files and Directories

3.1 File Types

Regular files (text, binaries)

Directory files

Link files (hard and symbolic)

Device files (block and character)

FIFO (named pipes)

Socket files

3.2 Directory Structure

Linux uses a single hierarchical tree rooted at /. Important top‑level directories include /bin, /sbin, /etc, /home, /usr, /var, /dev, /proc, and /tmp. Each serves a specific purpose, e.g., /usr holds most user applications and libraries.

3.3 Partition Types

Linux recognizes primary, extended, and logical partitions. Device names follow /dev/hdX or /dev/sdX conventions, where X is the drive letter and the number denotes the partition.

3.4 Mounting

Mounting attaches a file system to a directory, making its contents accessible under that mount point. The command syntax is: mount [-options] device mount_point Common options include -t to specify the file system type, -o for mount flags such as ro, rw, user, etc. Entries in /etc/fstab automate mounting at boot.

3.5 Links

Hard links point directly to the same inode as the original file and cannot cross file system boundaries. Symbolic (soft) links are special files that store the pathname of the target and can span partitions. The ln command creates both types ( ln source link for hard links, ln -s source link for symbolic links).

4. VFS Internals

Key kernel structures include:

file : represents an opened file, holds flags and file position.

inode : stores metadata and pointers to data blocks.

dentry : caches directory entries to speed path lookup.

super_block : contains file system‑wide information such as block size.

file_operations and inode_operations : tables of function pointers implementing file and inode actions.

These structures enable the VFS to provide a uniform interface for diverse file systems.

5. Common Administration Commands

fdisk -l

– list disk partitions. mount / umount – mount and unmount file systems. ls, cd, mkdir, rmdir – navigate and manage directories. cp, mv, rm – copy, move, and delete files. chmod, chown, chgrp – modify permissions and ownership. find, locate, which – locate files.

6. Kernel Parameter Tuning

Linux kernel parameters are exposed via the /proc filesystem and can be adjusted at runtime to improve performance, e.g., networking buffers, virtual memory settings, and scheduler options.

Linux system components diagram
Linux system components diagram
Kernel architecture diagram
Kernel architecture diagram
File system hierarchy
File system hierarchy
ext2 file system layout
ext2 file system layout
FAT file system data flow
FAT file system data flow
Hard vs soft links illustration
Hard vs soft links illustration
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

KernelOperating SystemShellSystem AdministrationFilesystem
IT Architects Alliance
Written by

IT Architects Alliance

Discussion and exchange on system, internet, large‑scale distributed, high‑availability, and high‑performance architectures, as well as big data, machine learning, AI, and architecture adjustments with internet technologies. Includes real‑world large‑scale architecture case studies. Open to architects who have ideas and enjoy sharing.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.