Translate

Search This Blog

Add processor/core in physical/ virtual Linux machine

This look very trivial though it is simple but sure not trivial for non Linux expert so here I'm with my experience. If your Linux machine had only single CPU(or CPU with single Core) or you assigned it only 1 CPU and 1 core if it is virtual machine while installing Linux then installer installs NON SMP kernel so if you want too add new processor or add core in virtual machine then you must install SMP KERNEL and configure grub boot loader to use SMP.

1) add processor
2) install kernel-smp rpm
3) It will make grub appear as below you need to change highlighted as "replace 'nosmp' by 'smp' and 'noapic' by 'apic'  for line .ELsmp in below /etc/grub.conf "
4) optionally you can change default 1 to default 0 so that Linux boots with kernel-smp by default

[root@node2 ~]# uname -a
Linux node2.localdomain 2.6.9-55.0.0.0.2.ELsmp #1 SMP Wed May 2 14:59:56 PDT 2007 i686 i686 i386 GNU/Linux
[root@node2 ~]# cat /proc/cpuinfo
processor       : 0


[root@node2 ~]# cat /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda5
#          initrd /initrd-version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Enterprise Linux Enterprise Linux AS (2.6.9-55.0.0.0.2.ELsmp)
        root (hd0,0)
        kernel /vmlinuz-2.6.9-55.0.0.0.2.ELsmp ro root=LABEL=/ rhgb quiet divider=10 clock=pit nosmp noapic nolapic
        initrd /initrd-2.6.9-55.0.0.0.2.ELsmp.img
title Enterprise (2.6.9-55.0.0.0.2.EL)
        root (hd0,0)
        kernel /vmlinuz-2.6.9-55.0.0.0.2.EL ro root=LABEL=/ rhgb quiet divider=10 clock=pit nosmp noapic nolapic
        initrd /initrd-2.6.9-55.0.0.0.2.EL.img
[root@node2 ~]# vi /etc/grub.conf
[root@node2 ~]# init 6

[root@node2 ~]#
login as: root
root@192.168.174.103's password:
Last login: Wed Jun  4 10:48:07 2014 from 192.168.174.1
[root@node2 ~]#  cat /proc/cpuinfo
processor       : 0
..

processor       : 1
..
processor       : 2
..
processor       : 3
..

[root@node2 ~]# uname -a
Linux node2.localdomain 2.6.9-55.0.0.0.2.ELsmp #1 SMP Wed May 2 14:59:56 PDT 2007 i686 i686 i386 GNU/Linux