Sunday, December 12, 2010

enable and disable CPU in RHEL


Release:
RedHat Enterprise Linux Server 5

Problem:
Need to disable and enable the processor


Solution:

1) To disable the cpu use the below command

# echo 0 > /sys/devices/system/cpu/cpuX/online


Note: Here X indicates the cpu number


2) To enable the cpu use the below command

# echo 1 > /sys/devices/system/cpu/cpuX/online

3) To  check the number of cpu in a server use the below command

# grep "processor" /proc/cpuinfo | wc -l