Linux Flashcards
(296 cards)
The Red Hat Family
Red Hat Enterprise Linux (RHEL), CentOS, Scientific Linux and Oracle Linux
Key Facts About the Red Hat Family
- It often serves as an upstream testing platform for RHEL.
- CentOS and Scientific Linux are close clones of RHEL, while Oracle Linux is mostly a copy with some changes.
- Kernel version 3.10 is used in RHEL/CentOS 7.
- It supports hardware platforms such as x86, x86-64, Itanium, PowerPC, and IBM System z.
- It uses the RPM-based yum package manager (we cover it in more detail later) to install, update, and remove packages in the system.
- RHEL is widely used by enterprises which host their own systems.
The SUSE Family
SUSE, SUSE Linux Enterprise Server (SLES), and openSUSE
Key Facts About the SUSE Family
- SUSE Linux Enterprise Server (SLES) is upstream for openSUSE.
- Kernel version 4.12 is used in openSUSE Leap 15.
- It uses the RPM-based zypper package manager (we cover it in more detail later) to install, update, and remove packages in the system.
- It includes the YaST (Yet Another Setup Tool) application for system administration purposes.
- SLES is widely used in retail and many other sectors.
The Debian Family
Ubuntu, Linux Mint etc
Key Facts About the Debian Family
- The Debian family is upstream for Ubuntu, and Ubuntu is upstream for Linux Mint and others.
- Kernel version 4.15 is used in Ubuntu 18.04 LTS.
- It uses the DPKG-based APT package manager (using apt-get, apt-cache, etc. which we cover in more detail later) to install, update, and remove packages in the system.
- Ubuntu has been widely used for cloud deployments.
- While Ubuntu is built on top of Debian and is GNOME-based under the hood, it differs visually from the interface on standard Debian, as well as other distributions.
The boot process
- Power ON
- BIOS(Basic Input/Output system) - initializes screen and keyboard and tests the main memory(POST - power on self Test)
- MasterBootRecord(MBR) also known as first sector of the Hard Disk
- Boot loader(e.g. GRUB)
- Kernel(Linux OS)
- Initial RAM Disk - initramfs Image
- /sbin/init (parent process)
- Command Shell using getty
- X Window System
A number of boot loaders exist for Linux
the most common ones are GRUB (for GRand Unified Boot loader), ISOLINUX (for booting from removable media), and DAS U-Boot (for booting on embedded devices/appliances).
For systems using the BIOS/MBR method, the boot loader resides at the {1} of the hard disk, also known as the {2}. The size of the {2} is just {3} bytes. In this stage, 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, for example GRUB, and loads it into RAM (Random Access Memory).
- first sector
- Master Boot Record (MBR)
- 512
For systems using the EFI/UEFI method, UEFI firmware reads its {1} data to determine which {2} is to be launched and from where (i.e. from which disk and partition the EFI partition can be found). The firmware then launches the {2}, for example GRUB, as defined in the boot entry in the firmware’s boot manager.
- Boot Manager
2. UEFI application
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 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.
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 device 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.
The initial RAM Disk
- mount proper root filesystem
- providing kernel functionality
- locating devices
- locating drivers and load them
- checking for errors in root filesystem
Most distributions start six text terminals and one graphics terminal starting with F1 or F2. Within a graphical environment, switching to a text console requires pressing
CTRL-ALT + the appropriate function key (with F7 or F1 leading to the GUI).
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.
/sbin/init and Services
Once the kernel has set up all its hardware and mounted the root filesystem, the kernel runs /sbin/init. 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; exceptions include the so-called kernel processes. These are started by the kernel directly, and their job is to manage internal operating system details.
Besides starting the system, init is responsible
for keeping the system running and for shutting it down cleanly.
Startup Alternatives
1) Upstart
- Developed by Ubuntu and first included in 2006
- Adopted in Fedora 9 (in 2008) and in RHEL 6 and its clones.
2) systemd
- Adopted by Fedora first (in 2011)
- Adopted by RHEL 7 and SUSE
- Replaced Upstart in Ubuntu 16.04.
systemd Features
- Systems with systemd start up faster than those with earlier init methods. This is largely because it replaces a serialized set of steps with aggressive parallelization techniques, which permits multiple services to be initiated simultaneously.
- Complicated startup shell scripts are replaced with simpler configuration files, which enumerate what has to be done before a service is started, how to execute service startup, and what conditions the service should indicate have been accomplished when startup is finished. One thing to note is that /sbin/init now just points to /lib/systemd/systemd; i.e. systemd takes over the init process.
Starting, stopping, restarting a service (using nfs as an example) on a currently running system:
{1}
Enabling or disabling a system service from starting up at system boot:
{2}
1) $ sudo systemctl start|stop|restart nfs.service
2) $ sudo systemctl enable|disable nfs.service
Linux Filesystems
1) Conventional disk filesystems: ext2, ext3, ext4, XFS, Btrfs, JFS, NTFS, etc.
2) Flash storage filesystems: ubifs, JFFS2, YAFFS, etc.
3) Database filesystems
4) Special purpose filesystems: procfs, sysfs, tmpfs, squashfs, debugfs, etc.