P3BootingandShuttingdownpptx 2021 08-07-16!05!55
P3BootingandShuttingdownpptx 2021 08-07-16!05!55
P3BootingandShuttingdownpptx 2021 08-07-16!05!55
Down
Boot Loader
• For any operating system to boot on standard PC hardware, you need
what is called a boot loader
• the boot loader will reside in the Master Boot Record (MBR) of the
disk
• it knows how to get the operating system up and running
• Linux distributions have GRUB (the Grand Unified Bootloader) and
LILO (Linux Loader)
GRUB & LILO
• Booting Boot Loader
• No user interaction
• First Software to run
• MBR
• GRUB (the Grand Unified Bootloader) and LILO (Linux Loader)
• GRUB Legacy ( Stable Version)
GRUB
• Stage 1
• Embedded in the MBR
• Stage 1
• Stage 2
• Intermediate ( Stage 1.5)
• Actual ( Stage 2)
• File system–specific
• x_stage_1_5 (e2fs, reiserfs, fat, jfs, minix, xfs )
• Stage 2 Actual Code , Boot Menu, GRUB Shell ( For other OS Location)
• stage2_eltorito(boot image for CD-ROM), nbgrub, pxegrub (network-type boot images )
• Bootstrap Protocol [BOOTP], Dynamic Host Configuration Protocol [DHCP], Preboot
Execution Environment [PXE], Etherboot /boot/grub
• “hd” means “hard disk”, “fd” means “floppy disk.”
• grub-install
• Installing GRUB:
• Backing Up the MBR:
• Creating a Boot/Rescue CD:
Installing GRUB from the GRUB Shell
• Launch GRUB’s shell by issuing the grub command. Type
• [root@fedora-serverA ~]# grub GNU
• GRUB version 0.97 (640K lower / 3072K upper memory)
• Set GRUB’s root device to the partition that contains the boot directory
on the local hard disk. Type
• grub> root (hd0,0)
• Filesystem type is ext2fs, partition type 0x83
• Make sure that the stage1 image can be found on the root device. Type
• grub> find /grub/stage1
• (hd0,0)
• Finally, install the GRUB boot loader directly on the MBR of the hard
disk. Type
• grub> setup (hd0)
• Checking if "/boot/grub/stage1" exists... no
• Checking if "/grub/stage1" exists... yes
• Checking if "/grub/stage2" exists... yes Checking if "/grub/e2fs_stage1_5"
exists... yes
• Running "embed /grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
• succeeded
• Running "install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /
grub/grub.conf"... succeeded
• Done.
• Quit the GRUB shell. Type
• grub> quit
Adding new Kernel to GRUB
• cd /boot
• cp vmlinuz-2.6.25-14.fc9.i686 duplicate-kernel
• cp initrd-2.6.25-14.fc9.i686.img duplicate-initrd.img
• Create entry in GRUB file.
• title The Duplicate Kernel
color yellow/black
root (hd0,0)
kernel /duplicate-kernel ro root=UUID=7db5-4c27
initrd /duplicate-initrd.img