Thursday, 26 September 2013

Linux Booting Process

Linux Booting Process :

 Linux boot processs completes in 6 stages :
  1. System startup(Hardware )
  2. Boot loader Stage 1 (MBR loading)
  3. Boot loader Stage 2 (GRUB loader)
  4. Kernel
  5. INIT
  6. Runlevel
Stage 1 : System startup  
  • Run POST (Power On Self Test) operation.
  • Selecting first Boot device.
POST operation : POST is a processes of checking hardware availability. In order to check if a hardware is available for the present booting or not it will send an electric pluse to each and every device in the list that it already have. If an electrical pulse is returned from that device it will come to a conclusion the hardware is working fine and ready for use. If it does not receive a signal from a particular device it will treat that device as faulty or it was removed from the system.The new list will be stored in BIOS memory for next boot.
Selecting first Boot device: Once the POST is completed BIOS will have the list of devices available.It will select the first boot device and gives back the control to Processor(CPU).  

When the system is booted, processor looks at the end of system memory for the Basic Input/Output System or BIOS program and runs it.Once the control goes to BIOS it will take care of two things

Stage 2 : Boot loader Stage 1 (MBR loading)
  • Primary boot loader code(446 Bytes)
  • Partition table information(64 Bytes)
  • Magic number(2 Bytes)




Once the BIOS gives control back to CPU, it will load the MBR into the first sector of the boot disk.MBR is a small part of Hard Disk with just a size of 512 Bytes, I repeat its just 512 Bytes. 

Which will be equal to 512B (446+64+2)B.

Primary Boot loader code: This code provides boot loader information and location details of actual boot loader code on the hard disk. This is helpful for CPU to load second stage of Boot loader.

Partition table: MBR contains 64 bytes of data which stores Partition table information such as what is the start and end of each partition, size of partition, type of partition(Whether it's a primary or extended etc). As we all know HDD support only 4 partitions, this is because of the limitation of its information in MBR. For a partition to represent in MBR, it requires 16 Bytes of space in it so at most we will get 4 partitions.
Magic Number: The magic number service as validation check for MBR. If MBR gets corrupted this magic number is used to retrieve it. 
Once your CPU knows all these details, it will try to analyse them and read the first portion of MBR to load Second stage of Boot loader.
Stage 3 : Boot loader Stage 2 (GRUB loader)
MBR loads and executes the 2nd stage boot loader GRUB into memory.GRUB located in the first 30 kilobytes of hard disk.
GRUB read its configuration and displays the GRUB boot menu (where the user can manually specify the boot parameters) to the user. GRUB loads the user-selected (or default) kernel into memory and passes control on to the kernel. If user do not select the OS, after a defined timeout GRUB will load the default kernel in the memory for starting it.

Stage 4 : Kernel
  • Mounts the root file system as specified in the “root=” in grub.conf
  • Kernel executes the /sbin/init program
  • Since init was the 1st program to be executed by Linux Kernel, it has the process id (PID) of 1. Do a ‘ps -ef | grep init’ and check the pid.
  • initrd stands for Initial RAM Disk.

initrd is used by kernel as temporary root file system until kernel is booted and the real root file system is mounted. It also contains necessary drivers compiled inside, which helps it to access the hard drive partitions, and other hardware.


Stage 5 : Init


The /sbin/init program (also called init) coordinates the rest of the boot process and configures the environment for the user.

When the init command starts, it becomes the parent or grandparent of all of the processes that start up automatically on the system. First, it runs the/etc/rc.d/rc.sysinit script, which sets the environment path, starts swap, checks the file systems, and executes all other steps required for system initialization.
The init command then runs the /etc/inittab script, which describes how the system should be set up in each init runlevel . Among other things, the/etc/inittab sets the default runlevel .

Stage 6 : Runlevels Programs

Starts the services according to the run levels.



Tuesday, 24 September 2013

vxvm-snapshot-technology-cheatsheet

Ldom Basic

Prerequisite :

Solaris 10 11/06 OS with required patches 124921-02 and 125043-01 (with kernel update 118833-36) at a minimum

•124921-02 : which contains updates to the Logical Domains 1.0 drivers and utilities. LDoms networking will not function correctly without 124921-02.
•125043-01 :which contains updates to the qcn (console) drivers.


  1. OVM for sparc or LDOMs uses Niagara processor with multi-threading and muti-core technology at the same time.
  2. The most important thing of these processors is the support of hypervisor for virtualization.
  3. Using the OracleVMServer we can create up to 128 virtual servers, called logical domains, on a single system.
  4. This technology allows you to create multiple discrete systems, each with their own operating system, resources, and identity within a single system.
  5. LDOM is used where each environment requires an independent kernel (remember, Solaris Containers use the same kernel structure).
  6. In LDOM we can dynamically reconfigure the resources with reboot.

Note:## All the local zones have same kernel version as Global zone.
        ##  Symmetric multiprocessing (SMP) systems have multiple CPUs that can all process simultaneously.
   

Terms used in Ldom :


Hypervisor :  Creates multiple virtual systems by an additional software application in the firmware layer, interposed between the operating system and the hardware platform called the hypervisor. It abstracts the hardware and can expose or hide various resources, allowing for the creation of resource partitions that can operate as discrete systems, complete with virtual CPU, memory and I/O devices."
  1. A firmware layer on the flash PROM of the motherboard, is a thin software layer with a stable interface, the sun4v platform, between the operating system and the hardware.
  2. The hypervisor provides a set of support functions to the operating system, so that the OS does not need to know intimate details of how to perform functions with the hardware.This allows the operating system to simply call the hypervisor with calls to the sun4v platform. This is often described as a stable interface.
  3. This layer is very thin and exists only to support the operating system for hardware-specific details.
  4. Hypervisor is the engine that abstracts the hardware, it can choose to expose or hide various aspects of the hardware to the operating system.
  5. Hypervisor is responsible for maintaining separation between domains, it also provides the capability to create channels, through which domains can communicate with each other.















Friday, 5 July 2013

DDNA (Daemon Down Node Alive) :

Daemon Down Node Alive (DDNA) is a condition in which the VCS high availability daemon (HAD) on a node fails, but the node is running. When HAD fails, the hashadow process tries to bring HAD up again. If the hashadow process succeeds in bringing HAD up, the system leaves the DDNA membership and joins the regular membership.