Wednesday, November 23, 2011

Booting Process



Boot Sequence
  • To detect all device
  • Configure plug and ply device
  • Identify the first boot loader

1stage boot loader:- When appropriate boot device found the first stage boot loader into RAM then it take less then 512 bytes to excutes and its job is loaded into second stage boot loader


2nd Stage boot loader:-(Grub) In RHEL 3 we have two type of boot loader
1.GRUB
2.LILO
In RHEL 4 we have only one type of boot loader (GRUB)


Functions Of Grub
  1. To identify the partation with appropriate boot file
  2. To load the kernel
  3. To run the initial
  4. Select os (If multiple os)
  5. RAMDISK(init)
  6. To setup the kernel & its asociate module
The grub file exist in /boot/grub/grub.conf and symbolic file is /etc/grub.conf
*Default=1 (Specify by which kernel or os Default started at boot time)
*Timeout=5 (Provide time select os at boot time)
*Hiddenmenu=(Remove this to get os or kernel selection term automatically at boot time)


Grub has 3 interface

  1. Menu Interface:-Press at any key at boot time
  2. Menu edit interface:-To go in menu edit interface
  3. Command mode interface:-
  • Press "e" at selected options
  • press "d" to delet a line
  • insert new line below the cursoer "o"
  • insert new line above the cursoer "shift+o"
  • To boot "b"
First of all go to the command mode interface

To corrept the grub

#dd if =/dev/zero of=/dev/sda bs=1 count=1024

To reinstall

  • Insert a linux DVD
  • Go to the rescue mode
[root@khan~]#fdisk -l
[root@khan~]#chroot /mnt/sysimage
[root@khan~]#grub-install /dev/sda
[root@khan~]#exit

Protect the Grub
[root@khan~]#grub-md5-crypt >> /boot/grub/grub.conf
Kernel:-
  • Device Detetion
  • Driver initialization
  • Mounting not file system in read only mode
  • Load initial process
Kernel full fil 4 managment task:-

  • Process managment
  • Memory managment
  • file system managment
  • I/O managment
INIT:-
  • /etc/rc.d/rc.sysinit
  • /etc/rc.d/rc
  • /etc/rc.d/rc?.d
  • /etc/rc.d/rc.local
* Init its read configration from /etc/inittab
  • Check the initial runlevel
  • system initilazation script
  • runlevel specific directory
Runsystem initialize script
/etc/rc.d/rc.sysinit

  • activate udev & selinux
  • set kernel parameter in /etc/sysctl.conf
  • set the system clock
  • load keymap
  • enable the swap partation
  • set the hostname
  • root file system check & remounting
  • enable disk quota
  • check & mount other file system
  • Activate RAID & LVM partation
/etc/inittab
  • /etc/rc.d/rc?.d(runlevel control)
  • It check is which runlevel your system start
  • system creat a seprate directory for each runlevel
  • /etc/rc.d/rc0.d-------> (runlevel 0)
  • /etc/rc.d/rc1.d-------> (runlevel 1)
  • /etc/rc.d/rc2.d-------> (runlevel 2)
  • /etc/rc.d/rc3.d-------> (runlevel 3)
  • /etc/rc.d/rc4.d-------> (runlevel 4)
  • /etc/rc.d/rc5.d-------> (runlevel 5)
  • /etc/rc.d/rc6.d-------> (runlevel 6)

User Group and Permission

User :- User is an object who can access resources of our system

* When we Create a user system create a home directory for that particular user with same user name
* When we Create a user system create a group for that particular user with same user name
There are four types of user
1.Super user
2.Normal User
3.System User
4.Normal User

* All user unique UID

0 - root user
1-499 - system user
500-60000 Normal user
60001-65535 Duplicate user

* All user info store in /etc/passwd file

* /etc/passwd are 7 clone separated field


root:x:0:0:root:/root:/bin/bash

1.User name

2.Password

3.UID

4.GID

5.User common Info

6.User home directory

7.Login shell

To get info abut any user
---------------------------------
#getent passwd
or
#vipw
or
#vim /etc/passwd

Group:-Group is a contener which holds some permission object

  • Each user assign a group or more than one group
  • By default each user belong to therir primary group with same user name
  • all info of group are store in /etc/group
  1. Primary Group (Default created)
  2. Secondary Group (Manually created)
  • each group assign a unique GID
0 ----> root
1-499 ----> system group
500-60000 ----> Normal group
60001-65535 ----> Duplicate group

Group informatation store in /etc/group

root:x:0:root
1.Group name
2.Group password
3.GID
4.Group Member

To creat a group
#groupadd
Todelet the group
#groupdel
To get info abut any group
#getenet group
or
#vigr
or
#vim /etc/group

PERMISSION
To see the permission
#ls -lh
or
#ls -lh
or
#ls -ldh /etc



There are 8 clone seprated field each field denoted by difrent colour

1. 7 Type of file
d -----> Directory
- ----> Normal file
l -----> Link file
b ----> block special file
c ----> character special file
p ---->Normal pipe file
s ---->Socket file

2. Permission
3.No of link count
4.Owner of the file or directory
5.Group owner of the file or directory
6.Size of the file or directory
7.Last access or modify date & time
8.file or directory name