Linux Operating Systems Fundamentals · Lesson 3
Configuring Hardware
Configuring Hardware: Trace firmware, devices, modules, storage, partitions, filesystems, mounts, and maintenance as one lifecycle.
Lesson purpose
Storage becomes usable only after Linux discovers it, partitions it, formats it, and mounts it safely. Trace firmware, devices, modules, storage, partitions, filesystems, mounts, and maintenance as one lifecycle.
Learning objectives
- Identify firmware, buses, devices, and kernel modules.
- Design and create storage layouts and filesystems.
- Mount, inspect, and maintain filesystems safely.
LPIC-1 exam focus
- 101.1 Determine and configure hardware settings
- 102.1 Design hard disk layout
- 104.1 Create partitions and filesystems
- 104.2 Maintain filesystem integrity
- 104.3 Control mounting and unmounting
Teaching sequence
1. BIOS and UEFI begin the boot chain
This comparison prevents students from treating related tools or layers as interchangeable.
| Side | Teaching point |
|---|---|
| Legacy BIOS | Initializes hardware, uses legacy boot conventions, and commonly pairs with MBR layouts. |
| UEFI | Provides a richer firmware environment and normally loads an .efi program from an EFI System Partition. |
Decision rule: Firmware discovers enough hardware to hand execution to a boot loader; it is not the Linux kernel.
2. Firmware screens expose platform settings
Use the visual as a pause point: ask students what evidence the screen or diagram provides before naming the setting or relationship.
- BIOS setup. Legacy BIOS setup screen from the source lesson
- EFI setup. EFI setup screen from the source lesson
Teaching point: Interfaces differ by vendor, but the administrative job is to identify boot, device, and security settings without guessing.
3. Linux exposes hardware through standard interfaces
The central idea is linux exposes hardware through standard interfaces. Use these points to explain the topic and connect it to the next command or decision.
- PCI. Internal buses connect controllers, network adapters, and other devices.
- USB. A host-controlled bus supports hot-pluggable peripherals.
- GPIO. General-purpose pins provide low-level interfaces on embedded systems.
- Kernel mediation. Drivers translate generic kernel operations into device-specific behavior.
4. /dev names devices for user-space tools
The central idea is /dev names devices for user-space tools. Use these points to explain the topic and connect it to the next command or decision.
- Device nodes. Special files represent block and character devices.
- Block devices. Storage devices transfer addressable blocks and appear as names such as /dev/sda.
- Device mapper. /dev/mapper represents mapped devices such as LVM and encrypted volumes.
- Persistent names. /dev/disk links identify devices by UUID, label, path, or hardware identity.
5. /proc and /sys expose different kernel views
This comparison prevents students from treating related tools or layers as interchangeable.
| Side | Teaching point |
|---|---|
| /proc | Presents process data plus selected runtime kernel and hardware information such as interrupts and I/O ports. |
| /sys | Organizes devices, drivers, buses, classes, and kernel attributes in a device model. |
Decision rule: These are virtual, kernel-populated filesystems—not ordinary data stored on disk.
6. Hardware tools ask targeted questions
Use this example to show how hardware tools ask targeted questions works in a controlled environment.
- lsdev and lsblk. Summarize devices or block-device topology.
- lspci and lsusb. Inventory devices attached to PCI and USB buses.
- Evidence. Combine command output with /proc and /sys when troubleshooting a driver or resource issue.
$ lsblk -f
$ lspci -nnk
$ lsusb
$ cat /proc/interrupts
7. Modules add and remove kernel capabilities
Use this example to show how modules add and remove kernel capabilities works in a controlled environment.
- Inspect. lsmod lists loaded modules; modinfo reads metadata and parameters.
- Load. modprobe resolves dependencies; insmod loads one explicit module file.
- Remove. modprobe -r resolves dependents; rmmod removes one named module.
$ lsmod
$ modinfo btusb
$ sudo modprobe btusb
$ sudo modprobe -r btusb
8. Drive technologies differ in interface and behavior
Use the matrix to contrast the named choices before students select a command or configuration.
| Item | Meaning |
|---|---|
| PATA | Legacy parallel interface with older device naming conventions |
| SATA | Common serial interface for HDDs and SSDs |
| SCSI / SAS | Command set and interfaces common in servers and enterprise storage |
| NVMe | PCIe-based protocol optimized for solid-state storage |
| HDD vs SSD | Mechanical latency versus flash performance and wear behavior |
Teaching point: Linux device naming reflects drivers and topology; do not infer a device’s contents from its name alone.
9. Device names describe disks and partitions
The central idea is device names describe disks and partitions. Use these points to explain the topic and connect it to the next command or decision.
- Whole disk. /dev/sda identifies a disk exposed by the storage driver.
- Partition. /dev/sda1 identifies a numbered partition on that disk.
- NVMe partition. /dev/nvme0n1p1 uses p to separate device and partition numbers.
- Discovery order. Names can change; use UUIDs or labels for persistent mount configuration.
10. MBR and GPT define partition metadata
This comparison prevents students from treating related tools or layers as interchangeable.
| Side | Teaching point |
|---|---|
| MBR | Legacy table with primary/extended partition constraints and historical BIOS pairing. |
| GPT | Modern table with redundant metadata, GUID identifiers, and normal UEFI pairing. |
Decision rule: Choose a table that matches platform and boot requirements; changing it can destroy access to existing partitions.
11. Legacy MBR uses primary and logical partitions
Use the visual as a pause point: ask students what evidence the screen or diagram provides before naming the setting or relationship.
- Partition structure. Diagram of primary, extended, and logical partitions from the source lesson
Teaching point: An extended partition is a container for logical partitions; GPT removes this legacy primary-versus-logical structure.
12. Partitions separate storage responsibilities
The central idea is partitions separate storage responsibilities. Use these points to explain the topic and connect it to the next command or decision.
- Root and boot. Provide the system tree and, when needed, boot-specific files.
- Home. Separates user data from the operating-system partition.
- Variable data. /var may be isolated when logs, queues, or services can grow.
- Swap. Provides disk-backed virtual memory or hibernation support; it is not persistent file storage.
13. Abstraction improves resilience and flexibility
The central idea is abstraction improves resilience and flexibility. Use these points to explain the topic and connect it to the next command or decision.
- Multipath. Presents multiple physical routes to one storage target as a managed device.
- LVM. Maps physical volumes into volume groups and flexible logical volumes.
- RAID. Combines devices for performance, redundancy, or both according to the selected level.
- Tradeoff. Abstraction improves capability but adds metadata, monitoring, and recovery requirements.
14. LVM separates physical capacity from filesystems
Use this example to show how lvm separates physical capacity from filesystems works in a controlled environment.
- Physical volume. Initializes a disk or partition for LVM.
- Volume group. Pools one or more physical volumes.
- Logical volume. Allocates a virtual block device from the pool.
$ sudo pvcreate /dev/sdb1
$ sudo vgcreate vgdata /dev/sdb1
$ sudo lvcreate -L 10G -n lvapps vgdata
$ sudo mkfs.ext4 /dev/vgdata/lvapps
15. RAID levels trade capacity, speed, and fault tolerance
Use the matrix to contrast the named choices before students select a command or configuration.
| Item | Meaning |
|---|---|
| RAID 0 | Striping; performance and capacity, no redundancy |
| RAID 1 | Mirroring; redundancy with reduced usable capacity |
| RAID 5 | Distributed single parity; tolerates one device failure |
| RAID 6 | Dual parity; tolerates two device failures |
| RAID 10 | Mirrored stripes; speed and redundancy with more devices |
Teaching point: RAID is not a backup: it does not protect against deletion, corruption, or site loss.
16. Partition tools target different table styles
This comparison prevents students from treating related tools or layers as interchangeable.
| Side | Teaching point |
|---|---|
| fdisk | Interactive partitioning commonly used with MBR and now capable of GPT on modern versions. |
| gdisk and parted | gdisk is GPT-focused; GNU parted supports scriptable operations and multiple table types. |
Decision rule: Confirm the target device, units, table type, and pending changes before writing metadata.
17. A safe partition workflow verifies before writing
Use this example to show how a safe partition workflow verifies before writing works in a controlled environment.
- Inspect. List devices, mounts, and the current partition table.
- Plan. Choose table, boundaries, type codes, and alignment.
- Write and rescan. Commit changes only after review, then verify the kernel’s view.
$ lsblk
$ sudo fdisk -l /dev/sdb
$ sudo fdisk /dev/sdb
# review with p before w
$ lsblk /dev/sdb
18. Graphical tools still change real metadata
The central idea is graphical tools still change real metadata. Use these points to explain the topic and connect it to the next command or decision.
- GParted. Provides a visual queue of partition operations.
- Pending operations. Changes may not occur until explicitly applied.
- Unmount requirement. Many resize or filesystem operations require an unmounted partition.
- Recovery plan. Back up important data and know how to restore the partition table before editing.
19. GParted makes pending changes visible
Use the visual as a pause point: ask students what evidence the screen or diagram provides before naming the setting or relationship.
- GParted workspace. GParted partition view from the source lesson
Teaching point: The visual queue improves review, but applying the queue still writes destructive partition and filesystem changes.
20. One virtual directory joins many filesystems
The central idea is one virtual directory joins many filesystems. Use these points to explain the topic and connect it to the next command or decision.
- Root /. Every absolute path begins at the root directory.
- Mount point. A directory becomes the access point for another filesystem.
- Absolute path. Names the route from / regardless of current location.
- Relative path. Names the route from the current working directory.
21. FHS paths communicate system purpose
Use the matrix to contrast the named choices before students select a command or configuration.
| Item | Meaning |
|---|---|
| /boot | Boot loader and kernel-related files |
| /etc | System configuration |
| /home | User home directories |
| /usr | Shareable programs and data |
| /var | Variable logs, queues, caches, and service data |
| /tmp | Temporary files |
| /opt | Add-on application software |
| /media and /mnt | Removable or administrative mount points |
Teaching point: A separate partition is a design choice; the directory’s FHS role remains the same either way.
22. Filesystem choice follows workload and compatibility
Use the matrix to contrast the named choices before students select a command or configuration.
| Item | Meaning |
|---|---|
| ext4 | General-purpose Linux filesystem with journaling |
| XFS | High-performance journaling filesystem common on large systems |
| Btrfs | Copy-on-write Linux filesystem with advanced volume features |
| VFAT / exFAT | Broad removable-media interoperability |
| NTFS | Windows-native filesystem with Linux driver support |
| ISO 9660 / UDF | Optical and image media formats |
| swap | Virtual-memory space rather than persistent file storage |
Teaching point: The source deck contains legacy descriptions; use current Linux driver support and local requirements when choosing a filesystem.
23. mkfs creates a filesystem on a block device
Use this example to show how mkfs creates a filesystem on a block device works in a controlled environment.
- Target. The command writes filesystem metadata to a partition or logical volume.
- Type. Use the appropriate mkfs front end, such as mkfs.ext4 or mkfs.xfs.
- Destructive boundary. Formatting destroys the prior filesystem’s accessible metadata.
$ sudo mkfs.ext4 -L DATA /dev/sdb1
$ sudo mkswap -L SWAP2 /dev/sdb2
$ lsblk -f
24. A manual mount binds device to directory
Use this example to show how a manual mount binds device to directory works in a controlled environment.
- Device. Use a verified device path, UUID, or label.
- Mount point. Create an appropriate directory in the virtual tree.
- Options. Type and mount options control behavior and safety.
$ sudo mkdir -p /mnt/data
$ sudo mount -t ext4 /dev/sdb1 /mnt/data
$ findmnt /mnt/data
$ sudo umount /mnt/data
25. /etc/fstab makes mounts persistent
Use this example to show how /etc/fstab makes mounts persistent works in a controlled environment.
- Source. Prefer UUID= or LABEL= to unstable discovery names.
- Target and type. Identify the mount point and filesystem driver.
- Options and checks. Declare mount behavior, dump flag, and fsck pass order.
UUID=... /data ext4 defaults 0 2
$ sudo mount -a
$ findmnt --verify
$ blkid /dev/sdb1
26. Swap space must be created and activated
Use this example to show how swap space must be created and activated works in a controlled environment.
- mkswap. Writes swap-space metadata.
- swapon and swapoff. Activate or deactivate the area.
- Persistence. An fstab entry activates swap during boot.
$ sudo mkswap /dev/sdb2
$ sudo swapon /dev/sdb2
$ swapon --show
$ free -h
27. Usage tools answer different capacity questions
Use the matrix to contrast the named choices before students select a command or configuration.
| Item | Meaning |
|---|---|
| df | Allocated and available space by mounted filesystem |
| du | Space attributed to directories and files |
| iostat | Device throughput, utilization, and wait indicators |
| blkid | Filesystem type, UUID, and label metadata |
| lsblk -f | Block topology plus filesystem and mount information |
Teaching point: df and du measure different layers; divergence can be legitimate, such as deleted-but-open files.
28. Integrity checks require the right operating state
Use this example to show how integrity checks require the right operating state works in a controlled environment.
- fsck. Front end that dispatches the filesystem-specific checker.
- Unmount first. Most repairs require an unmounted filesystem to avoid concurrent changes.
- Evidence. Review logs, SMART/device health, and backups before treating every error as logical corruption.
$ findmnt /dev/sdb1
$ sudo umount /dev/sdb1
$ sudo fsck -f /dev/sdb1
29. Filesystem-specific tools expose deeper metadata
The central idea is filesystem-specific tools expose deeper metadata. Use these points to explain the topic and connect it to the next command or decision.
- dumpe2fs. Displays ext filesystem superblock and group information.
- e2label. Reads or changes an ext filesystem label.
- debugfs. Provides low-level ext inspection and recovery capabilities.
- chattr. Changes supported filesystem attributes such as immutable or append-only.
30. Apply the lesson to four scenarios
Ask these questions before revealing the answer key. Require students to name the evidence or command that supports each choice.
- A new disk appears in lsblk but has no usable path in the directory tree. What lifecycle steps remain?
- An fstab entry uses /dev/sdb1 and fails after device discovery order changes. What should replace it?
- A mounted ext4 filesystem reports errors. What state is normally required before repair?
- A team calls RAID 1 a backup. What risk remains uncovered?
31. Connect each scenario to the governing clue
Use these answers to debrief the knowledge check. The explanation matters as much as the label.
- Partition, format, and mount. Create the intended partition table and partition, build a filesystem, then mount it.
- UUID= or LABEL=. Use persistent filesystem identity instead of a discovery-order name.
- Unmounted. Stop use, unmount when possible, and run the filesystem-specific check with a recovery plan.
- Deletion and corruption. Mirroring repeats logical mistakes; maintain independent, tested backups.
32. Three takeaways resolve the lesson
Close the lesson by asking students to restate the decision rule behind each takeaway.
- Discovery precedes configuration. Firmware, buses, device nodes, virtual filesystems, tools, and modules establish what Linux can see.
- Storage is layered. Partition tables, RAID/LVM, filesystems, and mounts each solve a distinct problem.
- Verification protects data. Confirm targets, persistent identities, operating state, capacity evidence, and backups before changes.
Next lesson connection: Managing Files.
Classroom application
Use a disposable VM or lab account for commands that can modify packages, processes, partitions, filesystems, ownership, or permissions. Require students to state the target and expected effect before they run a command.
- Inventory a lab disk with
lsblk,lspci, andblkid, then state which evidence is needed before partitioning or formatting it. - Design a small GPT layout, explain the role of each partition, and compare direct partitions with LVM, RAID, and swap.
- Create a filesystem in a disposable environment, mount it temporarily, write a persistent
fstabentry using UUID or LABEL, and validate it withmount -aandfindmnt --verify.
Common misconceptions
- Firmware, the boot loader, the kernel, a partition table, a filesystem, and a mount point are different layers.
- RAID improves availability or performance according to its level, but it does not replace independent backups against deletion, corruption, or site loss.
- A device name such as
/dev/sdb1reflects discovery order. UUID or LABEL is the safer persistent identity for/etc/fstab. - Formatting is destructive metadata creation. Confirm the target and recovery plan before running
mkfs,mkswap, or a partition write operation.
Lesson summary
- Discovery precedes configuration. Firmware, buses, device nodes, virtual filesystems, tools, and modules establish what Linux can see.
- Storage is layered. Partition tables, RAID/LVM, filesystems, and mounts each solve a distinct problem.
- Verification protects data. Confirm targets, persistent identities, operating state, capacity evidence, and backups before changes.
The next lesson is Managing Files.
Course Notes