Sie sind auf Seite 1von 9

Unit -20

Control Boot Process


Objective:
Booting an Alternet Kernel
Booting in to a Different runlevel
Getting Past a GRUB Misconfiguration.
Making Persistent GRUB Changes.
Passing Kernel Arguments.

Booting an Alternet Kernel :


Boot loader:
A program that loads an operating system kernel in to memory and execute
it.
GRUB:
Grand Unified Boot loader, the boot loader used by Red Hat Enterprise Linux.
Step 1. First check the release version of linux
#uname r
-r = it will show the release
Step2. For this question you need to configure the yum client by giving
baseurl:
#cd /etc/yum.repos.d/
#mv * /tmp
#vim exam.repo

[RHCSA]
name= this is yum client repository file
baseurl=ftp://192.168.0.254/pub/rhel6/dvd
enabled=1
gpgcheck=0
:wq!

Step3. #yum clean all


Step4. #yum list all

Step5. Install lftp and ftp command


#yum install lftp* -y
#yum install ftp y

Step6. Restart the vsftpd service


#service vsftpd restart
#chkconfig vsftpd on

Step7. #lftp 192.168.0.254


After executing lftp you will get the lftp prompt:
lftp> cd pub
lftp> ls
lftp> kerenel-2.6.....................
lftp>kerenel-firmware..............
lftp> bye

Step8. Use the rpm command to install it


#rpm ivh kernel-firmware...............
#rpm ivh kernel-..............................
-i = install
-v = verbose
-h =hash sign

Step9.After installation open the grub configuration file


#vim /boot/grub/grub.conf
Check the first entry default=0
Check for first tiltle =

Note : if you want you can change the timeout=10 so that machine reboot
does not take much time
:wq!
Step 10. Reboot the machine
#init 6
Step 11. When you will get the machine check the kernel version
#uname r
As a out put you will get the updated kernel version
################################################################

Changing the Default Runlevel.


Whatis runlevel:
Runlevel is the state of the system that defines which services are available.

No. Of runlevels:
cat /etc/inittab
0 halt (Do NOT set initdefault to this )
123456-

Single user mode


Multi user, without NFS (The same as 3, if you do have networking )
Full multiuser mode
Unused
X11
Reboot (Do NOT set initdefault to this)

#vim /etc/inittab
id:5:initdefault
Go to end of the line and change the number.
For ex:
id:3:initdefault
Step 2. Save the file
:wq!
Step3. Reboot the machine
#init 6
############################################################
Changing the root password:
Reset the password by logging in to single user mode of your virtual machine
Step1. Restart the virtual machine
Step2. At grub screen where it shows seconds to start, press any key on your
keyboard.
Step 3. Press e (Ensure that Caps Lock is off)
Step 4. Select kernel /Vmlinuz_an and press e
Step 5. Type space 1 or s

Step 6. Press b and then enter key


Step 7. You will set single mode command prompt there enter the following
commands
#setenforce 0
Step8. Check by using command
#getenforce
Step9. Permissive should be displayed
Step10. Use the following command to change the root password of your
virtual machine:
Step11. #echo avaster | passwd stdin root
Step 12. #init 6

Getting past a GRUB Misconfiguration:


If GRUB file will mis configured Error no 15. File not found.
Troubleshooting steps for Error no. 15 File not found:
Step1. Enter in the single user mode (Copy the data from password change)
Step 2. Open the grub configuration file by using vim command.
#vim /boot/grub/grub.conf
See the error line modify the error and save the file
:wq!
Step3. After saving file reboot the system

#init 6
Step4. After rebooting again open /boot/grub/grub.conf file and modify the
error permanently

Making Persistent Grub changes:


If grub file will dislocate from its place it will show the grub prompt
grub>
We call it Grub Error
For getting machine back you need to type following parameters:
Step1.
grub> root
Step2. (For base machine)
grub>kernel /vmlinuz-2.6.32-71.el6.x86_64 ro root /dev/mapper/vol0-root
Step3.
grub> initrd /initramfs -2.6.32-71.el6.x86_64.img
Step4.

grub>reboot

Note: for virtual machine 2nd step will change:


grub> kernel /vmlinuz-2.6.32-71.el6.x86_64 ro root /dev/mapper/vgsrv-root
Passing Kernel argument:
Incomplete
Entries of /boot/grub/grub.conf:
1. default 0 :
The first entry numbering from 0 is the default boot entry.

2. Timeout:
The default boot entity is started automatically after 8 sec.

3. Title:
Each entry for an operating system begins with title.
4. root(hd0,0):
-Grub does not distinguish between IDE & SCSI hard disk .
-The hard disk that is recognized by the BIOS as the first hard disk .
h0: First hdd

h1: Second hdd


-The first partition on the first hard disk is called (hd0,0)
5. kernel /vmlinuz:
This entry describes the kernel location It is followed by kernel
parameters like
root=/dev/hda1

5. Initrd /initramfs:
-This entry sets the location of the location of the initial ramdisk .
-The initrd contains hardware drivers that needed before the kernel
can access the hard disk.

Das könnte Ihnen auch gefallen