4

I recently bought a second-hand laptop and I have installed Ubuntu 20.04 LTS on it. Everything appears on the surface to be working fine, but before I switch over to using this laptop as my main computer I wanted to run some tests to see how well the hardware is holding up.

I'm looking for a Linux command-line tool that will go through and test the different hardware and give me some kind of report about how well it's working. If the tool returns a binary working/not working for each component that would be helpful, and I'm sure this kind of tool exists. I'm wondering if it would be possible to go further than that and return some kind of estimation of the wear on each component, eg. I don't know if this information is accessible, but for the storage you could estimate wear by number of GB written. Is there a test that would return some kind of estimation of wear like this for different components?

I tried installing Phoronix Test Suite, but it looks incredibly complex, there's a zillion different options and I don't know where to start with it. So, any advice on either what tool I can use, or how to use PTS for this purpose would be greatly appreciated.

Jojo
  • 141
  • 1
  • 5

3 Answers3

1

You can use stress-ng. Useful stressing flags include: (Here, N represents the number of stressors.)

  1. –cpu N
  2. –io N
  3. –vm N
  4. –hdd N

You can run a command like this:- sudo stress-ng --cpu 4 --io 3 --vm 2 --vm-bytes 512M --timeout 30s. Take the values up to see if it starts causing problems. Then see the system load in the past 5 min using uptime command, or for detailed system load use glance command. For more info on uptime and glance refer to this.

uptime command gives output something like this :- 17:20:24 up 7:51, 2 users, load average: 5.14, 2.88, 2.17. The value that comes in the place of 5.14 is the value you must be concerned with. High values establish how good is your computer.

Note that you will need to install stress-ng before you can use it. Install using sudo apt-get install stress

1

I don't think there is a single tool that can easily do everything you are wanting.

To pull the specs of the hard drive/ssd (eg what it thinks of itself, how much use it has had), you can use S.M.A.R.T - The smartmontools package contains smartctl - so you can use a command like

 smartctl -a /dev/devname

Beyond this, you can test the memory using memtest86 or similar and use something like stress/stress-ng to test the CPU.

davidgo
  • 73,366
0

You can also use sysbench. Install by sudo apt install sysbench

CPU Benchmarking:
sysbench --test=cpu run
value on a decent computer-

  1. avg = 40 to 50 ms

MEMORY Benchmarking:
sysbench --test=memory run
Value on a decent computer-

  1. Transfer speed = 3500 to 4000 MBPS
  2. Avg = 0.0ms
  3. Max ≈ 0.15ms

IO Benchmarking:
sysbench --test=fileio --file-test-mode=seqwr run
Value on a decent computer-

  1. Transfer speed = 100-200 MBPS on HDD, 500-600MBPS on SSD
  2. Avg = 0.01ms
  3. Max ≈ 10-12ms