# ThinkPad randomly locks up and reboots



## ProphetOfDoom (Feb 20, 2019)

I was really in love with the idea of having FreeBSD as my everyday desktop OS but there's a big problem.
I leave my ThinkPad on 90% of the time. Approximately once every two or three days, it goes crazy. The fan comes on, the disk starts chugging noisily, and then the machine gradually becomes unresponsive to the point where the mouse pointer won't even move. If left, it then reboots itself.
I suspect KDE.
I don't even know how to begin troubleshooting this. Can anyone help?
PS this never happened with TrueOS or Ubuntu so I don't think it's a hardware issue.


----------



## Deleted member 30996 (Feb 20, 2019)

I always leave the Thinkpads I have in use running 24/7 and just posted a screenshot of the Thinkpad X61 that serves solely as my .mp3 player at 284 days uptime.

Sometimes the fan has got a little noisy and it could probably use cleaning, but it always settles back down and the music never stops. It's running right around the same temp as my desktop and neither could be running better.

I would try another HDD and see if that makes a difference. I have several and they're easy to swap out. If you suspect KDE try x11-wm/fluxbox.


----------



## vermaden (Feb 20, 2019)

AlexanderProphet said:


> I leave my ThinkPad on 90% of the time.


Which model?


----------



## ralphbsz (Feb 20, 2019)

Older ThinkPads are famous for having failing fans.  One of the symptoms of a failing fan is that it works fine when used intermittently or at low RPM, but if significant cooling is required and it has to run at high speed, the bearing does something "funny" (makes grinding noise, lots of friction), and goes into a bad mode.  Turning the fan off for a short time to the fan bearing can cool off sometimes cures this.

I have about a half dozen thinkpads at home, and have done fan replacement at least 2 or 3 times.  It is a big pain, takes me several hours.  No, I'm not suggesting that you buy spare fans and the screw kits, and start a fan replacement just in case; the effort is too much, and the risk of breaking something is too high.  All I'm saying is: This could easily be a hardware problem.


----------



## vermaden (Feb 20, 2019)

ralphbsz said:


> Older ThinkPads are famous for having failing fans.  One of the symptoms of a failing fan is that it works fine when used intermittently or at low RPM, but if significant cooling is required and it has to run at high speed, the bearing does something "funny" (makes grinding noise, lots of friction), and goes into a bad mode.  Turning the fan off for a short time to the fan bearing can cool off sometimes cures this.
> 
> I have about a half dozen thinkpads at home, and have done fan replacement at least 2 or 3 times.  It is a big pain, takes me several hours.  No, I'm not suggesting that you buy spare fans and the screw kits, and start a fan replacement just in case; the effort is too much, and the risk of breaking something is too high.  All I'm saying is: This could easily be a hardware problem.


I did not know that (that fan wil ldie when used a lot at high speed) on older ThinkPads.

I use T420s and X220 from the last real ThinkPad line, but I force the fan to be slow/quiet - not that I want to protect it from failure, I just like silence 

If you want, here is the *acpi-thinkpad-fan.sh* script:


```
#! /bin/sh

if ! kldstat | grep -q acpi_ibm.ko
then
  doas kldload acpi_ibm
fi

doas sysctl dev.acpi_ibm.0.fan=0 1> /dev/null

TEMP=$( sysctl -n hw.acpi.thermal.tz0.temperature | awk -F'.' '{print $1}' )

if [ ${TEMP} -lt 50 ]
then
  doas sysctl dev.acpi_ibm.0.fan_level=0 1> /dev/null
  exit 0
fi

if [ ${TEMP} -lt 60 ]
then
  doas sysctl dev.acpi_ibm.0.fan_level=1 1> /dev/null
  exit 0
fi

if [ ${TEMP} -ge 60 ]
then
  doas sysctl dev.acpi_ibm.0.fan_level=3 1> /dev/null
  exit 0
fi
```

... also available on GitHub:
*








						vermaden/scripts
					

Various scripts I wrote when using FreeBSD/Linux/UNIX systems for 15+ years. - vermaden/scripts




					github.com
				



*
I use it like that in *crontab(1) *as shown below:


```
% crontab -l
# ACPI/IBM/FAN
  *     *     * * * ~/scripts/acpi-thinkpad-fan.sh
```

The possible values of *dev.acpi_ibm.0.fan_level* are from* 0 *to *7*, I use *3* at max and its sufficient


----------



## ralphbsz (Feb 21, 2019)

vermaden said:


> I did not know that (that fan wil ldie when used a lot at high speed) on older ThinkPads.


No, I didn't mean that they idle in the sense of trying to run slow.  Instead what happens is that the fan can run fine at low speed.  If you try to run it at high speed, the bearing does something crazy (usually with nasty grinding sounds), and it effectively runs much slower, or nearly stops.  One of the T2x that I replaced the fan on was not rotating any longer, but instead just vibrated.

My ThinkPads are all much older than yours; I think the youngest one I have is a T61p; I still have a few T2x and T3x sitting around.  Including a T20 that was my main work machine for a long time (running Windows!), and was ultra-reliable and pleasant to use.


----------



## ProphetOfDoom (Feb 21, 2019)

Hi everyone thanks for all your suggestions. It's a ThinkPad x220.
`fsck -y` said that it "salvaged" and "cleared" several things although I'm a bit hazy on what actually happened and most of its output disappeared of the screen anyway. At the end it said "file system is clean"... would that imply no bad sectors? I guess so.
I can't install another OS easily as my only internet connection currently is on my phone. (I did download FreeBSD 12 using wireless tethering but I don't have enough data allowance for another OS lol).
No idea if it's the fan - the behaviour seems to me like some process is stuck in a "busy wait" and gradually bringing the whole system down with it. But I thought that could only happen on legacy OS like Windows 3.1???
I might be able to experiment with the MATE desktop if it's not too much to download - I really do have my doubts about KDE.
Thanks again.


----------

