Chapter 03: Linux Structure and Installation Flashcards
Linux: What is the difference between a partition and a filesystem?
A partition is a logical part of the disk, whereas a filesystem is a method of storing/finding files on a hard disk (usually in a partition). By way of analogy, you can think of filesystems as being like family trees that show descendants and their relationships, while the partitions are like different families (each of which has its own tree).
Linux: What is the Filesystem Hierarchy Standard (FHS)?
Linux systems store their important files according to a standard layout called the Filesystem Hierarchy Standard, or FHS.
Linux: Where are new drives mounted?
New drives are mounted as directories in the single filesystem, often under /media (so, for example, a CD-ROM disc labeled FEDORA might end up being found at /media/FEDORA, and a file README.txt on that disc would be at /media/FEDORA/README.txt).
Linux: When is /usr used?
Many distributions distinguish between core utilities needed for proper system operation and other programs, and place the latter in directories under /usr (think “user”).
Linux: What is the first step in a linux boot?
BIOS: Starting an x86-based Linux system involves a number of steps. When the computer is powered on, the Basic Input/Output System (BIOS) initializes the hardware, including the screen and keyboard, and tests the main memory. This process is also called POST (Power On Self Test).
The BIOS software is stored on a ROM chip on the motherboard. After this, the remainder of the boot process is completely controlled by the operating system.
Linux: What happens when POST is completed in the boot process?
Once the POST is completed, the system control passes from the BIOS to the boot loader. The boot loader is usually stored on one of the hard disks in the system, either in the boot sector (for traditional BIOS/MBR systems) or the EFI partition (for more recent (Unified) Extensible Firmware Interface or EFI/UEFI systems). Up to this stage, the machine does not access any mass storage media. Thereafter, information on the date, time, and the most important peripherals are loaded from a small, battery-powered memory store called the CMOS values (after a technology used for the battery - which allows the system to keep track of the date and time even when it is powered off).
Linux: Name a bootloader and its purpose.
GRUB (for GRand Unified Boot loader)
When booting Linux, the boot loader is responsible for loading the kernel image and the initial RAM disk (which contains some critical files and device drivers needed to start the system) into memory.
Linux: Where is the boot loader located?
For systems using the BIOS/MBR method, the boot loader resides at the first sector of the hard disk also known as the Master Boot Record (MBR). The size of the MBR is just 512 bytes.
Linux: What is the first stage of the boot loader?
the boot loader examines the partition table and finds a bootable partition. Once it finds a bootable partition, it then searches for the second stage boot loader e.g, GRUB, and loads it into RAM (Random Access Memory).
Linux: What is the second stage of the boot loader?
The second stage boot loader resides under /boot. A splash screen is displayed which allows us to choose which Operating System (OS) to boot. After choosing the OS, the boot loader loads the kernel of the selected operating system into RAM and passes control to it.
The boot loader loads the selected kernel image (in the case of Linux) and passes control to it. Kernels are almost always compressed, so its first job is to uncompress itself. After this, it will check and analyze the system hardware and initialize any hardware device drivers built into the kernel.
Linux: What happens after the bootloader step in the boot process?
The boot loader loads both the kernel and an initial RAM–based file system (initramfs) into memory so it can be used directly by the kernel.
When the kernel is loaded in RAM, it immediately initializes and configures the computer’s memory and also configures all the hardware attached to the system. This includes all processors, I/O subsystems, storage devices, etc. The kernel also loads some necessary user space applications.
Linux: What happens in the initial filesystem image (initramfs) step in the boot process?
The initramfs filesystem image contains programs and binary files that perform all actions needed to mount the proper root filesystem, like providing kernel functionality for the needed filesystem and device drivers for mass storage controllers with a facility called udev (for User Device) which is responsible for figuring out which devices are present, locating the drivers they need to operate properly, and loading them. After the root filesystem has been found, it is checked for errors and mounted.
The mount program instructs the operating system that a filesystem is ready for use, and associates it with a particular point in the overall hierarchy of the filesystem (the mount point). If this is successful, the initramfs is cleared from RAM and the init program on the root filesystem (/sbin/init) is executed.
init handles the mounting and pivoting over to the final real root filesystem. If special hardware drivers are needed before the mass storage can be accessed, they must be in the initramfs image.
Linux: What happens when /sbin/init is called in the boot process?
Once the kernel has set up all its hardware and mounted the root filesystem, the kernel runs the /sbin/init program. This then becomes the initial process, which then starts other processes to get the system running. Most other processes on the system trace their origin ultimately to init; the exceptions are kernel processes, started by the kernel directly for managing internal operating system details.
Besides starting the system, init is responsible for keeping the system running and for shutting it down cleanly. It acts as the “manager of last resort” for all non-kernel processes, cleaning up after them when necessary, and restarts user login services as needed when users log in and out.
Linux: What is text-mode login, when does it happen in the boot process?
Near the end of the boot process, init starts a number of text-mode login prompts (done by a program called getty). These enable you to type your username, followed by your password, and to eventually get a command shell.
Linux: Explain the display manager service.
A service called the display manager keeps track of the displays being provided, and loads the X server (so-called because it provides graphical services to applications, sometimes called X clients). The display manager also handles graphical logins, and starts the appropriate desktop environment after a user logs in.