Tanti Technology

My photo
Bangalore, karnataka, India
Sandeep Kumar | Founder, Tanti Technologies At Tanti Technologies, I share practical knowledge, hands-on tutorials, and real-world solutions across Python, SQL, Docker, Kubernetes, CI/CD, AWS, Azure, Machine Learning, Generative AI, and Agentic AI. My mission is to simplify complex technologies and provide actionable insights that help developers, engineers, and businesses learn faster, build better, automate smarter, and innovate with confidence. 🚀 Learn • Build • Automate • Innovate Follow Tanti Technologies for practical technology insights and next-generation AI solutions.

Monday, 28 August 2017

Control Linux Boot Processing



 Order of the Boot Process
n  BIOS initialization
n    Peripherals detected, boot device selected , first sector read of d 
n  Boot loader configuration [ GRUB initialization ]
n  Stage 1 :        small, resides in MBR or boot sector contains information about only Stage 2 and loads the stage 2
n  Stage 2:         This is the core image of GRUB reads the file
n  Grub.conf [ /boot/grub/grub.conf ] symbolic link [ /etc/grub.conf ]
n  Kernel Loading
n  Init Process [ /sbin/init ]
l  Starting init also loads [ /etc/inittab ] file into memory
n  rc loading [ /etc/rc.d/rc ]
n  rc.sysinit loading for interactive startup [ /etc/rc.d/rc.sysinit ]
n  System reads the file [ /etc/fstab ] to mount system partitions
n  rc reads /etc/inittab file to load default or selected run level and Enter to selected run level
n  rc.local for user defined scripts [ /etc/rc.d/rc.local ]
n  Loads the X server [ If Run Level 5 is selected ]
l  prefdm script loads [ /etc/X11/prefdm ]
l  prefdm reads the file /etc/sysconfig/desktop file to load display mangers such as kdm,gdm,xdm
l  Then system reads file [ /etc/X11/xorg.conf ] this specifies the hardware components resources
l  Monitor
l  Keyboard
l  Mouse
l  Display Adaptor
GRUB and grub.conf
n  GRUB – GRand  Unified Bootloader Grub is more powerful and we can edit the Grub
l  Command-line interface available at boot prompt
l  Boot form ext2/ext3, ReiserFS, FAT file systems
l  Supports MD5 password protection
n  /boot/grub/grub.conf
n  Configuration file provides the information about kernel  location and other parameters  to load operating system
n  Chain-loading is used for loading other operating system.

Set the password on grub
# grub-md5-crypt
           Password       redhat
Retype password     redhat
It will show the encrypted form of password copy that line and paste in following file........
#vim  /boot/grub/grub.conf
At the line on below hiddenmenu
hiddenmenu
Password    --md5   (paste the line which is copied)
Save the file
Now your grub is password protected
Kernel Initialization:-
n  Device detection.
n  Device drive initialization.
n  Mount root file system read only.
n  Load Initial Process.
Run Levels
n  Run Levels are different modes to run linux with different configuration. Init defines 0 to 6 run levels
n  Defines in file [ /etc/inittab ]
n  Following chard details the run levels that linux defines by default:
n  Runlevel                               Effect
n  0                                              Halt
n  1,s,emergency        Single user modes ( Only root user can be                                                                 logged on. Used to perform Maintenance )‏
n  2                                              Multi-user, without NFS networking
n  3                                              Full multi-user mode. ( Includes networking )‏
n  4                                              User definable, but duplicate of run level 3 
n  5                                              X11 ( Includes networking )‏
n  6                                              Reboot
Note :- If there is no run level defined then system will attempt to boot to run level 9 which is undefined.

Chaining the root password
Boot system into a single user   mode   for change the root password
Reboot   the system   and   press   "a" on  Grub  main menu and  type  "s"   with one space
# setenforce  0
# passwd
 # setenforce 1
 # reboot
  Or #  init  5


No comments:

Post a Comment