Tuesday, August 2, 2016

KERNEL

KERNEL

[root@Tusharjahdav boot]# ls /boot/ 
total 23893
-rw-r--r--. 1 root root   105195 Nov 21  2013 config-2.6.32-431.el6.x86_64
drwxr-xr-x. 3 root root     1024 Dec 16 01:57 efi
drwxr-xr-x. 2 root root     1024 Jan 11 02:15 grub
-rw-------. 1 root root 17495471 Dec 16 02:02 initramfs-2.6.32-431.el6.x86_64.img
drwx------. 2 root root    12288 Dec 16 01:52 lost+found
-rw-r--r--. 1 root root   193758 Nov 21  2013 symvers-2.6.32-431.el6.x86_64.gz
-rw-r--r--. 1 root root  2518236 Nov 21  2013 System.map-2.6.32-431.el6.x86_64
-rwxr-xr-x. 1 root root  4128368 Nov 21  2013 vmlinuz-2.6.32-431.el6.x86_64

[root@Tusharjahdav boot]# du -sh vmlinuz-2.6.32-431.el6.x86_64 -----check kernel size
4.0M    vmlinuz-2.6.32-431.el6.x86_64 --------------------kernel size

What this program contain in kernel ---------vmlinuz ---functions ---drivers INFO.----Schedulers  -----Information ---etc…

LINUX DRIVERS INFORMATIONS PATH

[root@Tusharjahdav fs]# ls /lib/modules/2.6.32-431.el6.x86_64/kernel/fs 

autofs4  cachefiles  configfs  dlm       exportfs  ext3  fat      fuse  jbd   jffs2  mbcache.ko  nfs_common  nls       ubifs  x

[root@Tusharjahdav fs]# ls /lib/modules/2.6.32-431.el6.x86_64/kernel
arch  crypto  drivers  fs  kernel  lib  mm  net  sound

KO---Kernel Object ----(Kernel stand for kernel object )  (kernel driver extension )

Kernel Drivers =  Network Drivers,  Video drivers, fs drivers, hdd drivers ,etc.

KLM -- KERNEL LOADABLE MODULE
LKM – LOADABEL KERNEL MODULE
.KO -- KERNEL OBJECT   --- (kernel driver extension)

[root@Tusharjahdav ext3]# ls /lib/modules/2.6.32-431.el6.x86_64/kernel/fs/ext3
ext3.ko  -----------------------(kernel driver extension)

HOW TO FIND DRIVER COUNT

[root@Tusharjahdav kernel]# tree | grep -i .ko  ----given list of drivers

[root@Tusharjahdav kernel]# tree | grep -i .ko | wc –l  ----given count
1286  --------------totol count of drivers

[root@Tusharjahdav kernel]# ls /lib/modules/2.6.32-431.el6.x86_64/kernel-----driver location
arch  crypto  drivers  fs  kernel  lib  mm  net  sound   ---------------drivers.

  
THERE ARE 3 TYPES OF KERNEL

1) MONALITHIC MODULAR ----------Used for Linux
2) MICRO KERNEL ----------------------Used for UNIX
3) EXO KERNEL ---------------------------Used for Developers

Linux used MONALITHIC MODULAR and Linux driver are installed separately
It’s modular drivers are separately installed and can be load and unload on the flight  


UNIX – MICRO KERNEL ----driver install all programs under Kernel
If you upgrade drivers in unix (PATCHING), that case we need to patching the kernel and need to down time.

How to check KERNEL Supported drivers or Parameters drivers
Example: N/W, NTFS, Fiber card, Video etc.

We get all the support driver information under this file (vi /boot/config-2.6.32-431.el6.x86_64)

[root@Tusharjahdav boot]# vi /boot/config-2.6.32-431.el6.x86_64
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_ZONE_DMA=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_GENERIC_ISA_DMA=y  ---------------y means enable
CONFIG_GENERIC_IOMAP=y
# CONFIG_NTFS_FS is not set  -------------------not supported
CONFIG_VFAT_FS=m------------------------m means enable

:set ic  - ignore case sensitivity
:set nu  ----set number
/quota   -------------to find quota
/cron   -------------to find cron
/ntfs   -------------to find ntfa

How to  find the installed kernel package from package

[root@Tusharjahdav /]# rpm –qf  file name

[root@Tusharjahdav /]# rpm -qf /sbin/fdisk
util-linux-ng-2.17.2-12.14.el6.x86_64

 How to find the installed kernel package from package

[root@Tusharjahdav /]# rpm -ql kernel   -----------------check kernel driver list
[root@Tusharjahdav /]# rpm -ql kernel | less   -----------check list page wise

/lib/modules/2.6.32-431.el6.x86_64/modules.networking
/lib/modules/2.6.32-431.el6.x86_64/modules.order
/lib/modules/2.6.32-431.el6.x86_64/source
/lib/modules/2.6.32-431.el6.x86_64/updates
/lib/modules/2.6.32-431.el6.x86_64/vdso
/lib/modules/2.6.32-431.el6.x86_64/vdso/vdso.so
/lib/modules/2.6.32-431.el6.x86_64/vdso/vdso32-int80.so
/lib/modules/2.6.32-431.el6.x86_64/vdso/vdso32-syscall.so
/lib/modules/2.6.32-431.el6.x86_64/vdso/vdso32-sysenter.so
/lib/modules/2.6.32-431.el6.x86_64/weak-updates

[root@Tusharjahdav /]# rpm -qa | grep -i kernel  ----to check specific file name

abrt-addon-kerneloops-2.0.8-21.el6.centos.x86_64
kernel-headers-2.6.32-431.el6.x86_64
kernel-2.6.32-431.el6.x86_64   ---------------------------installed kernel from this package
kernel-devel-2.6.32-431.el6.x86_64
dracut-kernel-004-335.el6.noarch
kernel-firmware-2.6.32-431.el6.noarch
libreport-plugin-kerneloops-2.0.9-25.el6.centos.x86_64
--------------------------------------------------------------------------------------------------------------------
How to upgrade kernel package

[root@Tusharjahdav /]# rpm -qa | grep -i kernel
kernel-2.6.32-431.el6.x86_64  -------------------check installed package version

Kernel files download from kernel.org web site

[root@Tusharjahdav /]# rpm -ivm kernel 2.6.22.18.e.16_64  ----whenever update the kernel used ivh (not –Uvh), after upgrade kernel installed 2nd kernel and if you want to lead 2nd kernel, just reboot the system and select 2nd upgraded version of kernel

 Add separate entry for new kernel in grup.conf

[root@Tusharjahdav /]# vi /etc/grub.conf

title CentOS (2.6.32-431.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=UUID=c79924a2-5e11-440d-add6-522144dec58d rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
        initrd /initramfs-2.6.32-431.el6.x86_64.img

reboot
Splash screen  --select 2 nd update kernel
new update kernel boot
how to update kernel manually and short cut

[root@Tusharjahdav /]# yum update kernel*

How to update OS

[root@Tusharjahdav /]# Yum update*

How to check update  ----

[root@Tusharjahdav /]# yum check-update

updates/primary_db                                                                                                                               | 3.3 MB     00:07
abrt-addon-ccpp.x86_64                           2.0.8-34.el6.centos                                base
abrt-addon-kerneloops.x86_64            2.0.8-34.el6.centos                                     base
abrt-addon-python.x86_64               2.0.8-34.el6.centos                                          base
abrt-cli.x86_64                                   2.0.8-34.el6.centos                                        base
abrt-libs.x86_64                            2.0.8-34.el6.centos                                               base
abrt-tui.x86_64                              2.0.8-34.el6.centos         
                                                 
[root@Tusharjahdav /]#  yum check-update php ----check specific package
--------------------------------------------------------------------------------------------------------------------

yum --exclude Command Line Option

 [root@Tusharjahdav /]# vi /etc/yum.conf   ------exclude php and kernel
[main]
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
exclude=php* kernel*    ----------------add this line

# yum --exclude=package\* update
# yum --exclude=php\* update
# yum --exclude=kernel\* update
# yum -x 'kernel*' -x 'php*' update
#  yum check-update | grep -i php
# yum --disableexcludes=all update
# yum --disableexcludes=main install php
# yum --disableexcludes=repoid install php httpd
# yum --exclude httpd update
#yum check-update | grep -i kernel
# yum check-update | egrep 'php|httpd|kernel'
# yum --disableexcludes=mongodb update
1.      all : Disable all excludes
2.      main : Disable excludes defined in [main] in yum.conf

3.      repoid : Disable excludes defined for given repo id

No comments:

Post a Comment