Fundamentals 35 min read

How to Truly Understand Linux System Architecture

This article provides a comprehensive overview of Linux system architecture, covering the kernel, memory and process management, virtual file system, various file system types, shell variants, directory layout, disk partitioning, mounting mechanisms, and related kernel data structures.

Linux Tech Enthusiast
Linux Tech Enthusiast
Linux Tech Enthusiast
How to Truly Understand Linux System Architecture

Linux Kernel

The kernel is the core of the operating system, managing processes, memory, device drivers, the file system, and networking, which determines system performance and stability.

Kernel components include memory management, process management, device drivers, file system support, and network management. The system call interface (SCI) provides a multiplexed mechanism for user‑space to kernel calls; implementations reside in ./linux/kernel and architecture‑specific code in ./linux/arch.

Memory Management

Linux uses virtual memory, dividing physical memory into 4 KB pages. The SLAB allocator abstracts these pages for structure allocation and tracks usage. When memory is exhausted, pages are swapped to disk. Source code is located in ./linux/mm.

Process Management

Processes are independent execution entities. Linux achieves multitasking by time‑slicing and uses a priority‑based scheduler to select the next runnable process. Inter‑process communication mechanisms include signals, pipes, shared memory, semaphores, and sockets. System calls such as fork, exec, kill, and exit are provided via the SCI.

File System

Linux combines multiple file systems into a single hierarchical tree using a mount operation. The most common native file system is Ext2, but Linux also supports FAT, VFAT, FAT32, MINIX, and many others.

The Virtual File System (VFS) abstracts hardware details, offering a uniform API for operations like open, close, read, and write. VFS sits above specific file system implementations and below the buffer cache, which optimizes block access.

Device Drivers

Device drivers run in high‑privilege mode and expose abstract interfaces to the kernel. Errors in drivers can crash the system. Drivers are tied to hardware (e.g., SCSI vs. IDE) and reside in ./linux/drivers.

Network Interface (NET)

Linux supports BSD sockets and the full TCP/IP stack. The network subsystem consists of socket handling, protocol layers, and device drivers.

Linux 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.

File Types

Regular files (text, binaries)

Directory files

Link files (hard and symbolic)

Device files (block and character under /dev)

FIFO (named pipe) files

Socket files

Commands such as ls -l, file, and stat display file type information.

Directory Layout

Linux uses a single root directory ( /) with a tree structure. Key directories include: /bin – essential binaries /dev – device special files /etc – system configuration /home – user home directories /lib – shared libraries /sbin – system administration binaries /tmp – temporary files /root – root user’s home /mnt – mount points for temporary mounts /proc – virtual process information /var – variable data (logs, spools) /usr – secondary hierarchy for applications and libraries

Disk Partitions

Partitions are identified as /dev/hdX (IDE) or /dev/sdX (SCSI/SATA). Primary, extended, and logical partitions follow the traditional MBR scheme (max four primary/extended). Example fdisk -l output:

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 970 7791493+ 7 HPFS/NTFS
/dev/hda2 971 9729 70356667+ 5 Extended
/dev/hda5 971 2915 15623181 b W95 FAT32
/dev/hda6 2916 4131 9767488+ 83 linux
...

Each partition must be mounted to a directory before it can be accessed.

Mounting Filesystems

Mounting attaches a filesystem’s top‑level directory to a directory in the existing hierarchy, creating a unified view. The mount point must be a directory; mounting over a non‑empty directory hides its previous contents.

Typical mount command syntax: mount [-options] [device] [mount_point] Common options: -t – specify filesystem type -o – mount options (e.g., ro, rw, user, codepage=XXX)

Example: mounting a Windows FAT32 partition: # mount -t vfat /dev/hda5 /mnt/winc Automatic mounting at boot is configured in /etc/fstab. A sample entry list:

/dev/hda2 / ext3 defaults 1 1
/dev/hda1 /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda3 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,codepage=936,iocharset=gb2312 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/hdb1 /mnt/winc vfat defaults,codepage=936,iocharset=cp936 0 0
/dev/hda5 /mnt/wind vfat defaults,codepage=936,iocharset=cp936 0 0

Hard and Symbolic Links

Hard links share the same inode number; they cannot cross filesystem boundaries and do not increase disk usage. Symbolic (soft) links are special files containing a pathname to the target; they can span filesystems but become dangling if the target is removed.

Linux Applications

Typical Linux distributions ship with text editors, compilers, X Window System, office suites, internet tools, and databases.

Kernel Parameter Tuning

Kernel parameters are exposed via the /proc filesystem and can be adjusted at runtime to tune performance.

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.

KernelProcess ManagementLinuxVFSFilesystemMountDisk Partition
Linux Tech Enthusiast
Written by

Linux Tech Enthusiast

Focused on sharing practical Linux technology content, covering Linux fundamentals, applications, tools, as well as databases, operating systems, network security, and other technical knowledge.

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.