Wednesday 29 August 2012

What is Boot Process in Linux

Linux Boot Process:

In the linux we have a 6 level of boot process:


BIOS:
BIOS stands for Basic Input/Output System.Performs some system integrity checks.Searches, loads, and executes the boot loader programs.
Once the boot loader program is detected and loaded into the memory, BIOS gives the control to it.

MBR:
MBR stands for Master Boot Record.
It is located in the 1st sector of the bootable disk. MBR is less then 512KB in size .
It contains information about GRUB (or LILO in old systems).in simple terms MBR loads and executes the GRUB boot loader.


GRUB:
GRUB stands for Grand Unified Bootloader.
If you have multiple kernel images installed on your system, you can choose which one to be executed.
Grub configuration file is (/boot/grub/grub.conf) (/etc/grub.conf is a link to this).
As you notice from the above info, it contains kernel and initrd image.GRUB just loads and executes Kernel and initrd images.

KERNEL:

mount the root file system located in /etc/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.

INIT:

 
after that it goes to /etc/inittab file to check the Linux run level.
 here are the available run levels in Linux:
0 – halt
1 – Single user mode
2 – Multiuser, without Network file system.
3 – Full multiuser mode
4 – unused (for testing purpose)
5 – X11 (Desktop Environment )
6 – reboot
Typically you would set the default run level to either 3 or 5.


RUNLEVEL:

When the Linux system is booting up, you might see various services getting started. For example, it might say “starting Spool …. OK”. Those are the runlevel programs, executed from the run level directory as defined by your run level.
Depending on your default INIT runlevel setting, the system will execute the programs from one of the following directories.
Run level 0 – /etc/rc.d/rc0.d/
Run level 1 – /etc/rc.d/rc1.d/
Run level 2 – /etc/rc.d/rc2.d/
Run level 3 – /etc/rc.d/rc3.d/
Run level 4 – /etc/rc.d/rc4.d/
Run level 5 – /etc/rc.d/rc5.d/
Run level 6 – /etc/rc.d/rc6.d/

Tuesday 28 August 2012

What is Linux and why we have to use it


what is linux ?  LINUX is freeware. anyone can view and edit the source code of OS It is fully customizable.
Most Important Feature is Stability, multitasking, multi-user,LINUX has better security structure.High Portability Easy to port new Hardware Platform Written in C which is highly portable.

Kernel:
Kernel is the heart of the operating system.It is the low level core of the System that is the interface between applications and H/W.
Functions
Manage The Memory, I/O devices, allocates the time between user and process, inter process communication, sets process priority.

Shell:
The shell is a program that provide interface to users for their commands.
It is a command interpreter and also has programming capability of its own.
Shell Types

  Sh  (First shell by Stephen Bourne at AT&T bell labs in 1977)
  Bash  C Shell(sh)
  Korn Shell (ksh)

File System:

Linux treats everything as a file including hardware devices. Arranged as a
directory hierarchy.

The top level directory is known as “root (/)”.

/bin    Essential command binaries
/boot    Static files of the boot loader
/dev     Device files
/etc     Host−specific system configuration
/lib     Essential shared libraries and kernel modules
/media     Mount point for removeable media
/mnt     Mount point for mounting a filesystem temporarily
/opt      Add−on application software packages
/sbin      Essential system binaries
/srv      Data for services provided by this system\
/tmp      Temporary files
/usr     Secondary hierarchy
/var     Variable data.