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 conﬁgure 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. Speciﬁcally, you must know how to create partitions and prepare ﬁlesystems 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 reconﬁgure 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 ﬁlesystem tasks—the ability to mount ﬁlesystems, check their health, and repair failing ﬁlesystems. Once a ﬁlesystem is mounted, you may want to periodically check to see how full it is, lest you run out of disk space.
What are BIOS essentials?
The BIOS provides two important functions: First, it conﬁgures 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 ﬁrmware, EFI, which performs these tasks on modern computers.
What files contain important hardware information?
There are many ﬁles under the /proc ﬁlesystem. Many of these ﬁles have been mentioned throughout this chapter. Familiarize yourself with these ﬁles, 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 speciﬁc 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 conﬁguration 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 conﬁgured, 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 ﬁlesystem, 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 ﬁles, /var for transient system ﬁles, /tmp for temporary user ﬁles, /boot for the kernel and other critical boot ﬁles, and more.
Which commands help you monitor disk usage?
The df command provides a one-line summary of each mounted ﬁlesystem’s size, available space, free space, and percentage of space used. The du command adds up the disk space used by all the ﬁles 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 ﬁlesystem-speciﬁc tools such as e2fsck and fsck.jfs . By whatever name, these programs examine a ﬁlesystem’s major data structures for internal consistency and can correct minor errors.
How filesystems are mounted in Linux?
The mount command ties a ﬁlesystem to a Linux directory; once the ﬁlesystem is mounted, its ﬁles can be accessed as part of the mount directory. The /etc/fstab ﬁle describes permanent mappings of ﬁlesystems to mount points; when the system boots, it automatically mounts the described ﬁlesystems unless they use the noauto option (which is common for removable disks).