0

As some of you may know, there is a common problem in some old notebooks, between battery and adapter, which is when charger plugged in, computer restarts itself, and this is a real pain in the neck.

There are one or two different solutions for this problem, for example, the one can disable the second CPU via Device Manager in Windows' safe mode and by this way restarting would be prevented. But you know, things work different in Ubuntu, there isn't any chance to disable the second CPU via "Device Manager" since there is not any "Device Manager". So I was looking for a appropriate solution and I found one. There is a terminal code that let me disable the second CPU, which is:

echo 0 | sudo tee /sys/devices/system/cpu/cpu1/online

When I enter this command, it works like a charm and there is no problem, but the problem is, after shutting down the computer and reopening it, CPU enables itself automatically.

So that's the problem. Sometimes I forget to enter this command and thus my laptop repeats itself and my whole work goes into trouble.

Is there any way to make this command "permanent" ? Or is there any other way to disable the second CPU?

g_p
  • 18,504
  • Nope, they didn't work. It still kicks me out in the black screen (bios transition) and repeats itself, even before I can reach Linux interface. I tried to disable second CPU from the BIOS screen, by the way. Neither it did work. – Benjamin Park Jan 29 '15 at 23:24

1 Answers1

1

In the file /etc/default/grub the number of CPUs can be specified (limited) on the "GRUB_CMDLINE_LINUX_DEFAULT=" line. Example (where I have added it to something that was already on the line):

GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 maxcpus=1"

Notes: In case of problems, it is a good idea to save a copy of your original grub file first:

sudo cp /etc/default/grub /etc/default/grub.original

You have to edit as sudo (i.e. sudo nano /etc/default/grub) and you have to update grub afterwards:

sudo update-grub
Doug Smythies
  • 15,448
  • 5
  • 44
  • 61