# HW Issues - `/dev` is a virtual directory with block and character devices - unique `/dev` locations - `/dev/random` spews random numbers after enough entropy is built-up within system - `/dev/urandom` spews random numbers w/o waiting - `/dev/zero` spews null character aka ASCII 0x00 - `/dev/null` is a black hole; `stderr` is often sent here - `command 2> /dev/null` - device mapper - device mapper function is preformed by the kernel to map physical to virtual block devices - see `/dev/mapper` - used by LVM and LUKS - `/proc` directory is an important tool for HW troubleshooting - `cat /proc/interrupts` to view HW interrupt requests (IRQs) which enable HW devices to indicate that they have data to send to the CPU - `cat /proc/ioports` to show locations in memory where the CPU can send data to or receive data from ![[images/Pasted image 20250731134005.png]] - `cat /proc/mdstat` to check status of RAID array - `/sys` directory is another important tool for HW troubleshooting ![[images/Pasted image 20250731134458.png]] - `lsdev` retrieves info from `/proc/interrupts`, `/proc/ioports`, and `/proc/dma` (direct memory access channels) - `lsblk` shows block devices plus their partitions and mount points - `dmesg` shows kernel-level events - kept as a ring buffer - commonly piped to `tail` to show most recent messages - `lspci` shows pci devices ![[images/Pasted image 20250731135144.png]] - `lspci -nn` shows all device names and numbers - `lsusb` shows usb devices ![[images/Pasted image 20250731135214.png]] - `dmidecode -t memory` shows memory mfg info - `dmidecode -t system` shows system info - `lshw -short` shows short version of system HW ![[images/Pasted image 20250731143707.png]] - `lshw -class type` shows info specified HW type such as memory![[images/Pasted image 20250731143824.png]] - CUPS for printing interface - see http://localhost:631 - use `lcq` to print from the command line - `udev` monitors kernel ring buffer for new hot-pluggable devices and follows rules defined in `/etc/udev/rules.d` - `udevadm` to manage udev type devices - device drivers - `udevadm info -an /dev/sda | grep -i drivers` - `lsmod | grep ahci` - `modinfo ahci` # Networking Issues - `cat /proc/net/dev`shows received/transmitted packets for each interface - common commands - `ip a`shows network interface info - `ip a show dev intefrace_name` shows info for a specific network interface - `ip link set interface_name down` to disable the specified network intefrace - `ping` indicates whether a host is reachable - FWs may block ICMP traffic - -c for count of ICMP packets, -i for interval, -t for defining TTL value, -v for verbose output - `tracert` shows hops to target - `ifconfig interface_name up/down` to enable or disable interface - `nslookup` and `dig` to test dns - `sudo nano /etc/netplan/01-network-manager-all.yaml` to configure network settings such as DHCP, gateway, DNS ![[images/netplan.png]] - `sudo netplan apply` to enable modifications - apache webserver - `sudo apt update && sudo apt install apache2` to determine whether apache2 is installed and up to date - `sudo service apache2 status` to determine whether apache2 is running - `whereis apache2` to determine where apache2 files are located - `curl http://ip_address` to determine whether the default apache html is returned - `ps aux | egrep '(apache|httpd)'` to show apache and httpd processes - `pstree` and `pstree -p` show familial hierarchy for processes # DNS Issues - resolves FQDNs to IP addresses - if DNS issue persist, first perform basics - `ip a` to determine whether network interface is up and IPv4 and IPv6 are assigned - `ip route` to determine whether route it setup to exit LAN - `sudo resolvectl flush-caches` to flush DNS caches - `nslookup google.com` to determine whether google resolves - `sudo resolvectl query google.com` to test DNS resolution - `nano /etc/systemd/resolved.conf` to examine DNS config file for `systemd-resolved.service` - `/etc/systemd/resolved.conf` is a config file for the systemd-resolved service, a system service that handles network name DNS for local apps - `sudo systemctl restart systemd-resolved.service` to effect change to `/etc/systemd/resolved.conf` - `cat /etc/resolvd.conf` shows DNS config