Managing Hardware Devices
1. Viewing Device Information
| Command | Description | Example Output |
|---|---|---|
| lsblk | List block devices including disks and partitions | |
| lshw | Get detailed hardware information | |
| lspci | List PCI devices (e.g., graphics cards, network adapters) | |
| lsusb | List USB devices connected to the system | |
| dmidecode | Access DMI/SMBIOS information (system firmware details) | |
Note: Some commands like
lshw may require root privileges to display full details.
2. Monitoring Hardware with sensors
| Command | Description | Example |
|---|---|---|
| sensors | Displays sensor data from hardware sensors | sensors |
| sensors -u | Displays sensor data in a more detailed format | sensors -u |
| sensors -f | Displays sensor data in a flat format (useful for scripting) | sensors -f |
Example: Displaying sensor data
sensors
ibp-isa-0000
Adapter: ISA adapter
CPU Temperature: +45.0°C (high = +100.0°C, critical = +120.0°C)
GPU Temperature: +55.0°C (high = +100.0°C, critical = +120.0°C)
coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +45.0°C (high = +100.0°C, critical = +120.0°C)
Core 0: +43.0°C (high = +100.0°C, critical = +120.0°C)
Core 1: +45.0°C (high = +100.0°C, critical = +120.0°C)
Note: The
sensors command requires the lm-sensors package to be installed.
Warning: Sensor readings may vary depending on the hardware and driver support.
3. Testing Hard Drives
| Command | Description | Usage |
|---|---|---|
| dd | Copy and convert files, often used for disk testing | dd if=/dev/zero of=/dev/sdX bs=1M count=100 |
| hdparm | Get and set hard disk parameters | hdparm -Tt /dev/sda |
| smartctl | Control and monitor S.M.A.R.T. (Self-Monitoring, Analysis and Reporting Technology) | smartctl -a /dev/sda |
4. Viewing Disk SMART Status
| Option | Values | Description |
|---|---|---|
| -H | smartctl -H |
Check overall health status of the drive |
| -i | smartctl -i |
Display device identification information |
| -A | smartctl -A |
Display all SMART attributes |
| -l | smartctl -l |
Display logs (e.g., error logs) |
Note: Ensure the drive is not in use before running SMART tests.
Warning: Some drives may not support SMART or may return inaccurate data depending on the manufacturer.
SMART Status Indicators
- PASSED: Drive is healthy and functioning properly.
- FAILED: Drive has detected errors and should be replaced immediately.
- UNKNOWN: SMART data is not available or cannot be read.
5. Managing USB Devices
| Command | Description | Notes |
|---|---|---|
| lsusb | List USB devices connected to the system | Shows vendor, product, and device details |
| usb-devices | Display detailed USB device information | More verbose than lsusb, includes device hierarchy |
| dmesg | grep -i usb | View USB-related messages in kernel log | Useful for debugging connection issues |
Note: USB devices are managed by the Linux kernel's USB subsystem. Permissions for accessing USB devices can be controlled via udev rules.
Warning: Avoid unplugging USB devices while they are actively transferring data, as this can lead to data corruption or loss.
6. Configuring Sound Devices
| Device | Configuration File | Description |
|---|---|---|
| /etc/asound.conf | /etc/asound.conf |
Global ALSA configuration file for sound device settings |
| ~/.asoundrc | ~/.asoundrc |
User-specific ALSA configuration file |
Example: Basic ALSA Configuration
pcm.!default {
type plug
slave.pcm "hw:0,0"
}
ctl.!default {
type hw
card 0
}
Note: Use
alsamixer to adjust volume levels and mute settings interactively.
Warning: Modifying ALSA configurations can affect audio output. Always backup configuration files before changes.
| Command | Description | Usage |
|---|---|---|
| alsamixer | Interactive audio mixer | alsamixer |
| amixer | Command-line audio mixer | amixer sset Master 70% |
| aplay | List available audio devices | aplay -l |
| arecord | Record audio from a device | arecord -d 10 test.wav |
7. Managing Graphics Drivers
| Driver | Support Status | Notes |
|---|---|---|
| nvidia | NEW Supported | Latest NVIDIA drivers for GeForce and Quadro series |
| amdgpu | NEW Supported | Open-source driver for AMD GPUs (Radeon VII and newer) |
| intel | Stable | Intel integrated graphics support (HD Graphics 500 series and newer) |
| vmwgfx | Legacy | VMware SVGA driver, deprecated in favor of newer versions |
Note: Ensure the system has sufficient power supply and cooling for high-performance GPUs.
Warning: Avoid mixing proprietary and open-source drivers for the same GPU.
8. Controlling Laptop Brightness
| Method | Description | Notes |
|---|---|---|
| /sys/class/backlight/ | Virtual filesystem for brightness control | Available on most modern Linux systems |
| xbacklight | Command-line tool to adjust backlight | Part of x11-xbacklight package |
| brightnessctl | Modern tool to control brightness | More reliable than xbacklight, supports multiple devices |
Note: On some systems, you may need to run
brightnessctl with sudo if the device is not accessible to regular users.
Warning: Setting brightness too high or too low can cause display issues or damage the screen.
9. Managing Power Settings
| Setting | Description | Command |
|---|---|---|
| power state | Current power state of the system | cat /sys/class/power_supply/BAT0/online |
| battery level | Current battery percentage | upower -i /org/freedesktop/UPower/devices/battery_BAT0 |
| suspend mode | System suspend modes (e.g., S3, S4) | cat /sys/power/mem_sleep |
Example: Check power usage
upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E "percentage|state"
Example: Set CPU governor
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Note: Some power settings may require root privileges to modify.
Warning: Incorrect power settings can cause system instability or unexpected shutdowns.
10. Configuring Bluetooth
| Configuration File | Path | Description |
|---|---|---|
| /etc/bluetooth/main.conf | /etc/bluetooth/main.conf |
Global Bluetooth configuration file for daemon settings |
| /etc/bluetooth/autoconnect.conf | /etc/bluetooth/autoconnect.conf |
Defines automatic connection rules for paired devices |
Example: Enable Bluetooth on Boot
# Enable Bluetooth service to start on boot
sudo systemctl enable bluetooth
# Start the Bluetooth service immediately
sudo systemctl start bluetooth
Example: Pairing a Bluetooth Device
# Launch Bluetoothctl
bluetoothctl
# Scan for devices
[bluetooth]# scan on
# Pair with device (replace MAC address)
[bluetooth]# pair AA:BB:CC:DD:EE:FF
# Trust the device
[bluetooth]# trust AA:BB:CC:DD:EE:FF
# Connect to device
[bluetooth]# connect AA:BB:CC:DD:EE:FF
Note: Ensure the
bluetoothctl utility is installed via bluez-tools package.
Warning: Some Bluetooth devices may require specific drivers or firmware to function properly.
| Command | Description | Usage |
|---|---|---|
| bluetoothctl | Interactive Bluetooth management tool | bluetoothctl |
| hciconfig | Configure Bluetooth adapter settings | hciconfig -a |
| bluetoothctl | Control Bluetooth services and devices | bluetoothctl show |
11. Viewing Battery Status
| Command | Description | Example Output |
|---|---|---|
| acpi | Displays battery status and power source information | Battery 0: discharging, 85%, 02:15:42 remaining |
| upower | Provides detailed power management information | |
| cat /sys/class/power_supply/BAT0/capacity | Reads battery capacity directly from sysfs | 85 |
| cat /sys/class/power_supply/BAT0/status | Reads battery status (charging, discharging, full) | Discharging |
Note: The battery device path may vary (e.g., BAT1, BAT2) depending on the system configuration.