Express diagnostics of PCs/laptops without the need to install drivers / Habr

Express diagnostics of PCs/laptops without the need to install drivers / Habr

It will be about x86 PCs/notebooks/monoblocks. About how to check the functioning of various laptop subsystems: display, keyboard, touchpad, USB ports, Ethernet and WiFi network cards, built-in speakers, WEB camera, microphone. Check battery status indicators, SMART HDD and SSD indicators, including NVMe. Check the temperature and stability of the CPU and GPU under load.

In which cases it will be necessary:

  • PC/laptop/monoblock (new or used) comes without OS

  • During the express check of the PC after assembly, from new or used components

  • The device arrived for repair with the bootable SSD/HDD removed

  • One or more subsystems do not work in the installed OS (touchpad, sound, WiFi, WEB camera)

  • OS user password or BitLocker enabled

  • The installed OS does not load

To begin with, software for testing RAM should be noted. Free Memtest86+ GPLv2 and proprietary PassMark MemTest86 (exists in two versions Free and Pro). Both boot directly from bootloader or UEFI. The first supports legacy/CSM boot, the second only UEFI.

Checking the display, keyboard, touchpad

To check the display, keyboard, touchpad, USB ports, network cards, you can use the method of the current version of any of the Linux distributions (those that support downloading without installation in Live mode).

If you have dealt with the installation of Windows OS on modern laptops on the Intel platform, you probably noticed that the touchpad does not work during installation and requires the appropriate version of the I2C bus driver. At the same time, on some models, you can check the operation of the touchpad in UEFI Setup, but not all of them have this functionality. Then you can use LiveUSB from Linux. An I2C driver is already built into the Linux kernel and they work on most laptop models.

Network cards, display and keyboard can also be tested by running Linux from a flash drive. Connect to the Internet, launch a WEB browser, open any of the online LCD tests and then the online keyboard test. For example, Eizo Monitor Tests and key-test.ru.

xfce4-display-settings

For gaming laptops, it is advisable to check whether the screen refresh rate is set correctly. There are defects of LCD modules that are not detected at 60 Hz, but are immediately visible at the maximum frequency.

Checking of USB ports and the function of loading into RAM

USB ports can be checked by trying to boot from a flash drive.
View the list of USB devices (in the terminal) lsusb

You can also check the correctness of the determination of the speed of the USB2.0/3.0 HighSpeed/SuperSpeed ​​ports. To do this, you need to remove the flash drive, run it in the terminal
dmesg -Wt and then insert the flash drive again.

In order for the bootable flash drive to be extracted, you need to use the function of loading the distribution into the RAM, for example, for Ubuntu, add the startup parameter to the bootloader toram.

This will require enough RAM to accommodate the entire file filesystem.squashfs (a little less than the volume of the entire .iso image). Based on the size of modern distributions, a minimum of 6 GB of RAM is required for operation, and the loading process takes a long time (depends on the speed of the flash drive).

LiveUSB DogLinux Debian 12

I suggest using a specialized LiveUSB based on Debian and DogLinux. The project is non-commercial and will remain so.

DogLinux is such a constructor for assembling a minimalist LiveCD in the style of Puppy Linux on the Debian package base

A script to build the current version based on Debian 12 Bookworm is available at forum.puppylinux.com

It uses debootstrap and several packages in its own GitHub repositories

A choice of various DE/WM, SysVinit/SystemD, live-boot and/or Initrd from Porteus is available

I modified the script I used to build the base system 01-filesystem.squashfs also available at forum.puppylinux.com

Checking the WEB camera

The LiveUSB assembly provides for this luvcview. Minimalistic, independent of GStreamer/FFmpeg. Or you can run it from the terminal mpv /dev/video0

In other distributions, you can use the same MPV, or install Guvcview or Cheese

Checking the built-in speakers and microphone

To check the stereo speakers, run it in the terminal speaker-test -c 2 -t wav
In the LiveUSB assembly, there is a shortcut for this in the speaker-test.desktop program menu
To adjust the volume, you can run alsamixer

To test the microphone, run it in the terminal arecord test.wavmake some sounds, then press Ctrl+C and run aplay test.wav. If everything is fine, you will hear the recording through the speakers.

Checking network cards

Viewing the list of interfaces with IP addresses (in the terminal) ifconfig
Run in a normal distribution /sbin/ifconfig and /sbin/ethtool

To check the current speed (100/1000/2500Mb/s) of the Ethernet connection, you can run it in the terminal ethtool eth0
Or use the graphical nm-applet in the tray – right-click on the icon, item Connection Information.

To monitor available WiFi networks and connection parameters (signal level and quality, frequency, channel number and width), the LiveUSB collection has wavemon

You can use it to test the load of network connections iperf or iperf3

Checking the condition of the battery

To view the nominal and remaining capacity of the battery, you can run it in the terminal
upower -i /org/freedesktop/UPower/devices/battery_BAT1

xfce4-power-manager

Or use the graphical interface – the battery symbol in the tray. In order for the indicators to be closer to the truth, it is recommended to first perform a full cycle of charging, discharging and charging again.

Checking the status of HDD and SSD

The commands below require running from root. If you will use them in a regular distribution, then you need to add them sudo early.

Before running the following commands. If multiple SATA/USB/NVMe drives are connected to the system. Team lsscsi will display a list of device addresses, they must be substituted for the commands instead /dev/sda and /dev/nvme0n1

To check the SMART HDD and SATA SSD, run it in the terminal
smartctl -s on -a /dev/sda

For NVMe SSD run in terminal
nvme smart-log /dev/nvme0n1

There is also a graphical utility GSmartControl for HDD and SATA SSD. There is a LiveUSB build and available in the distribution repositories.

WHDD to estimate linear read latencies of MHDD-style HDD sectors

HDD with errors, launched by GSmartControl and WHDD

Modules with a proprietary program for monitoring HDD/SSD Hard Disk Sentinel Linux Edition (FREE) have been added to the LiveUSB assembly. NVMe SSDs are supported.

When called from the hdsentinel.desktop menu, it generates a report that opens in the NetSurf browser
hdsentinel -html -r ~/hdsentinel && netsurf ~/hdsentinel.html

Hard Disk Sentinel report on NVMe SSDs

You can use dd_rescue to check SATA/NVMe SSD for read errors
dd_rescue -d /dev/sda /dev/null
dd_rescue -d /dev/nvme0n1 /dev/null

To test the eMMC
dd_rescue -d /dev/mmcblk0 /dev/null

To check for errors during recording, you can use the utility badblocks from the e2fsprogs package (available in every distribution). Attention is everything data on disk will be destroyed!
badblocks -sv -p 1 -w /dev/sdc
badblocks -sv -p 1 -w /dev/nvme0n1
badblocks -sv -p 1 -w /dev/mmcblk0

Output of information about the system and readings of temperature sensors

View information from DMI. Information recorded by the equipment manufacturer or assembler. Usually there is BIOS/UEFI version, model, serial number. Since the listing is very long, it is convenient to use less in the terminal for viewing
dmidecode | less

Viewing the list of PCI/PCE-E devices (in the terminal) lspci and in detail lscpi -v

CPU-X view system information (similar to CPU-Z)

View CPU temperature sensors, AMD GPU, NVMe SSD, fan speed watch sensors
View NVIDIA GPU load, temperature, power consumption, and other parameters watch nvidia-smi

For convenience, the appropriate shortcuts have been added to the LiveUSB menu of the build.

CPU and GPU stability testing under load

CPU load testing (in the terminal) stress -c кол-во_ядер

AMD and Intel video cards work with free drivers (they do not require any installation and are already included in the form of Linux kernel modules + userspace Mesa libraries).

Meanwhile, the nouveau driver currently does not provide maximum loading of NVIDIA video cards, and it will not work to organize a stress test with its help. Must use proprietary NVIDIA drivers.
How would support for frequency control in nouveau be added when using GSP firmwares for video cards starting with Turing. As far as I understand it does not work for Maxwell and Pascal and may never work again.

Three versions of proprietary NVIDIA drivers are included in the LiveUSB assembly – current 525.x, and legacy 390.x and 340.x. The driver module required for loading is determined automatically.

When running GPUTest (FurMark) and Unigine Heaven, laptop configurations with Intel+NVIDIA, Intel+AMD, and AMD+NVIDIA switching graphics cards are automatically detected and the necessary environment variables are set to run on a discrete graphics card.

gputest.sh and unigine-heaven.sh
#!/bin/sh

if [ "$1" = "-h" -o "$1" = "--help" ]; then
echo "Usage:"
echo gputest [OPTION]... [TEST]
echo "                          Options:"
echo -e "Try to detect double GPU\E[34m\033[1m  gputest -auto"
tput sgr0
echo -e "Run on nVidia optimus GPU\E[32m\033[1m gputest -optimus"
tput sgr0
echo -e "Run on discrete AMD GPU\E[31m\033[1m   gputest -prime"
tput sgr0
echo -e "Show gallium HUD\E[36m\033[1m          gputest -hud"
tput sgr0
echo "                          *Only on AMD and modern Intel GPU"
echo "Tests:"
echo FurMark fur, GiMark gi, pixmark_volplosion, TessMark tess_x32, tess_x64
exit
fi

run () {
exec ./GpuTest /no_log_score /gpumon_terminal /test="$TEST" /width=1024 /height=640 "$@"
}

optimus () {
export __NV_PRIME_RENDER_OFFLOAD=1
export __GLX_VENDOR_LIBRARY_NAME=nvidia
}

export __GL_SYNC_TO_VBLANK=0

if [ "$1" = "-auto" ]; then shift
  [ -f /tmp/kmodules ] || lsmod >/tmp/kmodules
  if grep -q nvidia /mnt/live/tmp/modules; then
    if egrep -qe "i915|radeon|amdgpu" /tmp/kmodules; then optimus; fi
  elif egrep -qe "radeon|amdgpu|nouveau" /tmp/kmodules; then
    if grep -q i915 /tmp/kmodules; then export DRI_PRIME=1; fi
  fi
elif [ "$1" = "-optimus" ]; then shift; optimus
elif [ "$1" = "-prime" ]; then shift; export DRI_PRIME=1
fi

if [ "$1" = "-hud" ]; then shift
export GALLIUM_HUD=".x5.y30.w900.h180fps,.w900.h200GPU-load+temperature"
fi

if [ -z "$1" ]; then TEST=fur
else TEST="$1"
shift
fi

if [ -f GpuTest ]; then run
elif [ -f /opt/gputest/GpuTest ]; then
cd /opt/gputest && run
fi
#!/bin/sh

if [ "$1" = "-h" -o "$1" = "--help" ]; then
echo "                          Options:"
echo -e "Try to detect double GPU\E[34m\033[1m  unigine-heaven -auto"
tput sgr0
echo -e "Run on nVidia optimus GPU\E[32m\033[1m unigine-heaven -optimus"           
tput sgr0
echo -e "Run on discrete AMD GPU\E[31m\033[1m   unigine-heaven -prime"
tput sgr0
echo -e "Show gallium HUD\E[36m\033[1m          unigine-heaven -hud"
tput sgr0
echo "                          *Only on AMD and modern Intel GPU"
exit
fi

run () {
exec ./browser_x64 -config ../data/launcher/launcher.xml "$@"
}

optimus () {
export __NV_PRIME_RENDER_OFFLOAD=1
export __GLX_VENDOR_LIBRARY_NAME=nvidia
}

export __GL_SYNC_TO_VBLANK=0

if [ "$1" = "-auto" ]; then shift
  [ -f /tmp/kmodules ] || lsmod >/tmp/kmodules
  if grep -q nvidia /mnt/live/tmp/modules; then
    if egrep -qe "i915|radeon|amdgpu" /tmp/kmodules; then optimus; fi
  elif egrep -qe "radeon|amdgpu|nouveau" /tmp/kmodules; then
    if grep -q i915 /tmp/kmodules; then export DRI_PRIME=1; fi
  fi
elif [ "$1" = "-optimus" ]; then shift; optimus
elif [ "$1" = "-prime" ]; then shift; export DRI_PRIME=1
fi

if [ "$1" = "-hud" ]; then shift
export GALLIUM_HUD=".x5.y30.w900.h180fps,.w900.h200GPU-load+temperature"
fi

if [ -f heaven_x64 ]; then run
elif [ -f bin/heaven_x64 ]; then cd bin && run
elif [ -f /opt/unigine-heaven/bin/heaven_x64 ]; then
cd /opt/unigine-heaven/bin && run
fi

You can run the tests immediately after downloading, no additional actions are required.

LiveUSB of the DogLinux assembly allows several laptops (with hardware of different generations) to be launched simultaneously in copy2ram mode. Run FurMark or Unigine Heaven on each, and remove the flash drive.

Related posts