1 / 49

System initialization

System initialization. Unit objectives Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with Windows Understand how the init daemon initializes the system at boot time. Topic A: Booting and boot loaders. The boot process.

tracen
Download Presentation

System initialization

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. System initialization Unit objectives • Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with Windows • Understand how the init daemon initializes the system at boot time

  2. Topic A: Booting and boot loaders

  3. The boot process • Bios functions • Power On Self Test (POST) • Tests hardware components • Searches for boot device • Master Boot Record (MBR) • Located on the first sector of the first hard disk drive • Used to define partitions and a boot loader • Boot loader • Program used to load an operating system • Init (initialize daemon) • Loads other system daemons

  4. The boot process

  5. Boot loaders • Loads the Linux kernel into memory • May perform other functions • Pass system configuration to kernel • Select different kernel versions • Boot other OSes • The two most common boot loaders • LILO • GRUB

  6. Common LILO keywords • /etc/lilo.conf • The LILO configuration file • Includes boot device, image name, etc continued

  7. Common LILO keywords continued

  8. Common LILO keywords, continued

  9. Using LILO to control system • Can pass parameters at boot time • append= • Can pass information to kernel at boot • Must update LILO when kernel is changed • Lilo • Can also fix conf by using a boot device and manually making changes continued

  10. LILO error codes

  11. GRUB • GRand Unified Bootloader (GRUB) • Resembles common UNIX boot loaders • Newer than LILO • First major part typically resides on the MBR • Remaining parts reside in the /boot/grub directory

  12. GRUB • Similar information to lilo is stored in grub.conf file • Can manually edit grub config. Nothing needs to be updated • Can also append details at boot time

  13. GRUB configuration boot loader screen

  14. GRUB • Can be installed with grub-install command • grub-install /dev/hda • Into MBR • grub-install /dev/hda1 • Into first primary partition

  15. Dual booting • Dual boot • Configuration where two or more operating systems exist on the hard disk • Using LILO or GRUB, it is easiest if Linux is installed after the other operating system has been installed

  16. Partitioning for a dual boot system

  17. Configuring GRUB for a dual boot system

  18. Dual booting • Can also use the ntloader to load Linux in a dual boot • Use dd to copy the grub information • linboot.ini • Copy linboot.ini to C: in windows • Edit the boot.ini • Point to the linboot.ini file

  19. The NTLOADER screen

  20. FIPS • First non-destructive Interactive Partition Splitter (FIPS) • Program used to create a new partition out of the free space on an existing FAT16 or FAT32 partition • Resizing the Windows partition using FIPS will preserve the Windows operating system on the Windows partition yet allow for free space to install Linux

  21. Using FIPS • Guidelines/limitations to using FIPS • Version 2.0 supports the FAT16 and FAT32 filesystems only • Will only work with primary Windows partition • Will not resize logical drives within extended partitions • Works by splitting the Windows partition into two primary partitions • There must be sufficient free space within the existing Windows to allow for the installation of Linux

  22. Any Questions?

  23. QUESTION 738 A customer has recompiled his kernel to a new image including new modules. GRUB is not being used as the boot loader. After editing the necessary configuration files, what command should be issued? A. /etc/lilo B. /sbin/lilo C. /sbin/loadlin D. ./start kernel

  24. QUESTION 738 A customer has recompiled his kernel to a new image including new modules. GRUB is not being used as the boot loader. After editing the necessary configuration files, what command should be issued? A. /etc/lilo B. /sbin/lilo C. /sbin/loadlin D. ./start kernel Answer: B

  25. Which of the following statements is not true about LILO? A. It can be used on a floppy to boot Linux. B. It must replace the master boot record on your hard drive. C. It will work with other operating systems such as DOS and Windows. D. It can specify up to 16 different boot images.

  26. Which of the following statements is not true about LILO? A. It can be used on a floppy to boot Linux. B. It must replace the master boot record on your hard drive. C. It will work with other operating systems such as DOS and Windows. D. It can specify up to 16 different boot images. Answer: B.

  27. A user has overwritten the master boot record. How could the Linux record be restored? A. edit fstab B. edit lilo.conf C. run "fdisk /mbr" D. run "/sbin/lilo"

  28. A user has overwritten the master boot record. How could the Linux record be restored? A. edit fstab B. edit lilo.conf C. run "fdisk /mbr" D. run "/sbin/lilo" Answer: B.

  29. Topic B: System initialization

  30. What is initialization • init • The first daemon process on the system • Starts the other daemons • Stops daemons at shutdown • /etc/inittab • The configuration file for the init daemon

  31. Runlevels • Runlevel • Stages of system startup • Defines the type and number of daemons started • Runlevels are often called initstates

  32. Linux runlevels continued

  33. Runlevel commands • runlevel command • Used to display the current and most recent previous runlevels • init command • Used to change from one runlevel to another • telinit command • An alias to the init command

  34. The /etc/inittab file • Defines the daemons that run at each runlevel • Specifies default runlevels • Specifies which scripts are run at which level

  35. The /etc/inittab file • /etc/rc.d/rc.sysinit • The first script executed during system startup • initializes the hardware • sets environment variables such as PATH and HOSTNAME • checks filesystems • performs system tasks needed for daemon loading.

  36. The /etc/inittab file, continued • Mingetty • Program used to display a login prompt on a character-based terminal • /etc/rc.d/rc.local • Final script executed during system startup • Entry format • Label: runlevel(s) : action : command

  37. The /etc/rc.d/rc# files • List the daemons that should be started • Daemons with s are started at that level • Daemons with k are killed at that level

  38. Linux initialization process

  39. Configuring daemon startup • /etc/rc.d/rc*.d • The directories used to start and kill daemons in each runlevel • /etc/rc.d/init.d • The directory in which most daemons are located • Most daemons take commands • /etc/rc.d/init.d/xinted restart • Restarts xinted daemon

  40. Configuring daemon startup • To add to a runlevel • Add executable file to /etc/rc.d/init.d • Create symbolic links to daemon in all runlevels you want it started • Create symbolic links in runlevels you want it killed

  41. Results of the ntsysv --level 5 command

  42. Unit summary • Learned about the boot sequence, configured LILO and GRUB boot loaders, and learned about dual boot configurations • /etc/lilo.conf • /etc/grub.conf • MBR or first block in partition • Can reconfigure using a boot disk

  43. Unit summary • Learned about how the init daemon initializes the system at boot time, and different runlevels

  44. Which of the following runlevels is generally used to ensure the Linux server will boot into full multi­user mode without starting X Windows? A. 0 B. 3 C. 5 D. 6

  45. Which of the following runlevels is generally used to ensure the Linux server will boot into full multi­user mode without starting X Windows? A. 0 B. 3 C. 5 D. 6 Answer: B

  46. A Linux administrator just installed Xfree86. Which of the following files should the administrator edit in order to change the default system runlevel from 3 to 5? A. /etc/inittab B. /etc/runlevels C. /etc/rc.sysinit D. /etc/defaultrunlevel

  47. A Linux administrator just installed Xfree86. Which of the following files should the administrator edit in order to change the default system runlevel from 3 to 5? A. /etc/inittab B. /etc/runlevels C. /etc/rc.sysinit D. /etc/defaultrunlevel Answer: A

  48. Each entry in the /etc/inittab file contains four fields the third of which is the Action field. What is the purpose of this field? A. Identifies the entry. B. Specifies the command to execute. C. Defines how to handle the entry. D. Defines which runlevels this line applies to.

  49. Each entry in the /etc/inittab file contains four fields the third of which is the Action field. What is the purpose of this field? A. Identifies the entry. B. Specifies the command to execute. C. Defines how to handle the entry. D. Defines which runlevels this line applies to. Answer: C.

More Related