Mastering Linux: Core Components, Kernel, Filesystems, and Shell Explained
This comprehensive guide explores Linux's four main components—kernel, shell, filesystem, and applications—detailing kernel architecture, memory and process management, VFS, device drivers, networking, file types, directory structures, mounting, and practical commands for managing partitions and links.
Linux Kernel
The kernel is the core of the operating system, handling processes, memory, device drivers, files, and networking, which determines system performance and stability. It consists of memory management, process management, device drivers, filesystem, and network management.
System call interface (SCI) provides mechanisms for user‑space to kernel function calls; implementations can be found in ./linux/kernel and architecture‑specific parts in ./linux/arch.
Memory Management
Linux uses virtual memory, dividing memory into 4 KB pages and employing mechanisms such as the SLAB allocator to manage page usage, allowing dynamic adjustment based on system needs. When physical memory is exhausted, pages are swapped to disk. Source code resides in ./linux/mm.
Process Management
Processes are independent execution entities. Linux achieves multitasking by time‑slicing and scheduling based on priority. Each process has its own address space, and inter‑process communication mechanisms include signals, pipes, shared memory, semaphores, and sockets. The kernel provides APIs for creating (fork, exec), terminating (kill, exit), and synchronizing processes.
Filesystem
Unlike DOS/Windows, Linux organizes filesystems into a hierarchical tree without drive letters. The Virtual File System (VFS) abstracts hardware details, offering a uniform API for operations like open, close, read, and write. Filesystem implementations (e.g., Ext2, Ext3, FAT, VFAT, NTFS, XFS) reside under ./linux/fs. VFS sits above a buffer cache layer, which in turn interfaces with device drivers.
Device Drivers
Device drivers run in high‑privilege mode to interact directly with hardware. Errors in drivers can crash the system. Drivers provide abstract interfaces for the kernel while handling hardware‑specific details.
Network Interface (NET)
Linux supports BSD sockets and the full TCP/IP suite. The network stack comprises socket interfaces, protocol layers, and device drivers, enabling communication over various hardware.
Linux Shell
The shell is the user interface that interprets commands and passes them to the kernel. Common shells include Bourne Shell, Bash (GNU Bourne Again Shell), Korn Shell, and C Shell.
Linux Filesystem Types
Ext2, Ext3 (native Linux filesystems)
FAT, VFAT, FAT32 (Windows compatibility)
NTFS, HPFS, ISO9660, XFS, JFS, ReiserFS, etc.
Each filesystem type requires appropriate mounting; the mount command syntax is mount [-options] [device] [mount_point]. Common options include -t to specify the filesystem type and -o for mount flags such as ro, rw, user, nouser.
File Types
Regular files (text, binary)
Directory files
Link files (hard and symbolic)
Device files (block and character devices under /dev)
FIFO (named pipes)
Socket files
Commands like ls -l, file, and stat display file type information.
Directory Structure
Linux uses a single root (/) with standard directories such as /bin, /sbin, /etc, /dev, /proc, /var, /home, /usr, /tmp, /mnt, and /lost+found. Each directory serves a specific purpose, e.g., /usr contains applications and libraries, /proc is a virtual filesystem exposing kernel data.
Disk Partitions
Partitions are identified as /dev/hdX or /dev/sdX (e.g., /dev/sda1). Primary, extended, and logical partitions follow the traditional MBR scheme; logical partitions reside within an extended partition.
# fdisk -l</code><code>Disk /dev/hda: 80.0 GB, 80026361856 bytes</code><code>255 heads, 63 sectors/track, 9729 cylinders</code><code>Units = cylinders of 16065 * 512 = 8225280 bytes</code><code>Device Boot Start End Blocks Id System</code><code>/dev/hda1 * 1 970 7791493+ 7 HPFS/NTFS</code><code>/dev/hda2 971 9729 70356667+ 5 Extended</code><code>/dev/hda5 971 2915 15623181 b W95 FAT32</code><code>/dev/hda6 2916 4131 9767488+ 83 linux</code><code>/dev/hda7 4132 5590 11719386 83 linux</code><code>/dev/hda8 5591 6806 9767488+ 83 linux</code><code>/dev/hda9 6807 9657 22900626 83 linux</code><code>/dev/hda10 9658 9729 578308+ 82 linux swap / SolarisEach partition must be mounted to a directory before use.
Mounting Filesystems
Mounting attaches a filesystem's root to a directory (the mount point). Example: mkdir /mnt/winc && mount -t vfat /dev/hda5 /mnt/winc. The /etc/fstab file lists filesystems to mount automatically at boot, with fields for device, mount point, type, and options.
/dev/hda2 / ext3 defaults 1 1</code><code>/dev/hda1 /boot ext3 defaults 1 2</code><code>none /dev/pts devpts gid=5,mode=620 0 0</code><code>none /proc proc defaults 0 0</code><code>none /dev/shm tmpfs defaults 0 0</code><code>/dev/hda3 swap swap defaults 0 0</code><code>/dev/cdrom /mnt/cdrom iso9660 noauto,codepage=936,iocharset=gb2312 0 0</code><code>/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0</code><code>/dev/hdb1 /mnt/winc vfat defaults,codepage=936,iocharset=cp936 0 0</code><code>/dev/hda5 /mnt/wind vfat defaults,codepage=936,iocharset=cp936 0 0Links
Hard links share the same inode; they cannot cross filesystem boundaries. Symbolic (soft) links are special files containing the target path and can span filesystems. Deleting the original file invalidates a soft link but not a hard link.
VFS Internals
Each process has a file descriptor table pointing to struct file objects, which reference struct file_operations (function pointers for read, write, etc.). The struct dentry cache maps path components to inodes, reducing disk lookups. Inodes point to struct super_block, which holds filesystem metadata such as block size.
Linux Applications
Typical Linux distributions include editors, compilers, X Window system, office suites, internet tools, and databases.
Linux Kernel Parameter Optimization
Kernel parameters are exposed via the /proc filesystem, allowing runtime tuning of performance characteristics.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Efficient Ops
This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
