Summary

Most Linux tools and procedures provide a layer around the hardware, insulating you from a need to know too many details. Nonetheless, sometimes you have to dig in and configure hardware directly. Firmware settings can control onboard devices such as hard disk controllers and USB ports. USB and SCSI devices have their own quirks, and USB in particular is quickly evolving.

Hard disks are one class of hardware that’s likely to require more attention than most. Specifically, you must know how to create partitions and prepare filesystems on those partitions. These tasks are necessary when you install Linux (although most distributions provide GUI tools to help guide you through this task during installation), when you add a hard disk, or when you reconfigure an existing system. You should also know something about boot managers. These programs help get Linux up and running when you turn on a computer’s power, so they’re unusually critical to Linux operation.

Filesystem management is basic to being able to administer or use a Linux system. The most basic of these basic tasks are filesystem tasks—the ability to mount filesystems, check their health, and repair failing filesystems. Once a filesystem is mounted, you may want to periodically check to see how full it is, lest you run out of disk space.

FAQ

What are BIOS essentials?

The BIOS provides two important functions: First, it configures hardware—both hardware that’s built into the motherboard and hardware on many types of plug-in cards. Second, the BIOS begins the computer’s boot process, passing control on to the boot loader in the MBR. The BIOS is currently being retired in favor of a new type of firmware, EFI, which performs these tasks on modern computers.

What files contain important hardware information?

There are many files under the /proc filesystem. Many of these files have been mentioned throughout this chapter. Familiarize yourself with these files, such as /proc/ioports , /proc/interrupts , /proc/dma , /proc/bus/usb , and others.

What is Linux’s model for managing USB hardware?

Linux uses drivers for USB controllers. These drivers in turn are used by some device-specific drivers (for USB disk devices, for instance) and by programs that access USB hardware via entries in the /proc/bus/usb directory tree.

How to obtain information about PCI and USB devices?

The lspci and lsusb programs return information about PCI and USB devices, respectively. You can learn manufacturers’ names and various configuration options by using these commands.

What are common disk types and their features?

PATA disks were the most common type on PCs until about 2005. Since then, SATA disks, which are more easily configured, have gained substantially in popularity. SCSI disks have long been considered the top-tier disks, but their high price has kept them out of inexpensive commodity PCs.

What is the purpose of disk partitions?

Disk partitions break the disk into a handful of distinct parts. Each partition can be used by a different OS, can contain a different filesystem, and is isolated from other partitions. These features improve security and safety and can greatly simplify running a multi-OS system.

What are important Linux disk partitions?

The most important Linux disk partition is the root ( / ) partition, which is at the base of the Linux directory tree. Other possible partitions include a swap partition, /home for home directories, /usr for program files, /var for transient system files, /tmp for temporary user files, /boot for the kernel and other critical boot files, and more.

Which commands help you monitor disk usage?

The df command provides a one-line summary of each mounted filesystem’s size, available space, free space, and percentage of space used. The du command adds up the disk space used by all the files in a specified directory tree and presents a summary by directory and sub-directory.

Which tools help you keep a filesystem healthy?

The fsck program is a front-end to filesystem-specific tools such as e2fsck and fsck.jfs . By whatever name, these programs examine a filesystem’s major data structures for internal consistency and can correct minor errors.

How filesystems are mounted in Linux?

The mount command ties a filesystem to a Linux directory; once the filesystem is mounted, its files can be accessed as part of the mount directory. The /etc/fstab file describes permanent mappings of filesystems to mount points; when the system boots, it automatically mounts the described filesystems unless they use the noauto option (which is common for removable disks).