Tuesday, June 30, 2015

Boot Process

The Boot Process
Have you ever wondered what happens in the background from the time you press the Powerbutton until the Linux login prompt appears?  
The Linux boot process is the procedure for initializing the system. It consists of everything that happens from when the computer power is first switched on until the user interface is fully operational. 
Once you start using Linux, you will find that having a good understanding of the steps in the boot process will help you with troubleshooting problems as well as with tailoring the computer's performance to your needs.
The Linux Kernel
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.

Command Line

Introduction to the Command Line
Linux system administrators spend a significant amount of their time at a command line prompt. They often automate and troubleshoot tasks in this text environment. The command line interface provides the following advantages:
  • No GUI overhead.
  • Virtually every task can be accomplished using the command line.
  • You can script tasks and series of procedures.
  • You can log on remotely to networked machines anywhere on the Internet.
  • You can initiate graphical apps directly from the command line.
The Command Line
Most input lines entered at the shell prompt have three basic elements:
  • Command
  • Options
  • Arguments
The command is the name of the program you are executing. It may be followed by one or more options (or switches) that modify what the command may do. Options usually start with one or two dashes, for example,-p or--print, in order to differentiate them from arguments, which represent what the command operates on.
However, plenty of commands have no options, no arguments, or neither. You can also type other things at the command line besides issuing commands, such as setting environment variables.

Understanding Absolute and Relative Paths
There are two ways to identify paths:
  1. Absolute pathname: An absolute pathname begins with the root directory and follows the tree, branch by branch, until it reaches the desired directory or file. Absolute paths always start with /.
  2. Relative pathname: A relative pathname starts from the present working directory. Relative paths never start with /.
Multiple slashes (/) between directories and files are allowed, but all but one slash between elements in the pathname is ignored by the system. ////usr//bin is valid, but seen as /usr/bin by the system.
Most of the time it is most convenient to use relative paths, which require less typing. Usually you take advantage of the shortcuts provided by: . (present directory), .. (parent directory) and ~ (your home directory).
For example, suppose you are currently working in your home directory and wish to move to the /usr/bin directory. The following two ways will bring you to the same directory from your home directory:
  1. Absolute pathname method: $ cd /usr/bin
  2. Relative pathname method:   $ cd ../../usr/bin
In this case, the absolute pathname method is less typing.

    File System in Linux

    A  filesystem, which is the embodiment of a method of storing and organizing arbitrary collections of data in a human-usable form.
    Different Types of Filesystems Supported by Linux:
    • Conventional disk filesystems: ext2ext3ext4XFSBtrfsJFS,NTFS, etc.
    • Flash storage filesystems: ubifsJFFS2YAFFS, etc.
    • Database filesystems
    • Special purpose filesystems: procfssysfstmpfsdebugfs, etc.
    • Partitions and Filesystems
      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).
      A comparison between filesystems in Windows and Linux is given in the following table:
      WindowsLinux
      PartitionDisk1/dev/sda1
      Filesystem typeNTFS/FAT32EXT3/EXT4/XFS...
      Mounting ParametersDriveLetterMountPoint
      Base Folder where OS is storedC drive/
    The Filesystem Hierarchy Standard
    Linux systems store their important files according to a standard layout called the Filesystem Hierarchy Standard, or FHS. You can download a document that provides much greater detail here, or look up the original source documents on the Linux Foundation website. This standard ensures that users can move between distributions without having to re-learn how the system is organized.
    Linux uses the ‘/’ character to separate paths (unlike Windows, which uses ‘\’), and does not have drive letters. 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).
    All Linux filesystem names are case-sensitive, so /boot/Boot, and /BOOT represent three different directories (or folders). Many distributions distinguish between core utilities needed for proper system operation and other programs, and place the latter in directories under /usr (think "user"). To get a sense for how the other programs are organized, find the /usrdirectory in the diagram above and compare the subdirectories with those that exist directly under the system root directory (/).

    Linux Introduction

    Linux:
    Linux is a free open source computer operating system initially developed for Intel x86-based personal computers. It has been subsequently ported to many other hardware platforms. Linus Torvalds was a student in Helsinki, Finland, in 1991 when he started a project: writing his own operating system kernel. He also collected together and/or developed the other essential ingredients required to construct an entire operating system with his kernel at the center. This soon became known as the Linux kernel.
    Linux borrows heavily from the UNIX operating system because it was written to be a free and open source version of UNIX. Files are stored in a hierarchical filesystem, with the top node of the system being root or simply "/". 
    Linux is a fully multitasking (a method where multiple tasks are performed during the same period of time), multiuser operating system, with built-in networking and service processes known as daemons in the UNIX world.
    A full Linux distribution consists of the kernel plus a number of other software tools for file-related operations, user management, and software package management. Each of these tools provides a small part of the complete system. Each tool is often its own separate project, with its own developers working to perfect that piece of the system.
    Distribution of Linux: There are three major distribution families within Linux: Fedora,SUSE and Debian


      • Linux borrows heavily from the UNIX operating system, with which its creators were well versed. 
      • Linux accesses many features and services through files and file-like objects.
      • Linux is a fully multitasking, multiuser operating system, with built-in networking and service processes known as daemons.
    • Linux is developed by a loose confederation of developers from all over the world, collaborating over the Internet, with Linus Torvalds at the head. Technical skill and a desire to contribute are the only qualifications for participating.
    • The Linux community is a far reaching ecosystem of developers, vendors, and users that supports and advances the Linux operating system.
    • Some of the common terms used in Linux are: Kernel, Distribution, Boot loader, Service, Filesystem, X Window system, desktop environment, and command line.
    • A full Linux distribution consists of the kernel plus a number of other software tools for file-related operations, user management, and software package management.