<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://cache.forums.debian.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Distro-nix</id>
	<title>Debian Forums Cache - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://cache.forums.debian.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Distro-nix"/>
	<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Special:Contributions/Distro-nix"/>
	<updated>2026-06-07T10:48:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=278</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=278"/>
		<updated>2026-05-19T14:40:52Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: Repair filesystem rewrite&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Author&#039;&#039;&#039; &#039;&#039;&#039;Profile:&#039;&#039;&#039; [https://forums.debian.net/memberlist.php?mode=viewprofile&amp;amp;u=239099 distro-nix]  &#039;&#039;&#039;Debian Version:&#039;&#039;&#039; Debian 13 (Trixie) &#039;&#039;&#039;Kernel Versions Tested:&#039;&#039;&#039; 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64 (x86_64) &#039;&#039;&#039;Created:&#039;&#039;&#039; 2025-10-27 &#039;&#039;&#039;Last Updated:&#039;&#039;&#039; 2026-05-15 &#039;&#039;&#039;ID:&#039;&#039;&#039; 544201 &#039;&#039;&#039;License:&#039;&#039;&#039; CC BY-SA 4.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This guide is preserved in its original form. Questions and feedback welcome via the author’s &amp;lt;dfn&amp;gt;Debian Forums profile&amp;lt;/dfn&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The Debian First Aid Kit is a practical reference for diagnosing and resolving common system problems on Debian GNU/Linux. It covers commonly occuring categories of failure: system freezes and crashes, boot problems, network issues, package management, disk and filesystem errors, performance degradation, service and application failures, permission and access problems, hardware identification and errors, and quick diagnostics. Each section gives the relevant commands so you can understand what they do and why, rather than a bare list to copy and paste blindly. A dedicated section covers MTR (Matt’s Traceroute) in depth, including how to interpret the output; practical troubleshooting, and how to monitor continuously. The guide also includes a set of shell aliases for faster access to common diagnostic tasks. All commands are verified on Debian 13 (Trixie) running kernel 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64. This document is intended for users with basic command-line familiarity who need a reliable, consolidated reference when something goes wrong.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Keywords:&#039;&#039;&#039; Debian, troubleshooting, system administration, MTR, network diagnostics, package management, journalctl, filesystem repair&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tested Commands Disclaimer ==&lt;br /&gt;
All commands in this document have been verified on Debian 13 (Trixie) with the kernel versions listed above. Results may vary on other releases or hardware configurations. Always test in a safe environment before making changes to a production system.&lt;br /&gt;
&lt;br /&gt;
== Conventions Used in This Document ==&lt;br /&gt;
Command examples throughout this guide follow standard Unix prompt conventions. A $ prefix indicates a command run as a regular user. Where elevated privileges are required, sudo is shown explicitly and # with a brief helpful explanation unless it is self-explanatory:&lt;br /&gt;
 $ journalctl -b -1                        # regular user&lt;br /&gt;
 $ sudo apt install mtr                    # requires elevation via sudo&lt;br /&gt;
In recovery shell contexts, where you are operating directly as root, the prompt is #. In these cases, Debian recommends:&lt;br /&gt;
 $ sudo -i &lt;br /&gt;
&lt;br /&gt;
== System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics:&#039;&#039;&#039; Search for “kernel panic” or “Oops”&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM):&#039;&#039;&#039; Search for “Out of memory” or “oom-killer”&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors:&#039;&#039;&#039; Look for “MCE” (Machine Check Exception) or “hardware error”&lt;br /&gt;
* &#039;&#039;&#039;Driver issues:&#039;&#039;&#039; Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating:&#039;&#039;&#039; Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 $ free -h                                 # memory usage&lt;br /&gt;
&lt;br /&gt;
 $ df -h                                   # disk space&lt;br /&gt;
&lt;br /&gt;
 $ htop                                    # interactive resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ top                                     # alternative resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt install btop                   # btop is a more detailed alternative&lt;br /&gt;
&lt;br /&gt;
 $ sudo dmesg | grep -i error              # check for disk errors&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN                     # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX              # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub                        # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab                          # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
The following are permanent errors caused by incomplete or buggy ACPI tables in the BIOS. They are harmless and can be safely ignored if they appear on your system:&lt;br /&gt;
 [0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&lt;br /&gt;
 [0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&lt;br /&gt;
 [0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&lt;br /&gt;
&lt;br /&gt;
== Boot Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Check Boot Process ===&lt;br /&gt;
 $ systemd-analyze blame                   # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemd-analyze blame                   # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemctl --failed                      # units that failed during boot&lt;br /&gt;
&lt;br /&gt;
 $ systemctl status &amp;lt;service-name&amp;gt;         # e.g. systemctl status NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN                     # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX              # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub                        # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab                          # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
== Network Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose Network Connection ===&lt;br /&gt;
 $ ip addr show                            # check network interfaces&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 4 8.8.8.8                       # test IPv4 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 6 2a00:1450:4007:809::200e      # test IPv6 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ nslookup google.com                     # check DNS resolution&lt;br /&gt;
&lt;br /&gt;
 $ ip route show                           # view routing table&lt;br /&gt;
&lt;br /&gt;
 $ ss -tuln                                # check active connections &lt;br /&gt;
&lt;br /&gt;
=== Restart Network Service ===&lt;br /&gt;
 $ sudo systemctl restart NetworkManager   # for systems using NetworkManager&lt;br /&gt;
&lt;br /&gt;
 $ sudo systemctl restart networking       # for systems using networking service&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 down              # bring interface down&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 up                # bring interface back up&lt;br /&gt;
&lt;br /&gt;
== MTR (Matt’s Traceroute) ==&lt;br /&gt;
MTR combines the functionality of ping and traceroute into a single real-time network diagnostic tool. It continuously monitors the path between your system and a destination, providing detailed statistics about latency and packet loss at each hop. When you need to demonstrate a network problem that is outside your control—to your hosting provider, for example—MTR gives you the evidence you need.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
 $ sudo apt install mtr&lt;br /&gt;
&lt;br /&gt;
=== Basic Usage ===&lt;br /&gt;
 $ mtr google.com                          # interactive mode&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report google.com                 # report mode (10 cycles then exit)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 50 google.com       # specify number of cycles&lt;br /&gt;
&lt;br /&gt;
 $ mtr --tcp google.com                    # use TCP instead of ICMP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --udp google.com                    # use UDP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --no-dns google.com                 # skip DNS resolution (faster)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --show-ips google.com               # show both hostnames and IPs&lt;br /&gt;
&lt;br /&gt;
== Understanding MTR Output ==&lt;br /&gt;
&lt;br /&gt;
==== Sample Output ====&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    10   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
   4.|-- ???                      100.0%    10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   5.|-- google.com                 0.0%    10   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
&lt;br /&gt;
=== Column Meanings ===&lt;br /&gt;
&#039;&#039;&#039;HOST&#039;&#039;&#039; — Hostname or IP address of each hop in the route.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loss%&#039;&#039;&#039; — Percentage of packets lost at this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Snt&#039;&#039;&#039; — Number of packets sent to this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last&#039;&#039;&#039; — Latency of the most recent packet, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Avg&#039;&#039;&#039; — Average latency across all packets sent, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best&#039;&#039;&#039; — Lowest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wrst&#039;&#039;&#039; — Highest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StDev&#039;&#039;&#039; — Standard deviation of latency measurements—lower values indicate a more stable connection.&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Results ===&lt;br /&gt;
A healthy network shows 0% loss on all hops, stable latency with low StDev values, a gradual latency increase as hop count increases, and consistent response times.&lt;br /&gt;
&lt;br /&gt;
==== Problem Indicators ====&lt;br /&gt;
&#039;&#039;&#039;1. High Packet Loss at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 5.|-- problem-router.net        25.0%    10   45.3  48.2  42.1  65.8  8.4&lt;br /&gt;
If loss continues to the destination, there is a real problem at that router. If loss appears only at that hop but not beyond, the router is likely rate-limiting ICMP responses—a false positive, not a real problem. The rule of thumb: if packet loss appears at hop N but hops N+1, N+2, and beyond show 0% loss, it’s almost certainly ICMP rate limiting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. High Latency at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 3.|-- slow-link.net              0.0%    10  150.3 155.2 148.1 165.8  5.4&lt;br /&gt;
This indicates a network bottleneck, a congested link, geographical distance (intercontinental hops), or slow routing equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. No Response (???)&#039;&#039;&#039;&lt;br /&gt;
 4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
The router at this hop is configured not to respond to ICMP or traceroute packets, or a firewall is blocking diagnostic packets. This is not necessarily a problem if later hops respond normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. High Jitter (StDev)&#039;&#039;&#039;&lt;br /&gt;
 6.|-- unstable.net               0.0%    10   35.3  52.8  28.1  95.2  24.7&lt;br /&gt;
A high StDev (24.7ms in this example) indicates inconsistent latency caused by network congestion or instability. This is particularly noticeable in real-time applications such as VoIP, gaming, and video calls.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Sudden Latency Spike&#039;&#039;&#039;&lt;br /&gt;
 1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
 2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
 3.|-- problematic-hop.net        0.0%    10  180.5 185.2 178.1 195.8   6.4&lt;br /&gt;
 4.|-- next-hop.net               0.0%    10  182.3 187.8 180.5 198.2   6.8&lt;br /&gt;
Hop 3 introduces approximately 170ms of additional latency (jumping from 9ms to 180ms). Everything from hop 3 onward carries that penalty.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Report Mode with Different Output Formats ====&lt;br /&gt;
 $ mtr --report --csv google.com &amp;gt; network-report.csv    # CSV for logging&lt;br /&gt;
 $ mtr --report --json google.com                        # JSON for parsing&lt;br /&gt;
 $ mtr --report --xml google.com                         # XML format&lt;br /&gt;
 $ mtr --report-wide google.com                          # wide report, no abbreviations&lt;br /&gt;
&lt;br /&gt;
==== Protocol Selection ====&lt;br /&gt;
 $ mtr google.com                                        # ICMP (default)&lt;br /&gt;
 $ mtr --udp google.com                                  # UDP&lt;br /&gt;
 $ sudo mtr --tcp --port 443 google.com                  # specific TCP port&lt;br /&gt;
 $ sudo mtr --tcp --port 22 remote-server.com            # generally the default port&lt;br /&gt;
&lt;br /&gt;
==== Timing and Duration ====&lt;br /&gt;
 $ mtr --interval 0.5 google.com           # interval between pings (default 1s)&lt;br /&gt;
 $ mtr --report-cycles 100 google.com      # extended test, 100 cycles&lt;br /&gt;
 $ mtr google.com                          # continuous monitoring (Ctrl+C to stop)&lt;br /&gt;
 $ mtr --report-cycles 10 google.com       # quick 10-cycle report&lt;br /&gt;
&lt;br /&gt;
==== Advanced Options ====&lt;br /&gt;
 $ mtr --aslookup google.com               # show Autonomous System (AS) numbers&lt;br /&gt;
 $ mtr --max-ttl 20 google.com             # set maximum number of hops&lt;br /&gt;
 $ mtr --psize 1000 google.com             # set packet size&lt;br /&gt;
 $ mtr --show-ips google.com               # show both IP and hostname&lt;br /&gt;
 $ mtr --address 192.168.1.100 google.com  # specify source address&lt;br /&gt;
 $ mtr -4 google.com                       # IPv4 only&lt;br /&gt;
 $ mtr -6 google.com                       # IPv6 only&lt;br /&gt;
&lt;br /&gt;
=== Interactive Mode Commands ===&lt;br /&gt;
When running MTR in interactive mode (mtr hostname), the following keys are available:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;h&#039;&#039;&#039; — Display help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d&#039;&#039;&#039; — Toggle display mode, cycling through different views.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;n&#039;&#039;&#039; — Toggle between hostnames and IP addresses.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;r&#039;&#039;&#039; — Reset all statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;p&#039;&#039;&#039; — Pause/unpause the display.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;q&#039;&#039;&#039; — Quit MTR.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;u&#039;&#039;&#039; — Switch between ICMP, UDP, and TCP modes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;y&#039;&#039;&#039; — Switch between IPv4 and IPv6.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;o&#039;&#039;&#039; — Toggle field display options.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;j&#039;&#039;&#039; — Toggle latency display.&lt;br /&gt;
&lt;br /&gt;
=== Practical Troubleshooting Scenarios ===&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1: Diagnosing a Slow Website ====&lt;br /&gt;
 $ mtr --report-cycles 100 --no-dns example.com&lt;br /&gt;
Look for high average latency at specific hops, packet loss at the destination, and high StDev values indicating jitter.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2: Testing if a Firewall Blocks SSH ====&lt;br /&gt;
 $ sudo mtr --tcp --port 22 --report-cycles 50 remote-server.com&lt;br /&gt;
If the last hop shows 100% loss but earlier hops are fine, port 22 may be filtered. Run a standard ICMP test for comparison.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3: ISP Performance Issues ====&lt;br /&gt;
 $ mtr --report-cycles 100 8.8.8.8&lt;br /&gt;
 &lt;br /&gt;
 $ mtr --report-cycles 100 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If issues appear in the first three or four hops, the problem is likely within your ISP’s network. If issues appear later, the problem lies beyond your ISP.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4: VPN Troubleshooting ====&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; before-vpn.txt   # before VPN&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; after-vpn.txt    # after VPN&lt;br /&gt;
 $ diff before-vpn.txt after-vpn.txt                             # compare the two&lt;br /&gt;
&lt;br /&gt;
==== Scenario 5: Gaming/Streaming Performance ====&lt;br /&gt;
 $ mtr --report-cycles 200 game-server.com&lt;br /&gt;
For real-time applications, look for low average latency (under 50ms for gaming), low StDev (under 5ms preferred), and zero packet loss.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 6: Intermittent Connectivity ====&lt;br /&gt;
 $ mtr --report-cycles 500 --interval 1 target.com &amp;gt; long-test.txt   # long-running test&lt;br /&gt;
 $ mtr target.com                                                    # real-time monitoring&lt;br /&gt;
&lt;br /&gt;
=== Continuous Monitoring ===&lt;br /&gt;
&lt;br /&gt;
==== Log Network Performance Over Time ====&lt;br /&gt;
 while true; do&lt;br /&gt;
     timestamp=$(date +%Y%m%d-%H%M%S)&lt;br /&gt;
     mtr --report --report-cycles 50 google.com &amp;gt; &amp;quot;mtr-$timestamp.txt&amp;quot;&lt;br /&gt;
     sleep 3600&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Monitor Multiple Destinations ====&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 echo &amp;quot;=== MTR Report $(date) ===&amp;quot; &amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Google DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 8.8.8.8 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Cloudflare DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 1.1.1.1 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Your Server:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 your-server.com &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
&lt;br /&gt;
=== Useful Aliases for .bashrc ===&lt;br /&gt;
 Quick network path analysis&lt;br /&gt;
 alias mtrreport=&#039;mtr --report --report-cycles 50 --no-dns&#039;&lt;br /&gt;
 &lt;br /&gt;
 Monitor connection to Google DNS&lt;br /&gt;
 alias netcheck=&#039;mtr --report-cycles 20 8.8.8.8&#039;&lt;br /&gt;
 &lt;br /&gt;
 Extended network test&lt;br /&gt;
 alias mtrlong=&#039;mtr --report-cycles 100&#039;&lt;br /&gt;
 &lt;br /&gt;
 TCP port 443 test (HTTPS)&lt;br /&gt;
 alias mtrhttps=&#039;sudo mtr --tcp --port 443 --report-cycles 30&#039;&lt;br /&gt;
 &lt;br /&gt;
 Quick comparison of major DNS providers&lt;br /&gt;
 alias dnstest=&#039;echo &amp;quot;Google:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 8.8.8.8 &amp;amp;&amp;amp; echo -e &amp;quot;\nCloudflare:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 1.1.1.1&#039;&lt;br /&gt;
After adding to ~/.bashrc, reload with:&lt;br /&gt;
 $ source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
==== Useful Tip for Aliases ====&lt;br /&gt;
Rather than adding aliases directly to &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;, it&#039;s cleaner to keep them in a dedicated file: &amp;lt;code&amp;gt;~/.bashrc_aliases&amp;lt;/code&amp;gt; and source that file from &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;. This keeps your shell configuration tidy and makes it easy to share or back up just your aliases without touching the rest of your environment.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting Tips ===&lt;br /&gt;
&#039;&#039;&#039;Permission issues with TCP mode:&#039;&#039;&#039;&lt;br /&gt;
 $ sudo mtr --tcp --port 443 example.com              # Use sudo for TCP on privileged ports&lt;br /&gt;
 $ sudo setcap cap_net_raw+ep /usr/bin/mtr-packet     # Or set capabilities (one-time setup)&lt;br /&gt;
&#039;&#039;&#039;False positives:&#039;&#039;&#039; Packet loss at an intermediate hop but not at the destination is almost always ICMP rate limiting at that router, not a real problem. Example:&lt;br /&gt;
 3.|-- router.isp.net            20.0%    50   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
 4.|-- next-hop.net               0.0%    50   18.5  19.2  17.8  22.1   1.3&lt;br /&gt;
 5.|-- destination.com            0.0%    50   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
Hop 3 shows 20% loss, but hops 4 and 5 show 0%. Traffic is flowing normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DNS resolution delays:&#039;&#039;&#039; If MTR is slow to start, skip DNS resolution with mtr --no-dns target.com and resolve addresses afterward with host 203.0.113.1 if needed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Comparing results:&#039;&#039;&#039;&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test1.txt&lt;br /&gt;
 $ sleep 60&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test2.txt&lt;br /&gt;
 $ diff test1.txt test2.txt&lt;br /&gt;
&lt;br /&gt;
=== When to Use MTR vs Other Tools ===&lt;br /&gt;
&#039;&#039;&#039;MTR&#039;&#039;&#039; — Best for continuous monitoring, identifying problem hops, and gathering detailed statistics. Requires installation via apt.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ping&#039;&#039;&#039; — Best for a quick connectivity test or simple latency check. Only tests the endpoint, not the path.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;traceroute&#039;&#039;&#039; — Best for one-time path discovery. Provides no continuous monitoring.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ss / netstat&#039;&#039;&#039; — Best for checking local connection status. Doesn’t test remote paths.&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
Run at least 50–100 cycles for accurate statistics. Use --no-dns for faster results and to avoid DNS resolution issues during testing. Test at different times of day, since network conditions vary. If one protocol shows issues, compare ICMP, UDP, and TCP modes. Save reports with timestamps for trend analysis. Use 8.8.8.8 or 1.1.1.1 as known-good hosts to verify your local network first. Let MTR run for at least 30–60 seconds before drawing conclusions.&lt;br /&gt;
&lt;br /&gt;
=== Reading Between the Lines ===&lt;br /&gt;
&#039;&#039;&#039;Good network health:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.1   1.2   0.9   2.1   0.2&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    50    8.2   8.5   7.5  10.2   0.5&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    50   15.1  15.5  14.0  18.3   0.8&lt;br /&gt;
   4.|-- google.com                 0.0%    50   24.8  25.2  23.5  28.1   1.1&lt;br /&gt;
No packet loss, consistent latency, low jitter throughout.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problematic network:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.2   1.5   1.0   2.3   0.3&lt;br /&gt;
   2.|-- 10.0.0.1                   5.0%    50   45.3  52.8   8.1 245.2  45.7&lt;br /&gt;
   3.|-- ???                      100.0%    50    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   4.|-- destination.com           15.0%    50   95.4 125.8  48.2 385.5  78.2&lt;br /&gt;
Packet loss at hop 2 and the destination, high jitter, and a very high worst-case latency all point to a genuine problem at or near hop 2.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
MTR is your friend when it comes to diagnostics. Use --report-cycles 50 or higher for reliable data. Watch for packet loss at the destination—intermediate losses may be false positives. High StDev indicates an unstable connection. High average latency points to slow links. Use --no-dns for faster results. Compare ICMP, UDP, and TCP modes if issues appear. Test at different times of day for a complete picture.&lt;br /&gt;
== Package Management Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Fix Broken Packages ===&lt;br /&gt;
 $ sudo apt update                             # update package lists&lt;br /&gt;
 $ sudo apt --fix-broken install               # fix broken dependencies&lt;br /&gt;
 $ sudo dpkg --configure -a                    # reconfigure packages (no output = nothing to do)&lt;br /&gt;
 $ sudo apt clean                              # clean package cache&lt;br /&gt;
 $ sudo apt autoclean&lt;br /&gt;
 $ sudo apt autoremove                         # remove unused packages&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 $ sudo lsof /var/lib/dpkg/lock-frontend        # find process holding the lock&lt;br /&gt;
 $ sudo rm /var/lib/dpkg/lock-frontend          # remove lock (only if no package manager is running)&lt;br /&gt;
 $ sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 $ sudo dpkg --configure -a                     # reconfigure dpkg&lt;br /&gt;
&lt;br /&gt;
== Disk &amp;amp; Filesystem Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 $ df -h                                        # disk space&lt;br /&gt;
 $ df -i                                        # inode usage&lt;br /&gt;
 $ sudo apt install sysstat                     # sysstat includes iostat, mpstat, sar, pidstat, cifsiostat&lt;br /&gt;
 $ iostat -x 1                                  # disk I/O statistics&lt;br /&gt;
 $ iostat -xm 2                                 # stats in MB instead of KB&lt;br /&gt;
 $ iostat -x sda 1                              # monitor a specific device&lt;br /&gt;
 $ sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;           # check for disk errors&lt;br /&gt;
 $ sudo apt install smartmontools&lt;br /&gt;
 $ sudo smartctl -a /dev/sdX                    # SMART disk health - lsblk to determine the target device&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Repair Filesystem ===&lt;br /&gt;
 $ sudo umount /dev/sdXN                        # unmount the partition first&lt;br /&gt;
 $ sudo fsck /dev/sdXN                          # run filesystem check&lt;br /&gt;
 $ sudo e2fsck -f /dev/sdXN                     # for ext4 specifically&lt;br /&gt;
 $ sudo apt --fix-broken install                # Fix broken dependencies&lt;br /&gt;
 $ sudo dpkg --configure -a                     # Reconfigure packages&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # No output means there is nothing to reconfigure&lt;br /&gt;
 &lt;br /&gt;
 # Clean package cache&lt;br /&gt;
 sudo apt clean&lt;br /&gt;
 sudo apt autoclean&lt;br /&gt;
 &lt;br /&gt;
 # Remove unused packages&lt;br /&gt;
 sudo apt autoremove&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 # If apt is locked, find the process holding the lock&lt;br /&gt;
 sudo lsof /var/lib/dpkg/lock-frontend&lt;br /&gt;
 &lt;br /&gt;
 # Remove the lock (use with caution—only if no package manager is running)&lt;br /&gt;
 sudo rm /var/lib/dpkg/lock-frontend&lt;br /&gt;
 sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure dpkg&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
Disk &amp;amp; Filesystem Issues&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 # Check disk space&lt;br /&gt;
 df -h&lt;br /&gt;
 &lt;br /&gt;
 # Check inode usage&lt;br /&gt;
 df -i&lt;br /&gt;
 &lt;br /&gt;
 # View disk I/O statistics&lt;br /&gt;
 # iostat is part of the sysstat package, which also includes:&lt;br /&gt;
 # mpstat (CPU statistics), sar (system activity reporter),&lt;br /&gt;
 # pidstat (process statistics), and cifsiostat (CIFS statistics)&lt;br /&gt;
 sudo apt install sysstat&lt;br /&gt;
 &lt;br /&gt;
 iostat -x 1&lt;br /&gt;
 &lt;br /&gt;
 # Show stats in MB instead of KB&lt;br /&gt;
 iostat -xm 2&lt;br /&gt;
 &lt;br /&gt;
 # Monitor a specific device&lt;br /&gt;
 iostat -x sda 1&lt;br /&gt;
 &lt;br /&gt;
 # Check for disk errors in dmesg&lt;br /&gt;
 sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # SMART disk health (requires smartmontools)&lt;br /&gt;
 sudo apt install smartmontools&lt;br /&gt;
 sudo smartctl -a /dev/sda&lt;br /&gt;
&lt;br /&gt;
=== Repair Filesystem ===&lt;br /&gt;
 # Unmount the partition first&lt;br /&gt;
 sudo umount /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Run filesystem check&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # For ext4 specifically&lt;br /&gt;
 sudo e2fsck -f /dev/sdXN&lt;br /&gt;
Performance Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Resource Hogs ===&lt;br /&gt;
 # CPU usage by process&lt;br /&gt;
 top -o %CPU&lt;br /&gt;
 &lt;br /&gt;
 # Memory usage by process&lt;br /&gt;
 top -o %MEM&lt;br /&gt;
 &lt;br /&gt;
 # Disk usage by directory&lt;br /&gt;
 du -sh /* | sort -h&lt;br /&gt;
 &lt;br /&gt;
 # Find large files&lt;br /&gt;
 find / -type f -size +100M 2&amp;gt;/dev/null&lt;br /&gt;
 &lt;br /&gt;
 # Check running processes sorted by memory use&lt;br /&gt;
 ps aux --sort=-%mem | head -20&lt;br /&gt;
&lt;br /&gt;
=== System Temperature Monitoring ===&lt;br /&gt;
 # Install lm-sensors if not already present&lt;br /&gt;
 sudo apt install lm-sensors&lt;br /&gt;
 sudo sensors-detect&lt;br /&gt;
 &lt;br /&gt;
 # View temperatures&lt;br /&gt;
 sensors&lt;br /&gt;
 &lt;br /&gt;
 # Real-time temperature monitoring&lt;br /&gt;
 watch -n 2 sensors&lt;br /&gt;
See section 12 for a shell alias that makes temperature monitoring more convenient.&lt;br /&gt;
&lt;br /&gt;
Service &amp;amp; Application Errors&lt;br /&gt;
&lt;br /&gt;
=== Debug Service Problems ===&lt;br /&gt;
 # Check service status&lt;br /&gt;
 sudo systemctl status service-name&lt;br /&gt;
 &lt;br /&gt;
 # View service logs&lt;br /&gt;
 sudo journalctl -u service-name&lt;br /&gt;
 &lt;br /&gt;
 # Restart a service&lt;br /&gt;
 sudo systemctl restart service-name&lt;br /&gt;
 &lt;br /&gt;
 # Enable service at boot&lt;br /&gt;
 sudo systemctl enable service-name&lt;br /&gt;
 &lt;br /&gt;
 # View recent service failures&lt;br /&gt;
 journalctl -p err -b&lt;br /&gt;
&lt;br /&gt;
=== Application Crash Investigation ===&lt;br /&gt;
 # Check for core dumps&lt;br /&gt;
 ls -lh /var/crash/&lt;br /&gt;
 &lt;br /&gt;
 # View available application logs&lt;br /&gt;
 ls /var/log/&lt;br /&gt;
 &lt;br /&gt;
 # Follow syslog for application errors in real-time&lt;br /&gt;
 sudo tail -f /var/log/syslog&lt;br /&gt;
Permission &amp;amp; Access Issues&lt;br /&gt;
&lt;br /&gt;
=== Fix Common Permission Problems ===&lt;br /&gt;
 # Check file ownership&lt;br /&gt;
 ls -l /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change ownership (user:group)&lt;br /&gt;
 sudo chown user:group /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change permissions&lt;br /&gt;
 sudo chmod 644 /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Recursively fix permissions on a directory&lt;br /&gt;
 sudo chown -R user:group /path/to/directory&lt;br /&gt;
&lt;br /&gt;
=== User &amp;amp; Authentication Issues ===&lt;br /&gt;
 # Check user information&lt;br /&gt;
 id username&lt;br /&gt;
 &lt;br /&gt;
 # View user login history&lt;br /&gt;
 last -a&lt;br /&gt;
 &lt;br /&gt;
 # Check failed login attempts&lt;br /&gt;
 sudo journalctl | grep &amp;quot;authentication failure&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Reset user password&lt;br /&gt;
 sudo passwd username&lt;br /&gt;
Hardware Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Hardware ===&lt;br /&gt;
 # List all hardware (install if needed: sudo apt install lshw)&lt;br /&gt;
 sudo lshw -short&lt;br /&gt;
 &lt;br /&gt;
 # PCI devices&lt;br /&gt;
 lspci -v&lt;br /&gt;
 &lt;br /&gt;
 # USB devices&lt;br /&gt;
 lsusb -v&lt;br /&gt;
 &lt;br /&gt;
 # CPU information&lt;br /&gt;
 lscpu&lt;br /&gt;
 &lt;br /&gt;
 # Memory information&lt;br /&gt;
 sudo dmidecode --type memory&lt;br /&gt;
&lt;br /&gt;
=== Check Hardware Errors ===&lt;br /&gt;
 # Kernel ring buffer (hardware messages)&lt;br /&gt;
 dmesg | less&lt;br /&gt;
 # Press q to quit&lt;br /&gt;
 &lt;br /&gt;
 # Search for specific hardware issues&lt;br /&gt;
 dmesg | grep -i &amp;quot;error\|fail\|warn&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Check for USB issues&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
Quick Diagnostic Commands&lt;br /&gt;
&lt;br /&gt;
=== System Information at a Glance ===&lt;br /&gt;
 # Uptime and load average&lt;br /&gt;
 uptime&lt;br /&gt;
 &lt;br /&gt;
 # Kernel version&lt;br /&gt;
 uname -r&lt;br /&gt;
 &lt;br /&gt;
 # Debian version&lt;br /&gt;
 cat /etc/debian_version&lt;br /&gt;
 &lt;br /&gt;
 # Full system summary (install if needed: sudo apt install inxi)&lt;br /&gt;
 sudo inxi -Fxz&lt;br /&gt;
&lt;br /&gt;
=== Emergency Toolkit ===&lt;br /&gt;
 # Create a consolidated diagnostic report&lt;br /&gt;
 sudo journalctl -b &amp;gt; ~/system-report.txt&lt;br /&gt;
 dmesg &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 systemctl --failed &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 df -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 free -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 &lt;br /&gt;
 # Watch logs in real-time&lt;br /&gt;
 sudo journalctl -f&lt;br /&gt;
 &lt;br /&gt;
 # Monitor system resources continuously&lt;br /&gt;
 watch -n 1 &#039;free -h &amp;amp;&amp;amp; df -h&#039;&lt;br /&gt;
Useful Aliases &amp;amp; Shortcuts&lt;br /&gt;
Add these to your ~/.bashrc for quick access to common troubleshooting commands:&lt;br /&gt;
 # Monitor system temperatures in real-time&lt;br /&gt;
 alias temps=&amp;quot;watch -n 2 &#039;for i in /sys/class/hwmon/hwmon*/; do echo -n \&amp;quot;\$(cat \${i}name): \&amp;quot;; cat \${i}temp*_input 2&amp;gt;/dev/null | while read temp; do echo \&amp;quot;scale=1; \$temp/1000\&amp;quot; | bc; done | tr \&amp;quot;\n\&amp;quot; \&amp;quot; \&amp;quot;; echo \&amp;quot;°C\&amp;quot;; done&#039;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Quick system status&lt;br /&gt;
 alias sysstat=&#039;echo &amp;quot;=== CPU ===&amp;quot; &amp;amp;&amp;amp; uptime &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Memory ===&amp;quot; &amp;amp;&amp;amp; free -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Disk ===&amp;quot; &amp;amp;&amp;amp; df -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Top Processes ===&amp;quot; &amp;amp;&amp;amp; ps aux --sort=-%mem | head -10&#039;&lt;br /&gt;
 &lt;br /&gt;
 # View last boot logs&lt;br /&gt;
 alias lastboot=&#039;journalctl -b -1&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Check failed services&lt;br /&gt;
 alias failedservices=&#039;systemctl --failed&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Monitor logs in real-time&lt;br /&gt;
 alias watchlog=&#039;sudo journalctl -f&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Quick network status&lt;br /&gt;
 alias netstatus=&#039;ip addr show &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Routes ===&amp;quot; &amp;amp;&amp;amp; ip route show&#039;&lt;br /&gt;
After adding these, reload your shell configuration:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
Tips for Effective Troubleshooting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check logs first.&#039;&#039;&#039; journalctl and dmesg are your best starting point for almost any problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Change one thing at a time.&#039;&#039;&#039; It’s tempting to make several changes at once, but doing so makes it impossible to know what actually fixed—or broke—the problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Document your changes.&#039;&#039;&#039; Keep notes on what you’ve tried and what the results were. You’ll thank yourself later.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use exact error messages.&#039;&#039;&#039; Copy error messages verbatim and search for them alongside “Debian” and the version number—for example, “Debian 13” or “Debian 13.1” for point releases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check what changed recently.&#039;&#039;&#039; Did you install something, update packages, or change the kernel before the problem appeared? Start there.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Back up before making major changes.&#039;&#039;&#039; This goes without saying, but it’s easy to skip when you’re in a hurry.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use verbose mode.&#039;&#039;&#039; Adding -v or -vv flags to commands often reveals what would otherwise be silent failures.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the community.&#039;&#039;&#039; The Debian forums, Reddit, Stack Exchange, and the Debian mailing lists are all active and well-indexed. Someone has usually seen your problem before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by &amp;lt;dfn&amp;gt;distro-nix&amp;lt;/dfn&amp;gt; to the Debian User Forums on 2025-10-27.&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=277</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=277"/>
		<updated>2026-05-19T14:16:35Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: Updating sections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Author&#039;&#039;&#039; &#039;&#039;&#039;Profile:&#039;&#039;&#039; [https://forums.debian.net/memberlist.php?mode=viewprofile&amp;amp;u=239099 distro-nix]  &#039;&#039;&#039;Debian Version:&#039;&#039;&#039; Debian 13 (Trixie) &#039;&#039;&#039;Kernel Versions Tested:&#039;&#039;&#039; 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64 (x86_64) &#039;&#039;&#039;Created:&#039;&#039;&#039; 2025-10-27 &#039;&#039;&#039;Last Updated:&#039;&#039;&#039; 2026-05-15 &#039;&#039;&#039;ID:&#039;&#039;&#039; 544201 &#039;&#039;&#039;License:&#039;&#039;&#039; CC BY-SA 4.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This guide is preserved in its original form. Questions and feedback welcome via the author’s &amp;lt;dfn&amp;gt;Debian Forums profile&amp;lt;/dfn&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The Debian First Aid Kit is a practical reference for diagnosing and resolving common system problems on Debian GNU/Linux. It covers commonly occuring categories of failure: system freezes and crashes, boot problems, network issues, package management, disk and filesystem errors, performance degradation, service and application failures, permission and access problems, hardware identification and errors, and quick diagnostics. Each section gives the relevant commands so you can understand what they do and why, rather than a bare list to copy and paste blindly. A dedicated section covers MTR (Matt’s Traceroute) in depth, including how to interpret the output; practical troubleshooting, and how to monitor continuously. The guide also includes a set of shell aliases for faster access to common diagnostic tasks. All commands are verified on Debian 13 (Trixie) running kernel 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64. This document is intended for users with basic command-line familiarity who need a reliable, consolidated reference when something goes wrong.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Keywords:&#039;&#039;&#039; Debian, troubleshooting, system administration, MTR, network diagnostics, package management, journalctl, filesystem repair&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tested Commands Disclaimer ==&lt;br /&gt;
All commands in this document have been verified on Debian 13 (Trixie) with the kernel versions listed above. Results may vary on other releases or hardware configurations. Always test in a safe environment before making changes to a production system.&lt;br /&gt;
&lt;br /&gt;
== Conventions Used in This Document ==&lt;br /&gt;
Command examples throughout this guide follow standard Unix prompt conventions. A $ prefix indicates a command run as a regular user. Where elevated privileges are required, sudo is shown explicitly and # with a brief helpful explanation unless it is self-explanatory:&lt;br /&gt;
 $ journalctl -b -1                        # regular user&lt;br /&gt;
 $ sudo apt install mtr                    # requires elevation via sudo&lt;br /&gt;
In recovery shell contexts, where you are operating directly as root, the prompt is #. In these cases, Debian recommends:&lt;br /&gt;
 $ sudo -i &lt;br /&gt;
&lt;br /&gt;
== System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics:&#039;&#039;&#039; Search for “kernel panic” or “Oops”&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM):&#039;&#039;&#039; Search for “Out of memory” or “oom-killer”&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors:&#039;&#039;&#039; Look for “MCE” (Machine Check Exception) or “hardware error”&lt;br /&gt;
* &#039;&#039;&#039;Driver issues:&#039;&#039;&#039; Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating:&#039;&#039;&#039; Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 $ free -h                                 # memory usage&lt;br /&gt;
&lt;br /&gt;
 $ df -h                                   # disk space&lt;br /&gt;
&lt;br /&gt;
 $ htop                                    # interactive resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ top                                     # alternative resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt install btop                   # btop is a more detailed alternative&lt;br /&gt;
&lt;br /&gt;
 $ sudo dmesg | grep -i error              # check for disk errors&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN                     # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX              # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub                        # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab                          # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
The following are permanent errors caused by incomplete or buggy ACPI tables in the BIOS. They are harmless and can be safely ignored if they appear on your system:&lt;br /&gt;
 [0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&lt;br /&gt;
 [0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&lt;br /&gt;
 [0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&lt;br /&gt;
&lt;br /&gt;
== Boot Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Check Boot Process ===&lt;br /&gt;
 $ systemd-analyze blame                   # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemd-analyze blame                   # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemctl --failed                      # units that failed during boot&lt;br /&gt;
&lt;br /&gt;
 $ systemctl status &amp;lt;service-name&amp;gt;         # e.g. systemctl status NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN                     # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX              # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub                        # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab                          # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
== Network Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose Network Connection ===&lt;br /&gt;
 $ ip addr show                            # check network interfaces&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 4 8.8.8.8                       # test IPv4 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 6 2a00:1450:4007:809::200e      # test IPv6 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ nslookup google.com                     # check DNS resolution&lt;br /&gt;
&lt;br /&gt;
 $ ip route show                           # view routing table&lt;br /&gt;
&lt;br /&gt;
 $ ss -tuln                                # check active connections &lt;br /&gt;
&lt;br /&gt;
=== Restart Network Service ===&lt;br /&gt;
 $ sudo systemctl restart NetworkManager   # for systems using NetworkManager&lt;br /&gt;
&lt;br /&gt;
 $ sudo systemctl restart networking       # for systems using networking service&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 down              # bring interface down&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 up                # bring interface back up&lt;br /&gt;
&lt;br /&gt;
== MTR (Matt’s Traceroute) ==&lt;br /&gt;
MTR combines the functionality of ping and traceroute into a single real-time network diagnostic tool. It continuously monitors the path between your system and a destination, providing detailed statistics about latency and packet loss at each hop. When you need to demonstrate a network problem that is outside your control—to your hosting provider, for example—MTR gives you the evidence you need.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
 $ sudo apt install mtr&lt;br /&gt;
&lt;br /&gt;
=== Basic Usage ===&lt;br /&gt;
 $ mtr google.com                          # interactive mode&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report google.com                 # report mode (10 cycles then exit)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 50 google.com       # specify number of cycles&lt;br /&gt;
&lt;br /&gt;
 $ mtr --tcp google.com                    # use TCP instead of ICMP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --udp google.com                    # use UDP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --no-dns google.com                 # skip DNS resolution (faster)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --show-ips google.com               # show both hostnames and IPs&lt;br /&gt;
&lt;br /&gt;
== Understanding MTR Output ==&lt;br /&gt;
&lt;br /&gt;
==== Sample Output ====&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    10   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
   4.|-- ???                      100.0%    10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   5.|-- google.com                 0.0%    10   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
&lt;br /&gt;
=== Column Meanings ===&lt;br /&gt;
&#039;&#039;&#039;HOST&#039;&#039;&#039; — Hostname or IP address of each hop in the route.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loss%&#039;&#039;&#039; — Percentage of packets lost at this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Snt&#039;&#039;&#039; — Number of packets sent to this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last&#039;&#039;&#039; — Latency of the most recent packet, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Avg&#039;&#039;&#039; — Average latency across all packets sent, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best&#039;&#039;&#039; — Lowest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wrst&#039;&#039;&#039; — Highest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StDev&#039;&#039;&#039; — Standard deviation of latency measurements—lower values indicate a more stable connection.&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Results ===&lt;br /&gt;
A healthy network shows 0% loss on all hops, stable latency with low StDev values, a gradual latency increase as hop count increases, and consistent response times.&lt;br /&gt;
&lt;br /&gt;
==== Problem Indicators ====&lt;br /&gt;
&#039;&#039;&#039;1. High Packet Loss at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 5.|-- problem-router.net        25.0%    10   45.3  48.2  42.1  65.8  8.4&lt;br /&gt;
If loss continues to the destination, there is a real problem at that router. If loss appears only at that hop but not beyond, the router is likely rate-limiting ICMP responses—a false positive, not a real problem. The rule of thumb: if packet loss appears at hop N but hops N+1, N+2, and beyond show 0% loss, it’s almost certainly ICMP rate limiting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. High Latency at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 3.|-- slow-link.net              0.0%    10  150.3 155.2 148.1 165.8  5.4&lt;br /&gt;
This indicates a network bottleneck, a congested link, geographical distance (intercontinental hops), or slow routing equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. No Response (???)&#039;&#039;&#039;&lt;br /&gt;
 4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
The router at this hop is configured not to respond to ICMP or traceroute packets, or a firewall is blocking diagnostic packets. This is not necessarily a problem if later hops respond normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. High Jitter (StDev)&#039;&#039;&#039;&lt;br /&gt;
 6.|-- unstable.net               0.0%    10   35.3  52.8  28.1  95.2  24.7&lt;br /&gt;
A high StDev (24.7ms in this example) indicates inconsistent latency caused by network congestion or instability. This is particularly noticeable in real-time applications such as VoIP, gaming, and video calls.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Sudden Latency Spike&#039;&#039;&#039;&lt;br /&gt;
 1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
 2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
 3.|-- problematic-hop.net        0.0%    10  180.5 185.2 178.1 195.8   6.4&lt;br /&gt;
 4.|-- next-hop.net               0.0%    10  182.3 187.8 180.5 198.2   6.8&lt;br /&gt;
Hop 3 introduces approximately 170ms of additional latency (jumping from 9ms to 180ms). Everything from hop 3 onward carries that penalty.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Report Mode with Different Output Formats ====&lt;br /&gt;
 $ mtr --report --csv google.com &amp;gt; network-report.csv    # CSV for logging&lt;br /&gt;
 $ mtr --report --json google.com                        # JSON for parsing&lt;br /&gt;
 $ mtr --report --xml google.com                         # XML format&lt;br /&gt;
 $ mtr --report-wide google.com                          # wide report, no abbreviations&lt;br /&gt;
&lt;br /&gt;
==== Protocol Selection ====&lt;br /&gt;
 $ mtr google.com                                        # ICMP (default)&lt;br /&gt;
 $ mtr --udp google.com                                  # UDP&lt;br /&gt;
 $ sudo mtr --tcp --port 443 google.com                  # specific TCP port&lt;br /&gt;
 $ sudo mtr --tcp --port 22 remote-server.com            # generally the default port&lt;br /&gt;
&lt;br /&gt;
==== Timing and Duration ====&lt;br /&gt;
 $ mtr --interval 0.5 google.com           # interval between pings (default 1s)&lt;br /&gt;
 $ mtr --report-cycles 100 google.com      # extended test, 100 cycles&lt;br /&gt;
 $ mtr google.com                          # continuous monitoring (Ctrl+C to stop)&lt;br /&gt;
 $ mtr --report-cycles 10 google.com       # quick 10-cycle report&lt;br /&gt;
&lt;br /&gt;
==== Advanced Options ====&lt;br /&gt;
 $ mtr --aslookup google.com               # show Autonomous System (AS) numbers&lt;br /&gt;
 $ mtr --max-ttl 20 google.com             # set maximum number of hops&lt;br /&gt;
 $ mtr --psize 1000 google.com             # set packet size&lt;br /&gt;
 $ mtr --show-ips google.com               # show both IP and hostname&lt;br /&gt;
 $ mtr --address 192.168.1.100 google.com  # specify source address&lt;br /&gt;
 $ mtr -4 google.com                       # IPv4 only&lt;br /&gt;
 $ mtr -6 google.com                       # IPv6 only&lt;br /&gt;
&lt;br /&gt;
=== Interactive Mode Commands ===&lt;br /&gt;
When running MTR in interactive mode (mtr hostname), the following keys are available:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;h&#039;&#039;&#039; — Display help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d&#039;&#039;&#039; — Toggle display mode, cycling through different views.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;n&#039;&#039;&#039; — Toggle between hostnames and IP addresses.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;r&#039;&#039;&#039; — Reset all statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;p&#039;&#039;&#039; — Pause/unpause the display.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;q&#039;&#039;&#039; — Quit MTR.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;u&#039;&#039;&#039; — Switch between ICMP, UDP, and TCP modes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;y&#039;&#039;&#039; — Switch between IPv4 and IPv6.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;o&#039;&#039;&#039; — Toggle field display options.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;j&#039;&#039;&#039; — Toggle latency display.&lt;br /&gt;
&lt;br /&gt;
=== Practical Troubleshooting Scenarios ===&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1: Diagnosing a Slow Website ====&lt;br /&gt;
 $ mtr --report-cycles 100 --no-dns example.com&lt;br /&gt;
Look for high average latency at specific hops, packet loss at the destination, and high StDev values indicating jitter.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2: Testing if a Firewall Blocks SSH ====&lt;br /&gt;
 $ sudo mtr --tcp --port 22 --report-cycles 50 remote-server.com&lt;br /&gt;
If the last hop shows 100% loss but earlier hops are fine, port 22 may be filtered. Run a standard ICMP test for comparison.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3: ISP Performance Issues ====&lt;br /&gt;
 $ mtr --report-cycles 100 8.8.8.8&lt;br /&gt;
 &lt;br /&gt;
 $ mtr --report-cycles 100 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If issues appear in the first three or four hops, the problem is likely within your ISP’s network. If issues appear later, the problem lies beyond your ISP.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4: VPN Troubleshooting ====&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; before-vpn.txt   # before VPN&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; after-vpn.txt    # after VPN&lt;br /&gt;
 $ diff before-vpn.txt after-vpn.txt                             # compare the two&lt;br /&gt;
&lt;br /&gt;
==== Scenario 5: Gaming/Streaming Performance ====&lt;br /&gt;
 $ mtr --report-cycles 200 game-server.com&lt;br /&gt;
For real-time applications, look for low average latency (under 50ms for gaming), low StDev (under 5ms preferred), and zero packet loss.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 6: Intermittent Connectivity ====&lt;br /&gt;
 $ mtr --report-cycles 500 --interval 1 target.com &amp;gt; long-test.txt   # long-running test&lt;br /&gt;
 $ mtr target.com                                                    # real-time monitoring&lt;br /&gt;
&lt;br /&gt;
=== Continuous Monitoring ===&lt;br /&gt;
&lt;br /&gt;
==== Log Network Performance Over Time ====&lt;br /&gt;
 while true; do&lt;br /&gt;
     timestamp=$(date +%Y%m%d-%H%M%S)&lt;br /&gt;
     mtr --report --report-cycles 50 google.com &amp;gt; &amp;quot;mtr-$timestamp.txt&amp;quot;&lt;br /&gt;
     sleep 3600&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Monitor Multiple Destinations ====&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 echo &amp;quot;=== MTR Report $(date) ===&amp;quot; &amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Google DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 8.8.8.8 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Cloudflare DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 1.1.1.1 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Your Server:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 your-server.com &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
&lt;br /&gt;
=== Useful Aliases for .bashrc ===&lt;br /&gt;
 Quick network path analysis&lt;br /&gt;
 alias mtrreport=&#039;mtr --report --report-cycles 50 --no-dns&#039;&lt;br /&gt;
 &lt;br /&gt;
 Monitor connection to Google DNS&lt;br /&gt;
 alias netcheck=&#039;mtr --report-cycles 20 8.8.8.8&#039;&lt;br /&gt;
 &lt;br /&gt;
 Extended network test&lt;br /&gt;
 alias mtrlong=&#039;mtr --report-cycles 100&#039;&lt;br /&gt;
 &lt;br /&gt;
 TCP port 443 test (HTTPS)&lt;br /&gt;
 alias mtrhttps=&#039;sudo mtr --tcp --port 443 --report-cycles 30&#039;&lt;br /&gt;
 &lt;br /&gt;
 Quick comparison of major DNS providers&lt;br /&gt;
 alias dnstest=&#039;echo &amp;quot;Google:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 8.8.8.8 &amp;amp;&amp;amp; echo -e &amp;quot;\nCloudflare:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 1.1.1.1&#039;&lt;br /&gt;
After adding to ~/.bashrc, reload with:&lt;br /&gt;
 $ source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
==== Useful Tip for Aliases ====&lt;br /&gt;
Rather than adding aliases directly to &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;, it&#039;s cleaner to keep them in a dedicated file: &amp;lt;code&amp;gt;~/.bashrc_aliases&amp;lt;/code&amp;gt; and source that file from &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;. This keeps your shell configuration tidy and makes it easy to share or back up just your aliases without touching the rest of your environment.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting Tips ===&lt;br /&gt;
&#039;&#039;&#039;Permission issues with TCP mode:&#039;&#039;&#039;&lt;br /&gt;
 $ sudo mtr --tcp --port 443 example.com              # Use sudo for TCP on privileged ports&lt;br /&gt;
 $ sudo setcap cap_net_raw+ep /usr/bin/mtr-packet     # Or set capabilities (one-time setup)&lt;br /&gt;
&#039;&#039;&#039;False positives:&#039;&#039;&#039; Packet loss at an intermediate hop but not at the destination is almost always ICMP rate limiting at that router, not a real problem. Example:&lt;br /&gt;
 3.|-- router.isp.net            20.0%    50   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
 4.|-- next-hop.net               0.0%    50   18.5  19.2  17.8  22.1   1.3&lt;br /&gt;
 5.|-- destination.com            0.0%    50   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
Hop 3 shows 20% loss, but hops 4 and 5 show 0%. Traffic is flowing normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DNS resolution delays:&#039;&#039;&#039; If MTR is slow to start, skip DNS resolution with mtr --no-dns target.com and resolve addresses afterward with host 203.0.113.1 if needed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Comparing results:&#039;&#039;&#039;&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test1.txt&lt;br /&gt;
 $ sleep 60&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test2.txt&lt;br /&gt;
 $ diff test1.txt test2.txt&lt;br /&gt;
&lt;br /&gt;
=== When to Use MTR vs Other Tools ===&lt;br /&gt;
&#039;&#039;&#039;MTR&#039;&#039;&#039; — Best for continuous monitoring, identifying problem hops, and gathering detailed statistics. Requires installation via apt.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ping&#039;&#039;&#039; — Best for a quick connectivity test or simple latency check. Only tests the endpoint, not the path.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;traceroute&#039;&#039;&#039; — Best for one-time path discovery. Provides no continuous monitoring.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ss / netstat&#039;&#039;&#039; — Best for checking local connection status. Doesn’t test remote paths.&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
Run at least 50–100 cycles for accurate statistics. Use --no-dns for faster results and to avoid DNS resolution issues during testing. Test at different times of day, since network conditions vary. If one protocol shows issues, compare ICMP, UDP, and TCP modes. Save reports with timestamps for trend analysis. Use 8.8.8.8 or 1.1.1.1 as known-good hosts to verify your local network first. Let MTR run for at least 30–60 seconds before drawing conclusions.&lt;br /&gt;
&lt;br /&gt;
=== Reading Between the Lines ===&lt;br /&gt;
&#039;&#039;&#039;Good network health:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.1   1.2   0.9   2.1   0.2&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    50    8.2   8.5   7.5  10.2   0.5&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    50   15.1  15.5  14.0  18.3   0.8&lt;br /&gt;
   4.|-- google.com                 0.0%    50   24.8  25.2  23.5  28.1   1.1&lt;br /&gt;
No packet loss, consistent latency, low jitter throughout.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problematic network:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.2   1.5   1.0   2.3   0.3&lt;br /&gt;
   2.|-- 10.0.0.1                   5.0%    50   45.3  52.8   8.1 245.2  45.7&lt;br /&gt;
   3.|-- ???                      100.0%    50    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   4.|-- destination.com           15.0%    50   95.4 125.8  48.2 385.5  78.2&lt;br /&gt;
Packet loss at hop 2 and the destination, high jitter, and a very high worst-case latency all point to a genuine problem at or near hop 2.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
MTR is your friend when it comes to diagnostics. Use --report-cycles 50 or higher for reliable data. Watch for packet loss at the destination—intermediate losses may be false positives. High StDev indicates an unstable connection. High average latency points to slow links. Use --no-dns for faster results. Compare ICMP, UDP, and TCP modes if issues appear. Test at different times of day for a complete picture.&lt;br /&gt;
== Package Management Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Fix Broken Packages ===&lt;br /&gt;
 $ sudo apt update                             # update package lists&lt;br /&gt;
 $ sudo apt --fix-broken install               # fix broken dependencies&lt;br /&gt;
 $ sudo dpkg --configure -a                    # reconfigure packages (no output = nothing to do)&lt;br /&gt;
 $ sudo apt clean                              # clean package cache&lt;br /&gt;
 $ sudo apt autoclean&lt;br /&gt;
 $ sudo apt autoremove                         # remove unused packages&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 $ sudo lsof /var/lib/dpkg/lock-frontend        # find process holding the lock&lt;br /&gt;
 $ sudo rm /var/lib/dpkg/lock-frontend          # remove lock (only if no package manager is running)&lt;br /&gt;
 $ sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 $ sudo dpkg --configure -a                     # reconfigure dpkg&lt;br /&gt;
&lt;br /&gt;
== Disk &amp;amp; Filesystem Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 $ df -h                                        # disk space&lt;br /&gt;
 $ df -i                                        # inode usage&lt;br /&gt;
 $ sudo apt install sysstat                     # sysstat includes iostat, mpstat, sar, pidstat, cifsiostat&lt;br /&gt;
 $ iostat -x 1                                  # disk I/O statistics&lt;br /&gt;
 $ iostat -xm 2                                 # stats in MB instead of KB&lt;br /&gt;
 $ iostat -x sda 1                              # monitor a specific device&lt;br /&gt;
 $ sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;           # check for disk errors&lt;br /&gt;
 $ sudo apt install smartmontools&lt;br /&gt;
 $ sudo smartctl -a /dev/sdX                    # SMART disk health - lsblk to determine the target device&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Repair Filesystem ===&lt;br /&gt;
 $ sudo umount /dev/sdXN                        # unmount the partition first&lt;br /&gt;
 $ sudo fsck /dev/sdXN                          # run filesystem check&lt;br /&gt;
 $ sudo apt --fix-broken install                # Fix broken dependencies&lt;br /&gt;
 $ sudo dpkg --configure -a                     # Reconfigure packages&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # No output means there is nothing to reconfigure&lt;br /&gt;
 &lt;br /&gt;
 # Clean package cache&lt;br /&gt;
 sudo apt clean&lt;br /&gt;
 sudo apt autoclean&lt;br /&gt;
 &lt;br /&gt;
 # Remove unused packages&lt;br /&gt;
 sudo apt autoremove&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 # If apt is locked, find the process holding the lock&lt;br /&gt;
 sudo lsof /var/lib/dpkg/lock-frontend&lt;br /&gt;
 &lt;br /&gt;
 # Remove the lock (use with caution—only if no package manager is running)&lt;br /&gt;
 sudo rm /var/lib/dpkg/lock-frontend&lt;br /&gt;
 sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure dpkg&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
Disk &amp;amp; Filesystem Issues&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 # Check disk space&lt;br /&gt;
 df -h&lt;br /&gt;
 &lt;br /&gt;
 # Check inode usage&lt;br /&gt;
 df -i&lt;br /&gt;
 &lt;br /&gt;
 # View disk I/O statistics&lt;br /&gt;
 # iostat is part of the sysstat package, which also includes:&lt;br /&gt;
 # mpstat (CPU statistics), sar (system activity reporter),&lt;br /&gt;
 # pidstat (process statistics), and cifsiostat (CIFS statistics)&lt;br /&gt;
 sudo apt install sysstat&lt;br /&gt;
 &lt;br /&gt;
 iostat -x 1&lt;br /&gt;
 &lt;br /&gt;
 # Show stats in MB instead of KB&lt;br /&gt;
 iostat -xm 2&lt;br /&gt;
 &lt;br /&gt;
 # Monitor a specific device&lt;br /&gt;
 iostat -x sda 1&lt;br /&gt;
 &lt;br /&gt;
 # Check for disk errors in dmesg&lt;br /&gt;
 sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # SMART disk health (requires smartmontools)&lt;br /&gt;
 sudo apt install smartmontools&lt;br /&gt;
 sudo smartctl -a /dev/sda&lt;br /&gt;
&lt;br /&gt;
=== Repair Filesystem ===&lt;br /&gt;
 # Unmount the partition first&lt;br /&gt;
 sudo umount /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Run filesystem check&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # For ext4 specifically&lt;br /&gt;
 sudo e2fsck -f /dev/sdXN&lt;br /&gt;
Performance Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Resource Hogs ===&lt;br /&gt;
 # CPU usage by process&lt;br /&gt;
 top -o %CPU&lt;br /&gt;
 &lt;br /&gt;
 # Memory usage by process&lt;br /&gt;
 top -o %MEM&lt;br /&gt;
 &lt;br /&gt;
 # Disk usage by directory&lt;br /&gt;
 du -sh /* | sort -h&lt;br /&gt;
 &lt;br /&gt;
 # Find large files&lt;br /&gt;
 find / -type f -size +100M 2&amp;gt;/dev/null&lt;br /&gt;
 &lt;br /&gt;
 # Check running processes sorted by memory use&lt;br /&gt;
 ps aux --sort=-%mem | head -20&lt;br /&gt;
&lt;br /&gt;
=== System Temperature Monitoring ===&lt;br /&gt;
 # Install lm-sensors if not already present&lt;br /&gt;
 sudo apt install lm-sensors&lt;br /&gt;
 sudo sensors-detect&lt;br /&gt;
 &lt;br /&gt;
 # View temperatures&lt;br /&gt;
 sensors&lt;br /&gt;
 &lt;br /&gt;
 # Real-time temperature monitoring&lt;br /&gt;
 watch -n 2 sensors&lt;br /&gt;
See section 12 for a shell alias that makes temperature monitoring more convenient.&lt;br /&gt;
&lt;br /&gt;
Service &amp;amp; Application Errors&lt;br /&gt;
&lt;br /&gt;
=== Debug Service Problems ===&lt;br /&gt;
 # Check service status&lt;br /&gt;
 sudo systemctl status service-name&lt;br /&gt;
 &lt;br /&gt;
 # View service logs&lt;br /&gt;
 sudo journalctl -u service-name&lt;br /&gt;
 &lt;br /&gt;
 # Restart a service&lt;br /&gt;
 sudo systemctl restart service-name&lt;br /&gt;
 &lt;br /&gt;
 # Enable service at boot&lt;br /&gt;
 sudo systemctl enable service-name&lt;br /&gt;
 &lt;br /&gt;
 # View recent service failures&lt;br /&gt;
 journalctl -p err -b&lt;br /&gt;
&lt;br /&gt;
=== Application Crash Investigation ===&lt;br /&gt;
 # Check for core dumps&lt;br /&gt;
 ls -lh /var/crash/&lt;br /&gt;
 &lt;br /&gt;
 # View available application logs&lt;br /&gt;
 ls /var/log/&lt;br /&gt;
 &lt;br /&gt;
 # Follow syslog for application errors in real-time&lt;br /&gt;
 sudo tail -f /var/log/syslog&lt;br /&gt;
Permission &amp;amp; Access Issues&lt;br /&gt;
&lt;br /&gt;
=== Fix Common Permission Problems ===&lt;br /&gt;
 # Check file ownership&lt;br /&gt;
 ls -l /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change ownership (user:group)&lt;br /&gt;
 sudo chown user:group /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change permissions&lt;br /&gt;
 sudo chmod 644 /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Recursively fix permissions on a directory&lt;br /&gt;
 sudo chown -R user:group /path/to/directory&lt;br /&gt;
&lt;br /&gt;
=== User &amp;amp; Authentication Issues ===&lt;br /&gt;
 # Check user information&lt;br /&gt;
 id username&lt;br /&gt;
 &lt;br /&gt;
 # View user login history&lt;br /&gt;
 last -a&lt;br /&gt;
 &lt;br /&gt;
 # Check failed login attempts&lt;br /&gt;
 sudo journalctl | grep &amp;quot;authentication failure&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Reset user password&lt;br /&gt;
 sudo passwd username&lt;br /&gt;
Hardware Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Hardware ===&lt;br /&gt;
 # List all hardware (install if needed: sudo apt install lshw)&lt;br /&gt;
 sudo lshw -short&lt;br /&gt;
 &lt;br /&gt;
 # PCI devices&lt;br /&gt;
 lspci -v&lt;br /&gt;
 &lt;br /&gt;
 # USB devices&lt;br /&gt;
 lsusb -v&lt;br /&gt;
 &lt;br /&gt;
 # CPU information&lt;br /&gt;
 lscpu&lt;br /&gt;
 &lt;br /&gt;
 # Memory information&lt;br /&gt;
 sudo dmidecode --type memory&lt;br /&gt;
&lt;br /&gt;
=== Check Hardware Errors ===&lt;br /&gt;
 # Kernel ring buffer (hardware messages)&lt;br /&gt;
 dmesg | less&lt;br /&gt;
 # Press q to quit&lt;br /&gt;
 &lt;br /&gt;
 # Search for specific hardware issues&lt;br /&gt;
 dmesg | grep -i &amp;quot;error\|fail\|warn&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Check for USB issues&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
Quick Diagnostic Commands&lt;br /&gt;
&lt;br /&gt;
=== System Information at a Glance ===&lt;br /&gt;
 # Uptime and load average&lt;br /&gt;
 uptime&lt;br /&gt;
 &lt;br /&gt;
 # Kernel version&lt;br /&gt;
 uname -r&lt;br /&gt;
 &lt;br /&gt;
 # Debian version&lt;br /&gt;
 cat /etc/debian_version&lt;br /&gt;
 &lt;br /&gt;
 # Full system summary (install if needed: sudo apt install inxi)&lt;br /&gt;
 sudo inxi -Fxz&lt;br /&gt;
&lt;br /&gt;
=== Emergency Toolkit ===&lt;br /&gt;
 # Create a consolidated diagnostic report&lt;br /&gt;
 sudo journalctl -b &amp;gt; ~/system-report.txt&lt;br /&gt;
 dmesg &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 systemctl --failed &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 df -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 free -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 &lt;br /&gt;
 # Watch logs in real-time&lt;br /&gt;
 sudo journalctl -f&lt;br /&gt;
 &lt;br /&gt;
 # Monitor system resources continuously&lt;br /&gt;
 watch -n 1 &#039;free -h &amp;amp;&amp;amp; df -h&#039;&lt;br /&gt;
Useful Aliases &amp;amp; Shortcuts&lt;br /&gt;
Add these to your ~/.bashrc for quick access to common troubleshooting commands:&lt;br /&gt;
 # Monitor system temperatures in real-time&lt;br /&gt;
 alias temps=&amp;quot;watch -n 2 &#039;for i in /sys/class/hwmon/hwmon*/; do echo -n \&amp;quot;\$(cat \${i}name): \&amp;quot;; cat \${i}temp*_input 2&amp;gt;/dev/null | while read temp; do echo \&amp;quot;scale=1; \$temp/1000\&amp;quot; | bc; done | tr \&amp;quot;\n\&amp;quot; \&amp;quot; \&amp;quot;; echo \&amp;quot;°C\&amp;quot;; done&#039;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Quick system status&lt;br /&gt;
 alias sysstat=&#039;echo &amp;quot;=== CPU ===&amp;quot; &amp;amp;&amp;amp; uptime &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Memory ===&amp;quot; &amp;amp;&amp;amp; free -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Disk ===&amp;quot; &amp;amp;&amp;amp; df -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Top Processes ===&amp;quot; &amp;amp;&amp;amp; ps aux --sort=-%mem | head -10&#039;&lt;br /&gt;
 &lt;br /&gt;
 # View last boot logs&lt;br /&gt;
 alias lastboot=&#039;journalctl -b -1&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Check failed services&lt;br /&gt;
 alias failedservices=&#039;systemctl --failed&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Monitor logs in real-time&lt;br /&gt;
 alias watchlog=&#039;sudo journalctl -f&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Quick network status&lt;br /&gt;
 alias netstatus=&#039;ip addr show &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Routes ===&amp;quot; &amp;amp;&amp;amp; ip route show&#039;&lt;br /&gt;
After adding these, reload your shell configuration:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
Tips for Effective Troubleshooting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check logs first.&#039;&#039;&#039; journalctl and dmesg are your best starting point for almost any problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Change one thing at a time.&#039;&#039;&#039; It’s tempting to make several changes at once, but doing so makes it impossible to know what actually fixed—or broke—the problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Document your changes.&#039;&#039;&#039; Keep notes on what you’ve tried and what the results were. You’ll thank yourself later.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use exact error messages.&#039;&#039;&#039; Copy error messages verbatim and search for them alongside “Debian” and the version number—for example, “Debian 13” or “Debian 13.1” for point releases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check what changed recently.&#039;&#039;&#039; Did you install something, update packages, or change the kernel before the problem appeared? Start there.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Back up before making major changes.&#039;&#039;&#039; This goes without saying, but it’s easy to skip when you’re in a hurry.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use verbose mode.&#039;&#039;&#039; Adding -v or -vv flags to commands often reveals what would otherwise be silent failures.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the community.&#039;&#039;&#039; The Debian forums, Reddit, Stack Exchange, and the Debian mailing lists are all active and well-indexed. Someone has usually seen your problem before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by &amp;lt;dfn&amp;gt;distro-nix&amp;lt;/dfn&amp;gt; to the Debian User Forums on 2025-10-27.&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=276</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=276"/>
		<updated>2026-05-16T02:16:27Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Author&#039;&#039;&#039; &#039;&#039;&#039;Profile:&#039;&#039;&#039; [https://forums.debian.net/memberlist.php?mode=viewprofile&amp;amp;u=239099 distro-nix]  &#039;&#039;&#039;Debian Version:&#039;&#039;&#039; Debian 13 (Trixie) &#039;&#039;&#039;Kernel Versions Tested:&#039;&#039;&#039; 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64 (x86_64) &#039;&#039;&#039;Created:&#039;&#039;&#039; 2025-10-27 &#039;&#039;&#039;Last Updated:&#039;&#039;&#039; 2026-05-15 &#039;&#039;&#039;ID:&#039;&#039;&#039; 544201 &#039;&#039;&#039;License:&#039;&#039;&#039; CC BY-SA 4.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This guide is preserved in its original form. Questions and feedback welcome via the author’s &amp;lt;dfn&amp;gt;Debian Forums profile&amp;lt;/dfn&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The Debian First Aid Kit is a practical reference for diagnosing and resolving common system problems on Debian GNU/Linux. It covers commonly occuring categories of failure: system freezes and crashes, boot problems, network issues, package management, disk and filesystem errors, performance degradation, service and application failures, permission and access problems, hardware identification and errors, and quick diagnostics. Each section gives the relevant commands so you can understand what they do and why, rather than a bare list to copy and paste blindly. A dedicated section covers MTR (Matt’s Traceroute) in depth, including output interpretation, practical troubleshooting, and how to monitor continuously. The guide also includes a set of shell aliases for faster access to common diagnostic tasks. All commands are verified on Debian 13 (Trixie) running kernel 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64. This document is intended for users with basic command-line familiarity who need a reliable, consolidated reference when something goes wrong.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Keywords:&#039;&#039;&#039; Debian, troubleshooting, system administration, MTR, network diagnostics, package management, journalctl, filesystem repair&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tested Commands Disclaimer ==&lt;br /&gt;
All commands in this document have been verified on Debian 13 (Trixie) with the kernel versions listed above. Results may vary on other releases or hardware configurations. Always test in a safe environment before applying any procedure to a production system.&lt;br /&gt;
&lt;br /&gt;
== Conventions Used in This Document ==&lt;br /&gt;
Command examples throughout this guide follow standard Unix prompt conventions. A $ prefix indicates a command run as a regular user. Where elevated privileges are required, sudo is shown explicitly and # with a brief explanation if needed:&lt;br /&gt;
 $ journalctl -b -1          # regular user&lt;br /&gt;
 $ sudo apt install mtr      # requires elevation via sudo&lt;br /&gt;
In recovery shell contexts, where you are operating directly as root, the prompt is #.&lt;br /&gt;
&lt;br /&gt;
== System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics:&#039;&#039;&#039; Search for “kernel panic” or “Oops”&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM):&#039;&#039;&#039; Search for “Out of memory” or “oom-killer”&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors:&#039;&#039;&#039; Look for “MCE” (Machine Check Exception) or “hardware error”&lt;br /&gt;
* &#039;&#039;&#039;Driver issues:&#039;&#039;&#039; Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating:&#039;&#039;&#039; Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 $ free -h                      # memory usage&lt;br /&gt;
&lt;br /&gt;
 $ df -h                        # disk space&lt;br /&gt;
&lt;br /&gt;
 $ htop                         # interactive resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ top                          # alternative resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt install btop        # btop is a more detailed alternative&lt;br /&gt;
&lt;br /&gt;
 $ sudo dmesg | grep -i error   # check for disk errors&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN             # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX      # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub                # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab                  # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
The following are permanent errors caused by incomplete or buggy ACPI tables in the BIOS. They are harmless and can be safely ignored if they appear on your system:&lt;br /&gt;
 [0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&lt;br /&gt;
 [0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&lt;br /&gt;
 [0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&lt;br /&gt;
&lt;br /&gt;
== Boot Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Check Boot Process ===&lt;br /&gt;
 $ systemd-analyze blame           # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemd-analyze blame           # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemctl --failed              # units that failed during boot&lt;br /&gt;
&lt;br /&gt;
 $ systemctl status &amp;lt;service-name&amp;gt; # e.g. systemctl status NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN             # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX      # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub                # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab                  # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
== Network Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose Network Connection ===&lt;br /&gt;
 $ ip addr show                         # check network interfaces&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 4 8.8.8.8                    # test IPv4 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 6 2a00:1450:4007:809::200e   # test IPv6 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ nslookup google.com                  # check DNS resolution&lt;br /&gt;
&lt;br /&gt;
 $ ip route show                        # view routing table&lt;br /&gt;
&lt;br /&gt;
 $ ss -tuln                             # check active connections &lt;br /&gt;
&lt;br /&gt;
=== Restart Network Service ===&lt;br /&gt;
 $ sudo systemctl restart NetworkManager   # for systems using NetworkManager&lt;br /&gt;
&lt;br /&gt;
 $ sudo systemctl restart networking       # for systems using networking service&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 down              # bring interface down&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 up                # bring interface back up&lt;br /&gt;
&lt;br /&gt;
== MTR (Matt’s Traceroute) ==&lt;br /&gt;
MTR combines the functionality of ping and traceroute into a single real-time network diagnostic tool. It continuously monitors the path between your system and a destination, providing detailed statistics about latency and packet loss at each hop. When you need to demonstrate a network problem that is outside your control—to your hosting provider, for example—MTR gives you the evidence you need.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
 $ sudo apt install mtr&lt;br /&gt;
&lt;br /&gt;
=== Basic Usage ===&lt;br /&gt;
 $ mtr google.com                          # interactive mode&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report google.com                 # report mode (10 cycles then exit)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 50 google.com       # specify number of cycles&lt;br /&gt;
&lt;br /&gt;
 $ mtr --tcp google.com                    # use TCP instead of ICMP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --udp google.com                    # use UDP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --no-dns google.com                 # skip DNS resolution (faster)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --show-ips google.com               # show both hostnames and IPs&lt;br /&gt;
&lt;br /&gt;
== Understanding MTR Output ==&lt;br /&gt;
&lt;br /&gt;
==== Sample Output ====&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    10   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
   4.|-- ???                      100.0%    10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   5.|-- google.com                 0.0%    10   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
&lt;br /&gt;
=== Column Meanings ===&lt;br /&gt;
&#039;&#039;&#039;HOST&#039;&#039;&#039; — Hostname or IP address of each hop in the route.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loss%&#039;&#039;&#039; — Percentage of packets lost at this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Snt&#039;&#039;&#039; — Number of packets sent to this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last&#039;&#039;&#039; — Latency of the most recent packet, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Avg&#039;&#039;&#039; — Average latency across all packets sent, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best&#039;&#039;&#039; — Lowest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wrst&#039;&#039;&#039; — Highest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StDev&#039;&#039;&#039; — Standard deviation of latency measurements—lower values indicate a more stable connection.&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Results ===&lt;br /&gt;
A healthy network shows 0% loss on all hops, stable latency with low StDev values, a gradual latency increase as hop count increases, and consistent response times.&lt;br /&gt;
&lt;br /&gt;
==== Problem Indicators ====&lt;br /&gt;
&#039;&#039;&#039;1. High Packet Loss at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 5.|-- problem-router.net        25.0%    10   45.3  48.2  42.1  65.8  8.4&lt;br /&gt;
If loss continues to the destination, there is a real problem at that router. If loss appears only at that hop but not beyond, the router is likely rate-limiting ICMP responses—a false positive, not a real problem. The rule of thumb: if packet loss appears at hop N but hops N+1, N+2, and beyond show 0% loss, it’s almost certainly ICMP rate limiting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. High Latency at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 3.|-- slow-link.net              0.0%    10  150.3 155.2 148.1 165.8  5.4&lt;br /&gt;
This indicates a network bottleneck, a congested link, geographical distance (intercontinental hops), or slow routing equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. No Response (???)&#039;&#039;&#039;&lt;br /&gt;
 4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
The router at this hop is configured not to respond to ICMP or traceroute packets, or a firewall is blocking diagnostic packets. This is not necessarily a problem if later hops respond normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. High Jitter (StDev)&#039;&#039;&#039;&lt;br /&gt;
 6.|-- unstable.net               0.0%    10   35.3  52.8  28.1  95.2  24.7&lt;br /&gt;
A high StDev (24.7ms in this example) indicates inconsistent latency caused by network congestion or instability. This is particularly noticeable in real-time applications such as VoIP, gaming, and video calls.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Sudden Latency Spike&#039;&#039;&#039;&lt;br /&gt;
 1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
 2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
 3.|-- problematic-hop.net        0.0%    10  180.5 185.2 178.1 195.8   6.4&lt;br /&gt;
 4.|-- next-hop.net               0.0%    10  182.3 187.8 180.5 198.2   6.8&lt;br /&gt;
Hop 3 introduces approximately 170ms of additional latency (jumping from 9ms to 180ms). Everything from hop 3 onward carries that penalty.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Report Mode with Different Output Formats ====&lt;br /&gt;
 $ mtr --report --csv google.com &amp;gt; network-report.csv    # CSV for logging&lt;br /&gt;
 $ mtr --report --json google.com                        # JSON for parsing&lt;br /&gt;
 $ mtr --report --xml google.com                         # XML format&lt;br /&gt;
 $ mtr --report-wide google.com                          # wide report, no abbreviations&lt;br /&gt;
&lt;br /&gt;
==== Protocol Selection ====&lt;br /&gt;
 $ mtr google.com                                        # ICMP (default)&lt;br /&gt;
 $ mtr --udp google.com                                  # UDP&lt;br /&gt;
 $ sudo mtr --tcp --port 443 google.com                  # specific TCP port&lt;br /&gt;
 $ sudo mtr --tcp --port 22 remote-server.com            # generally the default port&lt;br /&gt;
&lt;br /&gt;
==== Timing and Duration ====&lt;br /&gt;
 $ mtr --interval 0.5 google.com           # interval between pings (default 1s)&lt;br /&gt;
 $ mtr --report-cycles 100 google.com      # extended test, 100 cycles&lt;br /&gt;
 $ mtr google.com                          # continuous monitoring (Ctrl+C to stop)&lt;br /&gt;
 $ mtr --report-cycles 10 google.com       # quick 10-cycle report&lt;br /&gt;
&lt;br /&gt;
==== Advanced Options ====&lt;br /&gt;
 $ mtr --aslookup google.com               # show Autonomous System (AS) numbers&lt;br /&gt;
 $ mtr --max-ttl 20 google.com             # set maximum number of hops&lt;br /&gt;
 $ mtr --psize 1000 google.com             # set packet size&lt;br /&gt;
 $ mtr --show-ips google.com               # show both IP and hostname&lt;br /&gt;
 $ mtr --address 192.168.1.100 google.com  # specify source address&lt;br /&gt;
 $ mtr -4 google.com                       # IPv4 only&lt;br /&gt;
 $ mtr -6 google.com                       # IPv6 only&lt;br /&gt;
&lt;br /&gt;
=== Interactive Mode Commands ===&lt;br /&gt;
When running MTR in interactive mode (mtr hostname), the following keys are available:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;h&#039;&#039;&#039; — Display help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d&#039;&#039;&#039; — Toggle display mode, cycling through different views.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;n&#039;&#039;&#039; — Toggle between hostnames and IP addresses.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;r&#039;&#039;&#039; — Reset all statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;p&#039;&#039;&#039; — Pause/unpause the display.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;q&#039;&#039;&#039; — Quit MTR.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;u&#039;&#039;&#039; — Switch between ICMP, UDP, and TCP modes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;y&#039;&#039;&#039; — Switch between IPv4 and IPv6.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;o&#039;&#039;&#039; — Toggle field display options.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;j&#039;&#039;&#039; — Toggle latency display.&lt;br /&gt;
&lt;br /&gt;
=== Practical Troubleshooting Scenarios ===&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1: Diagnosing a Slow Website ====&lt;br /&gt;
 $ mtr --report-cycles 100 --no-dns example.com&lt;br /&gt;
Look for high average latency at specific hops, packet loss at the destination, and high StDev values indicating jitter.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2: Testing if a Firewall Blocks SSH ====&lt;br /&gt;
 $ sudo mtr --tcp --port 22 --report-cycles 50 remote-server.com&lt;br /&gt;
If the last hop shows 100% loss but earlier hops are fine, port 22 may be filtered. Run a standard ICMP test for comparison.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3: ISP Performance Issues ====&lt;br /&gt;
 $ mtr --report-cycles 100 8.8.8.8&lt;br /&gt;
 &lt;br /&gt;
 $ mtr --report-cycles 100 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If issues appear in the first three or four hops, the problem is likely within your ISP’s network. If issues appear later, the problem lies beyond your ISP.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4: VPN Troubleshooting ====&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; before-vpn.txt   # before VPN&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; after-vpn.txt    # after VPN&lt;br /&gt;
 $ diff before-vpn.txt after-vpn.txt                             # compare the two&lt;br /&gt;
&lt;br /&gt;
==== Scenario 5: Gaming/Streaming Performance ====&lt;br /&gt;
 $ mtr --report-cycles 200 game-server.com&lt;br /&gt;
For real-time applications, look for low average latency (under 50ms for gaming), low StDev (under 5ms preferred), and zero packet loss.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 6: Intermittent Connectivity ====&lt;br /&gt;
 $ mtr --report-cycles 500 --interval 1 target.com &amp;gt; long-test.txt   # long-running test&lt;br /&gt;
 $ mtr target.com                                                    # real-time monitoring&lt;br /&gt;
&lt;br /&gt;
=== Continuous Monitoring ===&lt;br /&gt;
&lt;br /&gt;
==== Log Network Performance Over Time ====&lt;br /&gt;
 while true; do&lt;br /&gt;
     timestamp=$(date +%Y%m%d-%H%M%S)&lt;br /&gt;
     mtr --report --report-cycles 50 google.com &amp;gt; &amp;quot;mtr-$timestamp.txt&amp;quot;&lt;br /&gt;
     sleep 3600&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Monitor Multiple Destinations ====&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 echo &amp;quot;=== MTR Report $(date) ===&amp;quot; &amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Google DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 8.8.8.8 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Cloudflare DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 1.1.1.1 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Your Server:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 your-server.com &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
&lt;br /&gt;
=== Useful Aliases for .bashrc ===&lt;br /&gt;
 Quick network path analysis&lt;br /&gt;
 alias mtrreport=&#039;mtr --report --report-cycles 50 --no-dns&#039;&lt;br /&gt;
 &lt;br /&gt;
 Monitor connection to Google DNS&lt;br /&gt;
 alias netcheck=&#039;mtr --report-cycles 20 8.8.8.8&#039;&lt;br /&gt;
 &lt;br /&gt;
 Extended network test&lt;br /&gt;
 alias mtrlong=&#039;mtr --report-cycles 100&#039;&lt;br /&gt;
 &lt;br /&gt;
 TCP port 443 test (HTTPS)&lt;br /&gt;
 alias mtrhttps=&#039;sudo mtr --tcp --port 443 --report-cycles 30&#039;&lt;br /&gt;
 &lt;br /&gt;
 Quick comparison of major DNS providers&lt;br /&gt;
 alias dnstest=&#039;echo &amp;quot;Google:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 8.8.8.8 &amp;amp;&amp;amp; echo -e &amp;quot;\nCloudflare:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 1.1.1.1&#039;&lt;br /&gt;
After adding to ~/.bashrc, reload with:&lt;br /&gt;
 $ source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
==== Useful Tip for Aliases ====&lt;br /&gt;
Rather than adding aliases directly to &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;, it&#039;s cleaner to keep them in a dedicated file—&amp;lt;code&amp;gt;~/.bashrc_aliases&amp;lt;/code&amp;gt;—and source that file from &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;. This keeps your shell configuration tidy and makes it easy to share or back up just your aliases without touching the rest of your environment.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting Tips ===&lt;br /&gt;
&#039;&#039;&#039;Permission issues with TCP mode:&#039;&#039;&#039;&lt;br /&gt;
 $ sudo mtr --tcp --port 443 example.com              # Use sudo for TCP on privileged ports&lt;br /&gt;
 $ sudo setcap cap_net_raw+ep /usr/bin/mtr-packet     # Or set capabilities (one-time setup)&lt;br /&gt;
&#039;&#039;&#039;False positives:&#039;&#039;&#039; Packet loss at an intermediate hop but not at the destination is almost always ICMP rate limiting at that router, not a real problem. Example:&lt;br /&gt;
 3.|-- router.isp.net            20.0%    50   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
 4.|-- next-hop.net               0.0%    50   18.5  19.2  17.8  22.1   1.3&lt;br /&gt;
 5.|-- destination.com            0.0%    50   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
Hop 3 shows 20% loss, but hops 4 and 5 show 0%. Traffic is flowing normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DNS resolution delays:&#039;&#039;&#039; If MTR is slow to start, skip DNS resolution with mtr --no-dns target.com and resolve addresses afterward with host 203.0.113.1 if needed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Comparing results:&#039;&#039;&#039;&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test1.txt&lt;br /&gt;
 $ sleep 60&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test2.txt&lt;br /&gt;
 $ diff test1.txt test2.txt&lt;br /&gt;
&lt;br /&gt;
=== When to Use MTR vs Other Tools ===&lt;br /&gt;
&#039;&#039;&#039;MTR&#039;&#039;&#039; — Best for continuous monitoring, identifying problem hops, and gathering detailed statistics. Requires installation via apt.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ping&#039;&#039;&#039; — Best for a quick connectivity test or simple latency check. Only tests the endpoint, not the path.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;traceroute&#039;&#039;&#039; — Best for one-time path discovery. Provides no continuous monitoring.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ss / netstat&#039;&#039;&#039; — Best for checking local connection status. Doesn’t test remote paths.&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
Run at least 50–100 cycles for accurate statistics. Use --no-dns for faster results and to avoid DNS resolution issues during testing. Test at different times of day, since network conditions vary. If one protocol shows issues, compare ICMP, UDP, and TCP modes. Save reports with timestamps for trend analysis. Use 8.8.8.8 or 1.1.1.1 as known-good hosts to verify your local network first. Let MTR run for at least 30–60 seconds before drawing conclusions.&lt;br /&gt;
&lt;br /&gt;
=== Reading Between the Lines ===&lt;br /&gt;
&#039;&#039;&#039;Good network health:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.1   1.2   0.9   2.1   0.2&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    50    8.2   8.5   7.5  10.2   0.5&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    50   15.1  15.5  14.0  18.3   0.8&lt;br /&gt;
   4.|-- google.com                 0.0%    50   24.8  25.2  23.5  28.1   1.1&lt;br /&gt;
No packet loss, consistent latency, low jitter throughout.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problematic network:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.2   1.5   1.0   2.3   0.3&lt;br /&gt;
   2.|-- 10.0.0.1                   5.0%    50   45.3  52.8   8.1 245.2  45.7&lt;br /&gt;
   3.|-- ???                      100.0%    50    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   4.|-- destination.com           15.0%    50   95.4 125.8  48.2 385.5  78.2&lt;br /&gt;
Packet loss at hop 2 and the destination, high jitter, and a very high worst-case latency all point to a genuine problem at or near hop 2.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
MTR is your friend when it comes to diagnostics. Use --report-cycles 50 or higher for reliable data. Watch for packet loss at the destination—intermediate losses may be false positives. High StDev indicates an unstable connection. High average latency points to slow links. Use --no-dns for faster results. Compare ICMP, UDP, and TCP modes if issues appear. Test at different times of day for a complete picture.&lt;br /&gt;
== Package Management Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Fix Broken Packages ===&lt;br /&gt;
 $ sudo apt update                     # update package lists&lt;br /&gt;
 $ sudo apt --fix-broken install       # fix broken dependencies&lt;br /&gt;
 $ sudo dpkg --configure -a            # reconfigure packages (no output = nothing to do)&lt;br /&gt;
 $ sudo apt clean                      # clean package cache&lt;br /&gt;
 $ sudo apt autoclean&lt;br /&gt;
 $ sudo apt autoremove                 # remove unused packages&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 $ sudo lsof /var/lib/dpkg/lock-frontend        # find process holding the lock&lt;br /&gt;
 $ sudo rm /var/lib/dpkg/lock-frontend          # remove lock (only if no package manager is running)&lt;br /&gt;
 $ sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 $ sudo dpkg --configure -a                     # reconfigure dpkg&lt;br /&gt;
&lt;br /&gt;
== Disk &amp;amp; Filesystem Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 $ df -h                                  # disk space&lt;br /&gt;
 $ df -i                                  # inode usage&lt;br /&gt;
 $ sudo apt install sysstat               # sysstat includes iostat, mpstat, sar, pidstat, cifsiostat&lt;br /&gt;
 $ iostat -x 1                            # disk I/O statistics&lt;br /&gt;
 $ iostat -xm 2                           # stats in MB instead of KB&lt;br /&gt;
 $ iostat -x sda 1                        # monitor a specific device&lt;br /&gt;
 $ sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;     # check for disk errors&lt;br /&gt;
 $ sudo apt install smartmontools&lt;br /&gt;
 $ sudo smartctl -a /dev/sdX              # SMART disk health - lsblk to determine the target device&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 # Fix broken dependencies&lt;br /&gt;
 sudo apt --fix-broken install&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure packages&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
 # No output means there is nothing to reconfigure&lt;br /&gt;
 &lt;br /&gt;
 # Clean package cache&lt;br /&gt;
 sudo apt clean&lt;br /&gt;
 sudo apt autoclean&lt;br /&gt;
 &lt;br /&gt;
 # Remove unused packages&lt;br /&gt;
 sudo apt autoremove&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 # If apt is locked, find the process holding the lock&lt;br /&gt;
 sudo lsof /var/lib/dpkg/lock-frontend&lt;br /&gt;
 &lt;br /&gt;
 # Remove the lock (use with caution—only if no package manager is running)&lt;br /&gt;
 sudo rm /var/lib/dpkg/lock-frontend&lt;br /&gt;
 sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure dpkg&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
Disk &amp;amp; Filesystem Issues&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 # Check disk space&lt;br /&gt;
 df -h&lt;br /&gt;
 &lt;br /&gt;
 # Check inode usage&lt;br /&gt;
 df -i&lt;br /&gt;
 &lt;br /&gt;
 # View disk I/O statistics&lt;br /&gt;
 # iostat is part of the sysstat package, which also includes:&lt;br /&gt;
 # mpstat (CPU statistics), sar (system activity reporter),&lt;br /&gt;
 # pidstat (process statistics), and cifsiostat (CIFS statistics)&lt;br /&gt;
 sudo apt install sysstat&lt;br /&gt;
 &lt;br /&gt;
 iostat -x 1&lt;br /&gt;
 &lt;br /&gt;
 # Show stats in MB instead of KB&lt;br /&gt;
 iostat -xm 2&lt;br /&gt;
 &lt;br /&gt;
 # Monitor a specific device&lt;br /&gt;
 iostat -x sda 1&lt;br /&gt;
 &lt;br /&gt;
 # Check for disk errors in dmesg&lt;br /&gt;
 sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # SMART disk health (requires smartmontools)&lt;br /&gt;
 sudo apt install smartmontools&lt;br /&gt;
 sudo smartctl -a /dev/sda&lt;br /&gt;
&lt;br /&gt;
=== Repair Filesystem ===&lt;br /&gt;
 # Unmount the partition first&lt;br /&gt;
 sudo umount /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Run filesystem check&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # For ext4 specifically&lt;br /&gt;
 sudo e2fsck -f /dev/sdXN&lt;br /&gt;
Performance Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Resource Hogs ===&lt;br /&gt;
 # CPU usage by process&lt;br /&gt;
 top -o %CPU&lt;br /&gt;
 &lt;br /&gt;
 # Memory usage by process&lt;br /&gt;
 top -o %MEM&lt;br /&gt;
 &lt;br /&gt;
 # Disk usage by directory&lt;br /&gt;
 du -sh /* | sort -h&lt;br /&gt;
 &lt;br /&gt;
 # Find large files&lt;br /&gt;
 find / -type f -size +100M 2&amp;gt;/dev/null&lt;br /&gt;
 &lt;br /&gt;
 # Check running processes sorted by memory use&lt;br /&gt;
 ps aux --sort=-%mem | head -20&lt;br /&gt;
&lt;br /&gt;
=== System Temperature Monitoring ===&lt;br /&gt;
 # Install lm-sensors if not already present&lt;br /&gt;
 sudo apt install lm-sensors&lt;br /&gt;
 sudo sensors-detect&lt;br /&gt;
 &lt;br /&gt;
 # View temperatures&lt;br /&gt;
 sensors&lt;br /&gt;
 &lt;br /&gt;
 # Real-time temperature monitoring&lt;br /&gt;
 watch -n 2 sensors&lt;br /&gt;
See section 12 for a shell alias that makes temperature monitoring more convenient.&lt;br /&gt;
&lt;br /&gt;
Service &amp;amp; Application Errors&lt;br /&gt;
&lt;br /&gt;
=== Debug Service Problems ===&lt;br /&gt;
 # Check service status&lt;br /&gt;
 sudo systemctl status service-name&lt;br /&gt;
 &lt;br /&gt;
 # View service logs&lt;br /&gt;
 sudo journalctl -u service-name&lt;br /&gt;
 &lt;br /&gt;
 # Restart a service&lt;br /&gt;
 sudo systemctl restart service-name&lt;br /&gt;
 &lt;br /&gt;
 # Enable service at boot&lt;br /&gt;
 sudo systemctl enable service-name&lt;br /&gt;
 &lt;br /&gt;
 # View recent service failures&lt;br /&gt;
 journalctl -p err -b&lt;br /&gt;
&lt;br /&gt;
=== Application Crash Investigation ===&lt;br /&gt;
 # Check for core dumps&lt;br /&gt;
 ls -lh /var/crash/&lt;br /&gt;
 &lt;br /&gt;
 # View available application logs&lt;br /&gt;
 ls /var/log/&lt;br /&gt;
 &lt;br /&gt;
 # Follow syslog for application errors in real-time&lt;br /&gt;
 sudo tail -f /var/log/syslog&lt;br /&gt;
Permission &amp;amp; Access Issues&lt;br /&gt;
&lt;br /&gt;
=== Fix Common Permission Problems ===&lt;br /&gt;
 # Check file ownership&lt;br /&gt;
 ls -l /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change ownership (user:group)&lt;br /&gt;
 sudo chown user:group /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change permissions&lt;br /&gt;
 sudo chmod 644 /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Recursively fix permissions on a directory&lt;br /&gt;
 sudo chown -R user:group /path/to/directory&lt;br /&gt;
&lt;br /&gt;
=== User &amp;amp; Authentication Issues ===&lt;br /&gt;
 # Check user information&lt;br /&gt;
 id username&lt;br /&gt;
 &lt;br /&gt;
 # View user login history&lt;br /&gt;
 last -a&lt;br /&gt;
 &lt;br /&gt;
 # Check failed login attempts&lt;br /&gt;
 sudo journalctl | grep &amp;quot;authentication failure&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Reset user password&lt;br /&gt;
 sudo passwd username&lt;br /&gt;
Hardware Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Hardware ===&lt;br /&gt;
 # List all hardware (install if needed: sudo apt install lshw)&lt;br /&gt;
 sudo lshw -short&lt;br /&gt;
 &lt;br /&gt;
 # PCI devices&lt;br /&gt;
 lspci -v&lt;br /&gt;
 &lt;br /&gt;
 # USB devices&lt;br /&gt;
 lsusb -v&lt;br /&gt;
 &lt;br /&gt;
 # CPU information&lt;br /&gt;
 lscpu&lt;br /&gt;
 &lt;br /&gt;
 # Memory information&lt;br /&gt;
 sudo dmidecode --type memory&lt;br /&gt;
&lt;br /&gt;
=== Check Hardware Errors ===&lt;br /&gt;
 # Kernel ring buffer (hardware messages)&lt;br /&gt;
 dmesg | less&lt;br /&gt;
 # Press q to quit&lt;br /&gt;
 &lt;br /&gt;
 # Search for specific hardware issues&lt;br /&gt;
 dmesg | grep -i &amp;quot;error\|fail\|warn&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Check for USB issues&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
Quick Diagnostic Commands&lt;br /&gt;
&lt;br /&gt;
=== System Information at a Glance ===&lt;br /&gt;
 # Uptime and load average&lt;br /&gt;
 uptime&lt;br /&gt;
 &lt;br /&gt;
 # Kernel version&lt;br /&gt;
 uname -r&lt;br /&gt;
 &lt;br /&gt;
 # Debian version&lt;br /&gt;
 cat /etc/debian_version&lt;br /&gt;
 &lt;br /&gt;
 # Full system summary (install if needed: sudo apt install inxi)&lt;br /&gt;
 sudo inxi -Fxz&lt;br /&gt;
&lt;br /&gt;
=== Emergency Toolkit ===&lt;br /&gt;
 # Create a consolidated diagnostic report&lt;br /&gt;
 sudo journalctl -b &amp;gt; ~/system-report.txt&lt;br /&gt;
 dmesg &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 systemctl --failed &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 df -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 free -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 &lt;br /&gt;
 # Watch logs in real-time&lt;br /&gt;
 sudo journalctl -f&lt;br /&gt;
 &lt;br /&gt;
 # Monitor system resources continuously&lt;br /&gt;
 watch -n 1 &#039;free -h &amp;amp;&amp;amp; df -h&#039;&lt;br /&gt;
Useful Aliases &amp;amp; Shortcuts&lt;br /&gt;
Add these to your ~/.bashrc for quick access to common troubleshooting commands:&lt;br /&gt;
 # Monitor system temperatures in real-time&lt;br /&gt;
 alias temps=&amp;quot;watch -n 2 &#039;for i in /sys/class/hwmon/hwmon*/; do echo -n \&amp;quot;\$(cat \${i}name): \&amp;quot;; cat \${i}temp*_input 2&amp;gt;/dev/null | while read temp; do echo \&amp;quot;scale=1; \$temp/1000\&amp;quot; | bc; done | tr \&amp;quot;\n\&amp;quot; \&amp;quot; \&amp;quot;; echo \&amp;quot;°C\&amp;quot;; done&#039;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Quick system status&lt;br /&gt;
 alias sysstat=&#039;echo &amp;quot;=== CPU ===&amp;quot; &amp;amp;&amp;amp; uptime &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Memory ===&amp;quot; &amp;amp;&amp;amp; free -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Disk ===&amp;quot; &amp;amp;&amp;amp; df -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Top Processes ===&amp;quot; &amp;amp;&amp;amp; ps aux --sort=-%mem | head -10&#039;&lt;br /&gt;
 &lt;br /&gt;
 # View last boot logs&lt;br /&gt;
 alias lastboot=&#039;journalctl -b -1&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Check failed services&lt;br /&gt;
 alias failedservices=&#039;systemctl --failed&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Monitor logs in real-time&lt;br /&gt;
 alias watchlog=&#039;sudo journalctl -f&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Quick network status&lt;br /&gt;
 alias netstatus=&#039;ip addr show &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Routes ===&amp;quot; &amp;amp;&amp;amp; ip route show&#039;&lt;br /&gt;
After adding these, reload your shell configuration:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
Tips for Effective Troubleshooting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check logs first.&#039;&#039;&#039; journalctl and dmesg are your best starting point for almost any problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Change one thing at a time.&#039;&#039;&#039; It’s tempting to make several changes at once, but doing so makes it impossible to know what actually fixed—or broke—the problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Document your changes.&#039;&#039;&#039; Keep notes on what you’ve tried and what the results were. You’ll thank yourself later.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use exact error messages.&#039;&#039;&#039; Copy error messages verbatim and search for them alongside “Debian” and the version number—for example, “Debian 13” or “Debian 13.1” for point releases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check what changed recently.&#039;&#039;&#039; Did you install something, update packages, or change the kernel before the problem appeared? Start there.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Back up before making major changes.&#039;&#039;&#039; This goes without saying, but it’s easy to skip when you’re in a hurry.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use verbose mode.&#039;&#039;&#039; Adding -v or -vv flags to commands often reveals what would otherwise be silent failures.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the community.&#039;&#039;&#039; The Debian forums, Reddit, Stack Exchange, and the Debian mailing lists are all active and well-indexed. Someone has usually seen your problem before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by &amp;lt;dfn&amp;gt;distro-nix&amp;lt;/dfn&amp;gt; to the Debian User Forums on 2025-10-27.&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=275</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=275"/>
		<updated>2026-05-15T23:00:17Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: Checking/fixing preformattied boxes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Author&#039;&#039;&#039; &#039;&#039;&#039;Profile:&#039;&#039;&#039; [https://forums.debian.net/memberlist.php?mode=viewprofile&amp;amp;u=239099 distro-nix]  &#039;&#039;&#039;Debian Version:&#039;&#039;&#039; Debian 13 (Trixie) &#039;&#039;&#039;Kernel Versions Tested:&#039;&#039;&#039; 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64 (x86_64) &#039;&#039;&#039;Created:&#039;&#039;&#039; 2025-10-27 &#039;&#039;&#039;Last Updated:&#039;&#039;&#039; 2026-05-15 &#039;&#039;&#039;ID:&#039;&#039;&#039; 544201 &#039;&#039;&#039;License:&#039;&#039;&#039; CC BY-SA 4.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This guide is preserved in its original form. Questions and feedback welcome via the author’s &amp;lt;dfn&amp;gt;Debian Forums profile&amp;lt;/dfn&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The Debian First Aid Kit is a practical reference for diagnosing and resolving common system problems on Debian GNU/Linux. It covers commonly occuring categories of failure: system freezes and crashes, boot problems, network issues, package management, disk and filesystem errors, performance degradation, service and application failures, permission and access problems, hardware identification and errors, and quick diagnostics. Each section gives the relevant commands so you can understand what they do and why, rather than a bare list to copy and paste blindly. A dedicated section covers MTR (Matt’s Traceroute) in depth, including output interpretation, practical troubleshooting, and how to monitor continuously. The guide also includes a set of shell aliases for faster access to common diagnostic tasks. All commands are verified on Debian 13 (Trixie) running kernel 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64. This document is intended for users with basic command-line familiarity who need a reliable, consolidated reference when something goes wrong.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Keywords:&#039;&#039;&#039; Debian, troubleshooting, system administration, MTR, network diagnostics, package management, journalctl, filesystem repair&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tested Commands Disclaimer ==&lt;br /&gt;
All commands in this document have been verified on Debian 13 (Trixie) with the kernel versions listed above. Results may vary on other releases or hardware configurations. Always test in a safe environment before applying any procedure to a production system.&lt;br /&gt;
&lt;br /&gt;
== Conventions Used in This Document ==&lt;br /&gt;
Command examples throughout this guide follow standard Unix prompt conventions. A $ prefix indicates a command run as a regular user. Where elevated privileges are required, sudo is shown explicitly and # with a brief explanation if needed:&lt;br /&gt;
 $ journalctl -b -1          # regular user&lt;br /&gt;
 $ sudo apt install mtr      # requires elevation via sudo&lt;br /&gt;
In recovery shell contexts, where you are operating directly as root, the prompt is #.&lt;br /&gt;
&lt;br /&gt;
== System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics:&#039;&#039;&#039; Search for “kernel panic” or “Oops”&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM):&#039;&#039;&#039; Search for “Out of memory” or “oom-killer”&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors:&#039;&#039;&#039; Look for “MCE” (Machine Check Exception) or “hardware error”&lt;br /&gt;
* &#039;&#039;&#039;Driver issues:&#039;&#039;&#039; Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating:&#039;&#039;&#039; Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 $ free -h                      # memory usage&lt;br /&gt;
&lt;br /&gt;
 $ df -h                        # disk space&lt;br /&gt;
&lt;br /&gt;
 $ htop                         # interactive resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ top                          # alternative resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt install btop        # btop is a more detailed alternative&lt;br /&gt;
&lt;br /&gt;
 $ sudo dmesg | grep -i error   # check for disk errors&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN             # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX      # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub                # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab                  # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
The following are permanent errors caused by incomplete or buggy ACPI tables in the BIOS. They are harmless and can be safely ignored if they appear on your system:&lt;br /&gt;
 [0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&lt;br /&gt;
 [0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&lt;br /&gt;
 [0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&lt;br /&gt;
&lt;br /&gt;
== Boot Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Check Boot Process ===&lt;br /&gt;
 $ systemd-analyze blame           # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemd-analyze blame           # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemctl --failed              # units that failed during boot&lt;br /&gt;
&lt;br /&gt;
 $ systemctl status &amp;lt;service-name&amp;gt; # e.g. systemctl status NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN             # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX      # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub                # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab                  # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
== Network Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose Network Connection ===&lt;br /&gt;
 $ ip addr show                         # check network interfaces&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 4 8.8.8.8                    # test IPv4 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 6 2a00:1450:4007:809::200e   # test IPv6 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ nslookup google.com                  # check DNS resolution&lt;br /&gt;
&lt;br /&gt;
 $ ip route show                        # view routing table&lt;br /&gt;
&lt;br /&gt;
 $ ss -tuln                             # check active connections &lt;br /&gt;
&lt;br /&gt;
=== Restart Network Service ===&lt;br /&gt;
 $ sudo systemctl restart NetworkManager   # for systems using NetworkManager&lt;br /&gt;
&lt;br /&gt;
 $ sudo systemctl restart networking       # for systems using networking service&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 down              # bring interface down&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 up                # bring interface back up&lt;br /&gt;
&lt;br /&gt;
== MTR (Matt’s Traceroute) ==&lt;br /&gt;
MTR combines the functionality of ping and traceroute into a single real-time network diagnostic tool. It continuously monitors the path between your system and a destination, providing detailed statistics about latency and packet loss at each hop. When you need to demonstrate a network problem that is outside your control—to your hosting provider, for example—MTR gives you the evidence you need.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
 $ sudo apt install mtr&lt;br /&gt;
&lt;br /&gt;
=== Basic Usage ===&lt;br /&gt;
 $ mtr google.com                          # interactive mode&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report google.com                 # report mode (10 cycles then exit)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 50 google.com       # specify number of cycles&lt;br /&gt;
&lt;br /&gt;
 $ mtr --tcp google.com                    # use TCP instead of ICMP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --udp google.com                    # use UDP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --no-dns google.com                 # skip DNS resolution (faster)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --show-ips google.com               # show both hostnames and IPs&lt;br /&gt;
&lt;br /&gt;
== Understanding MTR Output ==&lt;br /&gt;
&lt;br /&gt;
==== Sample Output ====&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    10   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
   4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   5.|-- google.com                 0.0%    10   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
&lt;br /&gt;
=== Column Meanings ===&lt;br /&gt;
&#039;&#039;&#039;HOST&#039;&#039;&#039; — Hostname or IP address of each hop in the route.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loss%&#039;&#039;&#039; — Percentage of packets lost at this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Snt&#039;&#039;&#039; — Number of packets sent to this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last&#039;&#039;&#039; — Latency of the most recent packet, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Avg&#039;&#039;&#039; — Average latency across all packets sent, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best&#039;&#039;&#039; — Lowest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wrst&#039;&#039;&#039; — Highest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StDev&#039;&#039;&#039; — Standard deviation of latency measurements—lower values indicate a more stable connection.&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Results ===&lt;br /&gt;
A healthy network shows 0% loss on all hops, stable latency with low StDev values, a gradual latency increase as hop count increases, and consistent response times.&lt;br /&gt;
&lt;br /&gt;
==== Problem Indicators ====&lt;br /&gt;
&#039;&#039;&#039;1. High Packet Loss at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 5.|-- problem-router.net        25.0%    10   45.3  48.2  42.1  65.8  8.4&lt;br /&gt;
If loss continues to the destination, there is a real problem at that router. If loss appears only at that hop but not beyond, the router is likely rate-limiting ICMP responses—a false positive, not a real problem. The rule of thumb: if packet loss appears at hop N but hops N+1, N+2, and beyond show 0% loss, it’s almost certainly ICMP rate limiting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. High Latency at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 3.|-- slow-link.net              0.0%    10  150.3 155.2 148.1 165.8  5.4&lt;br /&gt;
This indicates a network bottleneck, a congested link, geographical distance (intercontinental hops), or slow routing equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. No Response (???)&#039;&#039;&#039;&lt;br /&gt;
 4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
The router at this hop is configured not to respond to ICMP or traceroute packets, or a firewall is blocking diagnostic packets. This is not necessarily a problem if later hops respond normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. High Jitter (StDev)&#039;&#039;&#039;&lt;br /&gt;
 6.|-- unstable.net               0.0%    10   35.3  52.8  28.1  95.2  24.7&lt;br /&gt;
A high StDev (24.7ms in this example) indicates inconsistent latency caused by network congestion or instability. This is particularly noticeable in real-time applications such as VoIP, gaming, and video calls.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Sudden Latency Spike&#039;&#039;&#039;&lt;br /&gt;
 1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
 2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
 3.|-- problematic-hop.net        0.0%    10  180.5 185.2 178.1 195.8   6.4&lt;br /&gt;
 4.|-- next-hop.net               0.0%    10  182.3 187.8 180.5 198.2   6.8&lt;br /&gt;
Hop 3 introduces approximately 170ms of additional latency (jumping from 9ms to 180ms). Everything from hop 3 onward carries that penalty.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Report Mode with Different Output Formats ====&lt;br /&gt;
 $ mtr --report --csv google.com &amp;gt; network-report.csv    # CSV for logging&lt;br /&gt;
 $ mtr --report --json google.com                        # JSON for parsing&lt;br /&gt;
 $ mtr --report --xml google.com                         # XML format&lt;br /&gt;
 $ mtr --report-wide google.com                          # wide report, no abbreviations&lt;br /&gt;
&lt;br /&gt;
==== Protocol Selection ====&lt;br /&gt;
 $ mtr google.com                                        # ICMP (default)&lt;br /&gt;
 $ mtr --udp google.com                                  # UDP&lt;br /&gt;
 $ sudo mtr --tcp --port 443 google.com                  # specific TCP port&lt;br /&gt;
 $ sudo mtr --tcp --port 22 remote-server.com&lt;br /&gt;
&lt;br /&gt;
==== Timing and Duration ====&lt;br /&gt;
 $ mtr --interval 0.5 google.com           # interval between pings (default 1s)&lt;br /&gt;
 $ mtr --report-cycles 100 google.com      # extended test, 100 cycles&lt;br /&gt;
 $ mtr google.com                          # continuous monitoring (Ctrl+C to stop)&lt;br /&gt;
 $ mtr --report-cycles 10 google.com       # quick 10-cycle report&lt;br /&gt;
&lt;br /&gt;
==== Advanced Options ====&lt;br /&gt;
 $ mtr --aslookup google.com               # show Autonomous System (AS) numbers&lt;br /&gt;
 $ mtr --max-ttl 20 google.com             # set maximum number of hops&lt;br /&gt;
 $ mtr --psize 1000 google.com             # set packet size&lt;br /&gt;
 $ mtr --show-ips google.com               # show both IP and hostname&lt;br /&gt;
 $ mtr --address 192.168.1.100 google.com  # specify source address&lt;br /&gt;
 $ mtr -4 google.com                       # IPv4 only&lt;br /&gt;
 $ mtr -6 google.com                       # IPv6 only&lt;br /&gt;
&lt;br /&gt;
=== Interactive Mode Commands ===&lt;br /&gt;
When running MTR in interactive mode (mtr hostname), the following keys are available:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;h&#039;&#039;&#039; — Display help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d&#039;&#039;&#039; — Toggle display mode, cycling through different views.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;n&#039;&#039;&#039; — Toggle between hostnames and IP addresses.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;r&#039;&#039;&#039; — Reset all statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;p&#039;&#039;&#039; — Pause/unpause the display.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;q&#039;&#039;&#039; — Quit MTR.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;u&#039;&#039;&#039; — Switch between ICMP, UDP, and TCP modes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;y&#039;&#039;&#039; — Switch between IPv4 and IPv6.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;o&#039;&#039;&#039; — Toggle field display options.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;j&#039;&#039;&#039; — Toggle latency display.&lt;br /&gt;
&lt;br /&gt;
=== Practical Troubleshooting Scenarios ===&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1: Diagnosing a Slow Website ====&lt;br /&gt;
 $ mtr --report-cycles 100 --no-dns example.com&lt;br /&gt;
Look for high average latency at specific hops, packet loss at the destination, and high StDev values indicating jitter.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2: Testing if a Firewall Blocks SSH ====&lt;br /&gt;
 $ sudo mtr --tcp --port 22 --report-cycles 50 remote-server.com&lt;br /&gt;
If the last hop shows 100% loss but earlier hops are fine, port 22 may be filtered. Run a standard ICMP test for comparison.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3: ISP Performance Issues ====&lt;br /&gt;
 $ mtr --report-cycles 100 8.8.8.8&lt;br /&gt;
 &lt;br /&gt;
 $ mtr --report-cycles 100 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If issues appear in the first three or four hops, the problem is likely within your ISP’s network. If issues appear later, the problem lies beyond your ISP.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4: VPN Troubleshooting ====&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; before-vpn.txt   # before VPN&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; after-vpn.txt    # after VPN&lt;br /&gt;
 $ diff before-vpn.txt after-vpn.txt                             # compare the two&lt;br /&gt;
&lt;br /&gt;
==== Scenario 5: Gaming/Streaming Performance ====&lt;br /&gt;
 $ mtr --report-cycles 200 game-server.com&lt;br /&gt;
For real-time applications, look for low average latency (under 50ms for gaming), low StDev (under 5ms preferred), and zero packet loss.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 6: Intermittent Connectivity ====&lt;br /&gt;
 $ mtr --report-cycles 500 --interval 1 target.com &amp;gt; long-test.txt   # long-running test&lt;br /&gt;
 $ mtr target.com                                                    # real-time monitoring&lt;br /&gt;
&lt;br /&gt;
=== Continuous Monitoring ===&lt;br /&gt;
&lt;br /&gt;
==== Log Network Performance Over Time ====&lt;br /&gt;
 while true; do&lt;br /&gt;
     timestamp=$(date +%Y%m%d-%H%M%S)&lt;br /&gt;
     mtr --report --report-cycles 50 google.com &amp;gt; &amp;quot;mtr-$timestamp.txt&amp;quot;&lt;br /&gt;
     sleep 3600&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Monitor Multiple Destinations ====&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 echo &amp;quot;=== MTR Report $(date) ===&amp;quot; &amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Google DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 8.8.8.8 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Cloudflare DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 1.1.1.1 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Your Server:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 your-server.com &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
&lt;br /&gt;
=== Useful Aliases for .bashrc ===&lt;br /&gt;
 Quick network path analysis&lt;br /&gt;
 alias mtrreport=&#039;mtr --report --report-cycles 50 --no-dns&#039;&lt;br /&gt;
 &lt;br /&gt;
 Monitor connection to Google DNS&lt;br /&gt;
 alias netcheck=&#039;mtr --report-cycles 20 8.8.8.8&#039;&lt;br /&gt;
 &lt;br /&gt;
 Extended network test&lt;br /&gt;
 alias mtrlong=&#039;mtr --report-cycles 100&#039;&lt;br /&gt;
 &lt;br /&gt;
 TCP port 443 test (HTTPS)&lt;br /&gt;
 alias mtrhttps=&#039;sudo mtr --tcp --port 443 --report-cycles 30&#039;&lt;br /&gt;
 &lt;br /&gt;
 Quick comparison of major DNS providers&lt;br /&gt;
 alias dnstest=&#039;echo &amp;quot;Google:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 8.8.8.8 &amp;amp;&amp;amp; echo -e &amp;quot;\nCloudflare:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 1.1.1.1&#039;&lt;br /&gt;
After adding to ~/.bashrc, reload with:&lt;br /&gt;
 $ source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
==== Useful Tip for Aliases ====&lt;br /&gt;
Rather than adding aliases directly to &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;, it&#039;s cleaner to keep them in a dedicated file—&amp;lt;code&amp;gt;~/.bashrc_aliases&amp;lt;/code&amp;gt;—and source that file from &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;. This keeps your shell configuration tidy and makes it easy to share or back up just your aliases without touching the rest of your environment.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting Tips ===&lt;br /&gt;
&#039;&#039;&#039;Permission issues with TCP mode:&#039;&#039;&#039;&lt;br /&gt;
 $ sudo mtr --tcp --port 443 example.com              # Use sudo for TCP on privileged ports&lt;br /&gt;
 $ sudo setcap cap_net_raw+ep /usr/bin/mtr-packet     # Or set capabilities (one-time setup)&lt;br /&gt;
&#039;&#039;&#039;False positives:&#039;&#039;&#039; Packet loss at an intermediate hop but not at the destination is almost always ICMP rate limiting at that router, not a real problem. Example:&lt;br /&gt;
 3.|-- router.isp.net            20.0%    50   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
 4.|-- next-hop.net               0.0%    50   18.5  19.2  17.8  22.1   1.3&lt;br /&gt;
 5.|-- destination.com            0.0%    50   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
Hop 3 shows 20% loss, but hops 4 and 5 show 0%. Traffic is flowing normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DNS resolution delays:&#039;&#039;&#039; If MTR is slow to start, skip DNS resolution with mtr --no-dns target.com and resolve addresses afterward with host 203.0.113.1 if needed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Comparing results:&#039;&#039;&#039;&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test1.txt&lt;br /&gt;
 $ sleep 60&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test2.txt&lt;br /&gt;
 $ diff test1.txt test2.txt&lt;br /&gt;
&lt;br /&gt;
=== When to Use MTR vs Other Tools ===&lt;br /&gt;
&#039;&#039;&#039;MTR&#039;&#039;&#039; — Best for continuous monitoring, identifying problem hops, and gathering detailed statistics. Requires installation via apt.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ping&#039;&#039;&#039; — Best for a quick connectivity test or simple latency check. Only tests the endpoint, not the path.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;traceroute&#039;&#039;&#039; — Best for one-time path discovery. Provides no continuous monitoring.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ss / netstat&#039;&#039;&#039; — Best for checking local connection status. Doesn’t test remote paths.&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
Run at least 50–100 cycles for accurate statistics. Use --no-dns for faster results and to avoid DNS resolution issues during testing. Test at different times of day, since network conditions vary. If one protocol shows issues, compare ICMP, UDP, and TCP modes. Save reports with timestamps for trend analysis. Use 8.8.8.8 or 1.1.1.1 as known-good hosts to verify your local network first. Let MTR run for at least 30–60 seconds before drawing conclusions.&lt;br /&gt;
&lt;br /&gt;
=== Reading Between the Lines ===&lt;br /&gt;
&#039;&#039;&#039;Good network health:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.1   1.2   0.9   2.1   0.2&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    50    8.2   8.5   7.5  10.2   0.5&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    50   15.1  15.5  14.0  18.3   0.8&lt;br /&gt;
   4.|-- google.com                 0.0%    50   24.8  25.2  23.5  28.1   1.1&lt;br /&gt;
No packet loss, consistent latency, low jitter throughout.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problematic network:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.2   1.5   1.0   2.3   0.3&lt;br /&gt;
   2.|-- 10.0.0.1                   5.0%    50   45.3  52.8   8.1 245.2  45.7&lt;br /&gt;
   3.|-- ???                      100.0%    50    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   4.|-- destination.com           15.0%    50   95.4 125.8  48.2 385.5  78.2&lt;br /&gt;
Packet loss at hop 2 and the destination, high jitter, and a very high worst-case latency all point to a genuine problem at or near hop 2.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
MTR is your friend when it comes to diagnostics. Use --report-cycles 50 or higher for reliable data. Watch for packet loss at the destination—intermediate losses may be false positives. High StDev indicates an unstable connection. High average latency points to slow links. Use --no-dns for faster results. Compare ICMP, UDP, and TCP modes if issues appear. Test at different times of day for a complete picture.&lt;br /&gt;
== Package Management Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Fix Broken Packages ===&lt;br /&gt;
 $ sudo apt update                     # update package lists&lt;br /&gt;
 $ sudo apt --fix-broken install       # fix broken dependencies&lt;br /&gt;
 $ sudo dpkg --configure -a            # reconfigure packages (no output = nothing to do)&lt;br /&gt;
 $ sudo apt clean                      # clean package cache&lt;br /&gt;
 $ sudo apt autoclean&lt;br /&gt;
 $ sudo apt autoremove                 # remove unused packages&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 $ sudo lsof /var/lib/dpkg/lock-frontend        # find process holding the lock&lt;br /&gt;
 $ sudo rm /var/lib/dpkg/lock-frontend          # remove lock (only if no package manager is running)&lt;br /&gt;
 $ sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 $ sudo dpkg --configure -a                     # reconfigure dpkg&lt;br /&gt;
&lt;br /&gt;
== Disk &amp;amp; Filesystem Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 $ df -h                                  # disk space&lt;br /&gt;
 $ df -i                                  # inode usage&lt;br /&gt;
 $ sudo apt install sysstat               # sysstat includes iostat, mpstat, sar, pidstat, cifsiostat&lt;br /&gt;
 $ iostat -x 1                            # disk I/O statistics&lt;br /&gt;
 $ iostat -xm 2                           # stats in MB instead of KB&lt;br /&gt;
 $ iostat -x sda 1                        # monitor a specific device&lt;br /&gt;
 $ sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;     # check for disk errors&lt;br /&gt;
 $ sudo apt install smartmontools&lt;br /&gt;
 $ sudo smartctl -a /dev/sda              # SMART disk health&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 # Fix broken dependencies&lt;br /&gt;
 sudo apt --fix-broken install&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure packages&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
 # No output means there is nothing to reconfigure&lt;br /&gt;
 &lt;br /&gt;
 # Clean package cache&lt;br /&gt;
 sudo apt clean&lt;br /&gt;
 sudo apt autoclean&lt;br /&gt;
 &lt;br /&gt;
 # Remove unused packages&lt;br /&gt;
 sudo apt autoremove&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 # If apt is locked, find the process holding the lock&lt;br /&gt;
 sudo lsof /var/lib/dpkg/lock-frontend&lt;br /&gt;
 &lt;br /&gt;
 # Remove the lock (use with caution—only if no package manager is running)&lt;br /&gt;
 sudo rm /var/lib/dpkg/lock-frontend&lt;br /&gt;
 sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure dpkg&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
Disk &amp;amp; Filesystem Issues&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 # Check disk space&lt;br /&gt;
 df -h&lt;br /&gt;
 &lt;br /&gt;
 # Check inode usage&lt;br /&gt;
 df -i&lt;br /&gt;
 &lt;br /&gt;
 # View disk I/O statistics&lt;br /&gt;
 # iostat is part of the sysstat package, which also includes:&lt;br /&gt;
 # mpstat (CPU statistics), sar (system activity reporter),&lt;br /&gt;
 # pidstat (process statistics), and cifsiostat (CIFS statistics)&lt;br /&gt;
 sudo apt install sysstat&lt;br /&gt;
 &lt;br /&gt;
 iostat -x 1&lt;br /&gt;
 &lt;br /&gt;
 # Show stats in MB instead of KB&lt;br /&gt;
 iostat -xm 2&lt;br /&gt;
 &lt;br /&gt;
 # Monitor a specific device&lt;br /&gt;
 iostat -x sda 1&lt;br /&gt;
 &lt;br /&gt;
 # Check for disk errors in dmesg&lt;br /&gt;
 sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # SMART disk health (requires smartmontools)&lt;br /&gt;
 sudo apt install smartmontools&lt;br /&gt;
 sudo smartctl -a /dev/sda&lt;br /&gt;
&lt;br /&gt;
=== Repair Filesystem ===&lt;br /&gt;
 # Unmount the partition first&lt;br /&gt;
 sudo umount /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Run filesystem check&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # For ext4 specifically&lt;br /&gt;
 sudo e2fsck -f /dev/sdXN&lt;br /&gt;
Performance Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Resource Hogs ===&lt;br /&gt;
 # CPU usage by process&lt;br /&gt;
 top -o %CPU&lt;br /&gt;
 &lt;br /&gt;
 # Memory usage by process&lt;br /&gt;
 top -o %MEM&lt;br /&gt;
 &lt;br /&gt;
 # Disk usage by directory&lt;br /&gt;
 du -sh /* | sort -h&lt;br /&gt;
 &lt;br /&gt;
 # Find large files&lt;br /&gt;
 find / -type f -size +100M 2&amp;gt;/dev/null&lt;br /&gt;
 &lt;br /&gt;
 # Check running processes sorted by memory use&lt;br /&gt;
 ps aux --sort=-%mem | head -20&lt;br /&gt;
&lt;br /&gt;
=== System Temperature Monitoring ===&lt;br /&gt;
 # Install lm-sensors if not already present&lt;br /&gt;
 sudo apt install lm-sensors&lt;br /&gt;
 sudo sensors-detect&lt;br /&gt;
 &lt;br /&gt;
 # View temperatures&lt;br /&gt;
 sensors&lt;br /&gt;
 &lt;br /&gt;
 # Real-time temperature monitoring&lt;br /&gt;
 watch -n 2 sensors&lt;br /&gt;
See section 12 for a shell alias that makes temperature monitoring more convenient.&lt;br /&gt;
&lt;br /&gt;
Service &amp;amp; Application Errors&lt;br /&gt;
&lt;br /&gt;
=== Debug Service Problems ===&lt;br /&gt;
 # Check service status&lt;br /&gt;
 sudo systemctl status service-name&lt;br /&gt;
 &lt;br /&gt;
 # View service logs&lt;br /&gt;
 sudo journalctl -u service-name&lt;br /&gt;
 &lt;br /&gt;
 # Restart a service&lt;br /&gt;
 sudo systemctl restart service-name&lt;br /&gt;
 &lt;br /&gt;
 # Enable service at boot&lt;br /&gt;
 sudo systemctl enable service-name&lt;br /&gt;
 &lt;br /&gt;
 # View recent service failures&lt;br /&gt;
 journalctl -p err -b&lt;br /&gt;
&lt;br /&gt;
=== Application Crash Investigation ===&lt;br /&gt;
 # Check for core dumps&lt;br /&gt;
 ls -lh /var/crash/&lt;br /&gt;
 &lt;br /&gt;
 # View available application logs&lt;br /&gt;
 ls /var/log/&lt;br /&gt;
 &lt;br /&gt;
 # Follow syslog for application errors in real-time&lt;br /&gt;
 sudo tail -f /var/log/syslog&lt;br /&gt;
Permission &amp;amp; Access Issues&lt;br /&gt;
&lt;br /&gt;
=== Fix Common Permission Problems ===&lt;br /&gt;
 # Check file ownership&lt;br /&gt;
 ls -l /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change ownership (user:group)&lt;br /&gt;
 sudo chown user:group /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change permissions&lt;br /&gt;
 sudo chmod 644 /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Recursively fix permissions on a directory&lt;br /&gt;
 sudo chown -R user:group /path/to/directory&lt;br /&gt;
&lt;br /&gt;
=== User &amp;amp; Authentication Issues ===&lt;br /&gt;
 # Check user information&lt;br /&gt;
 id username&lt;br /&gt;
 &lt;br /&gt;
 # View user login history&lt;br /&gt;
 last -a&lt;br /&gt;
 &lt;br /&gt;
 # Check failed login attempts&lt;br /&gt;
 sudo journalctl | grep &amp;quot;authentication failure&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Reset user password&lt;br /&gt;
 sudo passwd username&lt;br /&gt;
Hardware Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Hardware ===&lt;br /&gt;
 # List all hardware (install if needed: sudo apt install lshw)&lt;br /&gt;
 sudo lshw -short&lt;br /&gt;
 &lt;br /&gt;
 # PCI devices&lt;br /&gt;
 lspci -v&lt;br /&gt;
 &lt;br /&gt;
 # USB devices&lt;br /&gt;
 lsusb -v&lt;br /&gt;
 &lt;br /&gt;
 # CPU information&lt;br /&gt;
 lscpu&lt;br /&gt;
 &lt;br /&gt;
 # Memory information&lt;br /&gt;
 sudo dmidecode --type memory&lt;br /&gt;
&lt;br /&gt;
=== Check Hardware Errors ===&lt;br /&gt;
 # Kernel ring buffer (hardware messages)&lt;br /&gt;
 dmesg | less&lt;br /&gt;
 # Press q to quit&lt;br /&gt;
 &lt;br /&gt;
 # Search for specific hardware issues&lt;br /&gt;
 dmesg | grep -i &amp;quot;error\|fail\|warn&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Check for USB issues&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
Quick Diagnostic Commands&lt;br /&gt;
&lt;br /&gt;
=== System Information at a Glance ===&lt;br /&gt;
 # Uptime and load average&lt;br /&gt;
 uptime&lt;br /&gt;
 &lt;br /&gt;
 # Kernel version&lt;br /&gt;
 uname -r&lt;br /&gt;
 &lt;br /&gt;
 # Debian version&lt;br /&gt;
 cat /etc/debian_version&lt;br /&gt;
 &lt;br /&gt;
 # Full system summary (install if needed: sudo apt install inxi)&lt;br /&gt;
 sudo inxi -Fxz&lt;br /&gt;
&lt;br /&gt;
=== Emergency Toolkit ===&lt;br /&gt;
 # Create a consolidated diagnostic report&lt;br /&gt;
 sudo journalctl -b &amp;gt; ~/system-report.txt&lt;br /&gt;
 dmesg &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 systemctl --failed &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 df -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 free -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 &lt;br /&gt;
 # Watch logs in real-time&lt;br /&gt;
 sudo journalctl -f&lt;br /&gt;
 &lt;br /&gt;
 # Monitor system resources continuously&lt;br /&gt;
 watch -n 1 &#039;free -h &amp;amp;&amp;amp; df -h&#039;&lt;br /&gt;
Useful Aliases &amp;amp; Shortcuts&lt;br /&gt;
Add these to your ~/.bashrc for quick access to common troubleshooting commands:&lt;br /&gt;
 # Monitor system temperatures in real-time&lt;br /&gt;
 alias temps=&amp;quot;watch -n 2 &#039;for i in /sys/class/hwmon/hwmon*/; do echo -n \&amp;quot;\$(cat \${i}name): \&amp;quot;; cat \${i}temp*_input 2&amp;gt;/dev/null | while read temp; do echo \&amp;quot;scale=1; \$temp/1000\&amp;quot; | bc; done | tr \&amp;quot;\n\&amp;quot; \&amp;quot; \&amp;quot;; echo \&amp;quot;°C\&amp;quot;; done&#039;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Quick system status&lt;br /&gt;
 alias sysstat=&#039;echo &amp;quot;=== CPU ===&amp;quot; &amp;amp;&amp;amp; uptime &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Memory ===&amp;quot; &amp;amp;&amp;amp; free -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Disk ===&amp;quot; &amp;amp;&amp;amp; df -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Top Processes ===&amp;quot; &amp;amp;&amp;amp; ps aux --sort=-%mem | head -10&#039;&lt;br /&gt;
 &lt;br /&gt;
 # View last boot logs&lt;br /&gt;
 alias lastboot=&#039;journalctl -b -1&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Check failed services&lt;br /&gt;
 alias failedservices=&#039;systemctl --failed&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Monitor logs in real-time&lt;br /&gt;
 alias watchlog=&#039;sudo journalctl -f&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Quick network status&lt;br /&gt;
 alias netstatus=&#039;ip addr show &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Routes ===&amp;quot; &amp;amp;&amp;amp; ip route show&#039;&lt;br /&gt;
After adding these, reload your shell configuration:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
Tips for Effective Troubleshooting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check logs first.&#039;&#039;&#039; journalctl and dmesg are your best starting point for almost any problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Change one thing at a time.&#039;&#039;&#039; It’s tempting to make several changes at once, but doing so makes it impossible to know what actually fixed—or broke—the problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Document your changes.&#039;&#039;&#039; Keep notes on what you’ve tried and what the results were. You’ll thank yourself later.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use exact error messages.&#039;&#039;&#039; Copy error messages verbatim and search for them alongside “Debian” and the version number—for example, “Debian 13” or “Debian 13.1” for point releases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check what changed recently.&#039;&#039;&#039; Did you install something, update packages, or change the kernel before the problem appeared? Start there.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Back up before making major changes.&#039;&#039;&#039; This goes without saying, but it’s easy to skip when you’re in a hurry.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use verbose mode.&#039;&#039;&#039; Adding -v or -vv flags to commands often reveals what would otherwise be silent failures.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the community.&#039;&#039;&#039; The Debian forums, Reddit, Stack Exchange, and the Debian mailing lists are all active and well-indexed. Someone has usually seen your problem before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by &amp;lt;dfn&amp;gt;distro-nix&amp;lt;/dfn&amp;gt; to the Debian User Forums on 2025-10-27.&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=274</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=274"/>
		<updated>2026-05-15T22:40:47Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: inserting sections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Author&#039;&#039;&#039; &#039;&#039;&#039;Profile:&#039;&#039;&#039; [https://forums.debian.net/memberlist.php?mode=viewprofile&amp;amp;u=239099 distro-nix]  &#039;&#039;&#039;Debian Version:&#039;&#039;&#039; Debian 13 (Trixie) &#039;&#039;&#039;Kernel Versions Tested:&#039;&#039;&#039; 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64 (x86_64) &#039;&#039;&#039;Created:&#039;&#039;&#039; 2025-10-27 &#039;&#039;&#039;Last Updated:&#039;&#039;&#039; 2026-05-15 &#039;&#039;&#039;ID:&#039;&#039;&#039; 544201 &#039;&#039;&#039;License:&#039;&#039;&#039; CC BY-SA 4.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This guide is preserved in its original form. Questions and feedback welcome via the author’s &amp;lt;dfn&amp;gt;Debian Forums profile&amp;lt;/dfn&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The Debian First Aid Kit is a practical reference for diagnosing and resolving common system problems on Debian GNU/Linux. It covers commonly occuring categories of failure: system freezes and crashes, boot problems, network issues, package management, disk and filesystem errors, performance degradation, service and application failures, permission and access problems, hardware identification and errors, and quick diagnostics. Each section gives the relevant commands so you can understand what they do and why, rather than a bare list to copy and paste blindly. A dedicated section covers MTR (Matt’s Traceroute) in depth, including output interpretation, practical troubleshooting, and how to monitor continuously. The guide also includes a set of shell aliases for faster access to common diagnostic tasks. All commands are verified on Debian 13 (Trixie) running kernel 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64. This document is intended for users with basic command-line familiarity who need a reliable, consolidated reference when something goes wrong.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Keywords:&#039;&#039;&#039; Debian, troubleshooting, system administration, MTR, network diagnostics, package management, journalctl, filesystem repair&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tested Commands Disclaimer ==&lt;br /&gt;
All commands in this document have been verified on Debian 13 (Trixie) with the kernel versions listed above. Results may vary on other releases or hardware configurations. Always test in a safe environment before applying any procedure to a production system.&lt;br /&gt;
&lt;br /&gt;
== Conventions Used in This Document ==&lt;br /&gt;
Command examples throughout this guide follow standard Unix prompt conventions. A $ prefix indicates a command run as a regular user. Where elevated privileges are required, sudo is shown explicitly and # with a brief explanation if needed:&lt;br /&gt;
 $ journalctl -b -1          # regular user&lt;br /&gt;
 $ sudo apt install mtr      # requires elevation via sudo&lt;br /&gt;
In recovery shell contexts, where you are operating directly as root, the prompt is #.&lt;br /&gt;
&lt;br /&gt;
== System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics:&#039;&#039;&#039; Search for “kernel panic” or “Oops”&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM):&#039;&#039;&#039; Search for “Out of memory” or “oom-killer”&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors:&#039;&#039;&#039; Look for “MCE” (Machine Check Exception) or “hardware error”&lt;br /&gt;
* &#039;&#039;&#039;Driver issues:&#039;&#039;&#039; Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating:&#039;&#039;&#039; Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 $ free -h                      # memory usage&lt;br /&gt;
&lt;br /&gt;
 $ df -h                        # disk space&lt;br /&gt;
&lt;br /&gt;
 $ htop                         # interactive resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ top                          # alternative resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt install btop        # btop is a more detailed alternative&lt;br /&gt;
&lt;br /&gt;
 $ sudo dmesg | grep -i error   # check for disk errors&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN         # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX  # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub            # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab              # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
The following are permanent errors caused by incomplete or buggy ACPI tables in the BIOS. They are harmless and can be safely ignored if they appear on your system:&lt;br /&gt;
 [0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&lt;br /&gt;
 [0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&lt;br /&gt;
 [0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&lt;br /&gt;
&lt;br /&gt;
== Boot Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Check Boot Process ===&lt;br /&gt;
 $ systemd-analyze blame            # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemd-analyze blame            # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemctl --failed               # units that failed during boot&lt;br /&gt;
&lt;br /&gt;
 $ systemctl status &amp;lt;service-name&amp;gt;  # e.g. systemctl status NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN              # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX       # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub                 # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab                   # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
== Network Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose Network Connection ===&lt;br /&gt;
 $ ip addr show                         # check network interfaces&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 4 8.8.8.8                    # test IPv4 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 6 2a00:1450:4007:809::200e   # test IPv6 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ nslookup google.com                  # check DNS resolution&lt;br /&gt;
&lt;br /&gt;
 $ ip route show                        # view routing table&lt;br /&gt;
&lt;br /&gt;
 $ ss -tuln                             # check active connections &lt;br /&gt;
&lt;br /&gt;
=== Restart Network Service ===&lt;br /&gt;
 $ sudo systemctl restart NetworkManager   # for systems using NetworkManager&lt;br /&gt;
&lt;br /&gt;
 $ sudo systemctl restart networking       # for systems using networking service&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 down              # bring interface down&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 up                # bring interface back up&lt;br /&gt;
&lt;br /&gt;
== MTR (Matt’s Traceroute) ==&lt;br /&gt;
MTR combines the functionality of ping and traceroute into a single real-time network diagnostic tool. It continuously monitors the path between your system and a destination, providing detailed statistics about latency and packet loss at each hop. When you need to demonstrate a network problem that is outside your control—to your hosting provider, for example—MTR gives you the evidence you need.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
 $ sudo apt install mtr&lt;br /&gt;
&lt;br /&gt;
=== Basic Usage ===&lt;br /&gt;
 $ mtr google.com                          # interactive mode&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report google.com                 # report mode (10 cycles then exit)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 50 google.com       # specify number of cycles&lt;br /&gt;
&lt;br /&gt;
 $ mtr --tcp google.com                    # use TCP instead of ICMP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --udp google.com                    # use UDP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --no-dns google.com                 # skip DNS resolution (faster)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --show-ips google.com               # show both hostnames and IPs&lt;br /&gt;
&lt;br /&gt;
== Understanding MTR Output ==&lt;br /&gt;
&lt;br /&gt;
==== Sample Output ====&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    10   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
   4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   5.|-- google.com                 0.0%    10   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
&lt;br /&gt;
=== Column Meanings ===&lt;br /&gt;
&#039;&#039;&#039;HOST&#039;&#039;&#039; — Hostname or IP address of each hop in the route.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loss%&#039;&#039;&#039; — Percentage of packets lost at this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Snt&#039;&#039;&#039; — Number of packets sent to this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last&#039;&#039;&#039; — Latency of the most recent packet, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Avg&#039;&#039;&#039; — Average latency across all packets sent, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best&#039;&#039;&#039; — Lowest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wrst&#039;&#039;&#039; — Highest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StDev&#039;&#039;&#039; — Standard deviation of latency measurements—lower values indicate a more stable connection.&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Results ===&lt;br /&gt;
A healthy network shows 0% loss on all hops, stable latency with low StDev values, a gradual latency increase as hop count increases, and consistent response times.&lt;br /&gt;
&lt;br /&gt;
==== Problem Indicators ====&lt;br /&gt;
&#039;&#039;&#039;1. High Packet Loss at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 5.|-- problem-router.net        25.0%    10   45.3  48.2  42.1  65.8  8.4&lt;br /&gt;
If loss continues to the destination, there is a real problem at that router. If loss appears only at that hop but not beyond, the router is likely rate-limiting ICMP responses—a false positive, not a real problem. The rule of thumb: if packet loss appears at hop N but hops N+1, N+2, and beyond show 0% loss, it’s almost certainly ICMP rate limiting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. High Latency at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 3.|-- slow-link.net              0.0%    10  150.3 155.2 148.1 165.8  5.4&lt;br /&gt;
This indicates a network bottleneck, a congested link, geographical distance (intercontinental hops), or slow routing equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. No Response (???)&#039;&#039;&#039;&lt;br /&gt;
 4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
The router at this hop is configured not to respond to ICMP or traceroute packets, or a firewall is blocking diagnostic packets. This is not necessarily a problem if later hops respond normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. High Jitter (StDev)&#039;&#039;&#039;&lt;br /&gt;
 6.|-- unstable.net               0.0%    10   35.3  52.8  28.1  95.2  24.7&lt;br /&gt;
A high StDev (24.7ms in this example) indicates inconsistent latency caused by network congestion or instability. This is particularly noticeable in real-time applications such as VoIP, gaming, and video calls.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Sudden Latency Spike&#039;&#039;&#039;&lt;br /&gt;
 1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
 2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
 3.|-- problematic-hop.net        0.0%    10  180.5 185.2 178.1 195.8  6.4&lt;br /&gt;
 4.|-- next-hop.net               0.0%    10  182.3 187.8 180.5 198.2  6.8&lt;br /&gt;
Hop 3 introduces approximately 170ms of additional latency (jumping from 9ms to 180ms). Everything from hop 3 onward carries that penalty.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Report Mode with Different Output Formats ====&lt;br /&gt;
 $ mtr --report --csv google.com &amp;gt; network-report.csv    # CSV for logging&lt;br /&gt;
 $ mtr --report --json google.com                        # JSON for parsing&lt;br /&gt;
 $ mtr --report --xml google.com                         # XML format&lt;br /&gt;
 $ mtr --report-wide google.com                          # wide report, no abbreviations&lt;br /&gt;
&lt;br /&gt;
==== Protocol Selection ====&lt;br /&gt;
 $ mtr google.com                                        # ICMP (default)&lt;br /&gt;
 mtr --udp google.com                                    # UDP&lt;br /&gt;
 $ sudo mtr --tcp --port 443 google.com                  # specific TCP port&lt;br /&gt;
 $ sudo mtr --tcp --port 22 remote-server.com&lt;br /&gt;
&lt;br /&gt;
==== Timing and Duration ====&lt;br /&gt;
 $ mtr --interval 0.5 google.com           # interval between pings (default 1s)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 100 google.com      # extended test, 100 cycles&lt;br /&gt;
&lt;br /&gt;
 $ mtr google.com                          # continuous monitoring (Ctrl+C to stop)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 10 google.com       # quick 10-cycle report&lt;br /&gt;
&lt;br /&gt;
==== Advanced Options ====&lt;br /&gt;
 $ mtr --aslookup google.com               # show Autonomous System (AS) numbers&lt;br /&gt;
 $ mtr --max-ttl 20 google.com             # set maximum number of hops&lt;br /&gt;
 $ mtr --psize 1000 google.com             # set packet size&lt;br /&gt;
 $ mtr --show-ips google.com               # show both IP and hostname&lt;br /&gt;
 $ mtr --address 192.168.1.100 google.com  # specify source address&lt;br /&gt;
 $ mtr -4 google.com                       # IPv4 only&lt;br /&gt;
 $ mtr -6 google.com                       # IPv6 only&lt;br /&gt;
&lt;br /&gt;
=== Interactive Mode Commands ===&lt;br /&gt;
When running MTR in interactive mode (mtr hostname), the following keys are available:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;h&#039;&#039;&#039; — Display help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d&#039;&#039;&#039; — Toggle display mode, cycling through different views.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;n&#039;&#039;&#039; — Toggle between hostnames and IP addresses.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;r&#039;&#039;&#039; — Reset all statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;p&#039;&#039;&#039; — Pause/unpause the display.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;q&#039;&#039;&#039; — Quit MTR.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;u&#039;&#039;&#039; — Switch between ICMP, UDP, and TCP modes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;y&#039;&#039;&#039; — Switch between IPv4 and IPv6.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;o&#039;&#039;&#039; — Toggle field display options.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;j&#039;&#039;&#039; — Toggle latency display.&lt;br /&gt;
&lt;br /&gt;
=== Practical Troubleshooting Scenarios ===&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1: Diagnosing a Slow Website ====&lt;br /&gt;
 $ mtr --report-cycles 100 --no-dns example.com&lt;br /&gt;
Look for high average latency at specific hops, packet loss at the destination, and high StDev values indicating jitter.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2: Testing if a Firewall Blocks SSH ====&lt;br /&gt;
 $ sudo mtr --tcp --port 22 --report-cycles 50 remote-server.com&lt;br /&gt;
If the last hop shows 100% loss but earlier hops are fine, port 22 may be filtered. Run a standard ICMP test for comparison.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3: ISP Performance Issues ====&lt;br /&gt;
 $ mtr --report-cycles 100 8.8.8.8&lt;br /&gt;
 &lt;br /&gt;
 $ mtr --report-cycles 100 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If issues appear in the first three or four hops, the problem is likely within your ISP’s network. If issues appear later, the problem lies beyond your ISP.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4: VPN Troubleshooting ====&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; before-vpn.txt   # before VPN&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; after-vpn.txt    # after VPN&lt;br /&gt;
 $ diff before-vpn.txt after-vpn.txt                              # compare the two&lt;br /&gt;
&lt;br /&gt;
==== Scenario 5: Gaming/Streaming Performance ====&lt;br /&gt;
 $ mtr --report-cycles 200 game-server.com&lt;br /&gt;
For real-time applications, look for low average latency (under 50ms for gaming), low StDev (under 5ms preferred), and zero packet loss.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 6: Intermittent Connectivity ====&lt;br /&gt;
 $ mtr --report-cycles 500 --interval 1 target.com &amp;gt; long-test.txt   # long-running test&lt;br /&gt;
&lt;br /&gt;
 $ mtr target.com                                                    # real-time monitoring&lt;br /&gt;
&lt;br /&gt;
=== Continuous Monitoring ===&lt;br /&gt;
&lt;br /&gt;
==== Log Network Performance Over Time ====&lt;br /&gt;
 while true; do&lt;br /&gt;
     timestamp=$(date +%Y%m%d-%H%M%S)&lt;br /&gt;
     mtr --report --report-cycles 50 google.com &amp;gt; &amp;quot;mtr-$timestamp.txt&amp;quot;&lt;br /&gt;
     sleep 3600&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Monitor Multiple Destinations ====&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 echo &amp;quot;=== MTR Report $(date) ===&amp;quot; &amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Google DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 8.8.8.8 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Cloudflare DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 1.1.1.1 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Your Server:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 your-server.com &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
&lt;br /&gt;
=== Useful Aliases for .bashrc ===&lt;br /&gt;
 Quick network path analysis&lt;br /&gt;
 alias mtrreport=&#039;mtr --report --report-cycles 50 --no-dns&#039;&lt;br /&gt;
 &lt;br /&gt;
 Monitor connection to Google DNS&lt;br /&gt;
 alias netcheck=&#039;mtr --report-cycles 20 8.8.8.8&#039;&lt;br /&gt;
 &lt;br /&gt;
 Extended network test&lt;br /&gt;
 alias mtrlong=&#039;mtr --report-cycles 100&#039;&lt;br /&gt;
 &lt;br /&gt;
 TCP port 443 test (HTTPS)&lt;br /&gt;
 alias mtrhttps=&#039;sudo mtr --tcp --port 443 --report-cycles 30&#039;&lt;br /&gt;
 &lt;br /&gt;
 Quick comparison of major DNS providers&lt;br /&gt;
 alias dnstest=&#039;echo &amp;quot;Google:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 8.8.8.8 &amp;amp;&amp;amp; echo -e &amp;quot;\nCloudflare:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 1.1.1.1&#039;&lt;br /&gt;
After adding to ~/.bashrc, reload with:&lt;br /&gt;
 $ source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting Tips ===&lt;br /&gt;
&#039;&#039;&#039;Permission issues with TCP mode:&#039;&#039;&#039;&lt;br /&gt;
 Use sudo for TCP on privileged ports&lt;br /&gt;
 $ sudo mtr --tcp --port 443 example.com&lt;br /&gt;
 &lt;br /&gt;
 Or set capabilities (one-time setup)&lt;br /&gt;
 $ sudo setcap cap_net_raw+ep /usr/bin/mtr-packet&lt;br /&gt;
&#039;&#039;&#039;False positives:&#039;&#039;&#039; Packet loss at an intermediate hop but not at the destination is almost always ICMP rate limiting at that router, not a real problem. Example:&lt;br /&gt;
 3.|-- router.isp.net            20.0%    50   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
 4.|-- next-hop.net               0.0%    50   18.5  19.2  17.8  22.1   1.3&lt;br /&gt;
 5.|-- destination.com            0.0%    50   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
Hop 3 shows 20% loss, but hops 4 and 5 show 0%. Traffic is flowing normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DNS resolution delays:&#039;&#039;&#039; If MTR is slow to start, skip DNS resolution with mtr --no-dns target.com and resolve addresses afterward with host 203.0.113.1 if needed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Comparing results:&#039;&#039;&#039;&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test1.txt&lt;br /&gt;
 $ sleep 60&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test2.txt&lt;br /&gt;
 $ diff test1.txt test2.txt&lt;br /&gt;
&lt;br /&gt;
=== When to Use MTR vs Other Tools ===&lt;br /&gt;
&#039;&#039;&#039;MTR&#039;&#039;&#039; — Best for continuous monitoring, identifying problem hops, and gathering detailed statistics. Requires installation via apt.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ping&#039;&#039;&#039; — Best for a quick connectivity test or simple latency check. Only tests the endpoint, not the path.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;traceroute&#039;&#039;&#039; — Best for one-time path discovery. Provides no continuous monitoring.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ss / netstat&#039;&#039;&#039; — Best for checking local connection status. Doesn’t test remote paths.&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
Run at least 50–100 cycles for accurate statistics. Use --no-dns for faster results and to avoid DNS resolution issues during testing. Test at different times of day, since network conditions vary. If one protocol shows issues, compare ICMP, UDP, and TCP modes. Save reports with timestamps for trend analysis. Use 8.8.8.8 or 1.1.1.1 as known-good hosts to verify your local network first. Let MTR run for at least 30–60 seconds before drawing conclusions.&lt;br /&gt;
&lt;br /&gt;
=== Reading Between the Lines ===&lt;br /&gt;
&#039;&#039;&#039;Good network health:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.1   1.2   0.9   2.1   0.2&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    50    8.2   8.5   7.5  10.2   0.5&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    50   15.1  15.5  14.0  18.3   0.8&lt;br /&gt;
   4.|-- google.com                 0.0%    50   24.8  25.2  23.5  28.1   1.1&lt;br /&gt;
No packet loss, consistent latency, low jitter throughout.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problematic network:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.2   1.5   1.0   2.3   0.3&lt;br /&gt;
   2.|-- 10.0.0.1                   5.0%    50   45.3  52.8  8.1  245.2  45.7&lt;br /&gt;
   3.|-- ???                       100.0%   50    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   4.|-- destination.com           15.0%    50   95.4 125.8  48.2 385.5  78.2&lt;br /&gt;
Packet loss at hop 2 and the destination, high jitter, and a very high worst-case latency all point to a genuine problem at or near hop 2.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
MTR is your friend when it comes to diagnostics. Use --report-cycles 50 or higher for reliable data. Watch for packet loss at the destination—intermediate losses may be false positives. High StDev indicates an unstable connection. High average latency points to slow links. Use --no-dns for faster results. Compare ICMP, UDP, and TCP modes if issues appear. Test at different times of day for a complete picture.&lt;br /&gt;
== Package Management Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Fix Broken Packages ===&lt;br /&gt;
 $ sudo apt update                     # update package lists&lt;br /&gt;
 $ sudo apt --fix-broken install       # fix broken dependencies&lt;br /&gt;
 $ sudo dpkg --configure -a            # reconfigure packages (no output = nothing to do)&lt;br /&gt;
 $ sudo apt clean                      # clean package cache&lt;br /&gt;
 $ sudo apt autoclean&lt;br /&gt;
 $ sudo apt autoremove                 # remove unused packages&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 $ sudo lsof /var/lib/dpkg/lock-frontend        # find process holding the lock&lt;br /&gt;
 $ sudo rm /var/lib/dpkg/lock-frontend          # remove lock (only if no package manager is running)&lt;br /&gt;
 $ sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 $ sudo dpkg --configure -a                     # reconfigure dpkg&lt;br /&gt;
&lt;br /&gt;
== Disk &amp;amp; Filesystem Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 $ df -h                                  # disk space&lt;br /&gt;
 $ df -i                                  # inode usage&lt;br /&gt;
 $ sudo apt install sysstat               # sysstat includes iostat, mpstat, sar, pidstat, cifsiostat&lt;br /&gt;
 $ iostat -x 1                            # disk I/O statistics&lt;br /&gt;
 $ iostat -xm 2                           # stats in MB instead of KB&lt;br /&gt;
 $ iostat -x sda 1                        # monitor a specific device&lt;br /&gt;
 $ sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;     # check for disk errors&lt;br /&gt;
 $ sudo apt install smartmontools&lt;br /&gt;
&lt;br /&gt;
 $ sudo smartctl -a /dev/sda              # SMART disk health&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 # Fix broken dependencies&lt;br /&gt;
 sudo apt --fix-broken install&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure packages&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
 # No output means there is nothing to reconfigure&lt;br /&gt;
 &lt;br /&gt;
 # Clean package cache&lt;br /&gt;
 sudo apt clean&lt;br /&gt;
 sudo apt autoclean&lt;br /&gt;
 &lt;br /&gt;
 # Remove unused packages&lt;br /&gt;
 sudo apt autoremove&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 # If apt is locked, find the process holding the lock&lt;br /&gt;
 sudo lsof /var/lib/dpkg/lock-frontend&lt;br /&gt;
 &lt;br /&gt;
 # Remove the lock (use with caution—only if no package manager is running)&lt;br /&gt;
 sudo rm /var/lib/dpkg/lock-frontend&lt;br /&gt;
 sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure dpkg&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
Disk &amp;amp; Filesystem Issues&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 # Check disk space&lt;br /&gt;
 df -h&lt;br /&gt;
 &lt;br /&gt;
 # Check inode usage&lt;br /&gt;
 df -i&lt;br /&gt;
 &lt;br /&gt;
 # View disk I/O statistics&lt;br /&gt;
 # iostat is part of the sysstat package, which also includes:&lt;br /&gt;
 # mpstat (CPU statistics), sar (system activity reporter),&lt;br /&gt;
 # pidstat (process statistics), and cifsiostat (CIFS statistics)&lt;br /&gt;
 sudo apt install sysstat&lt;br /&gt;
 &lt;br /&gt;
 iostat -x 1&lt;br /&gt;
 &lt;br /&gt;
 # Show stats in MB instead of KB&lt;br /&gt;
 iostat -xm 2&lt;br /&gt;
 &lt;br /&gt;
 # Monitor a specific device&lt;br /&gt;
 iostat -x sda 1&lt;br /&gt;
 &lt;br /&gt;
 # Check for disk errors in dmesg&lt;br /&gt;
 sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # SMART disk health (requires smartmontools)&lt;br /&gt;
 sudo apt install smartmontools&lt;br /&gt;
 sudo smartctl -a /dev/sda&lt;br /&gt;
&lt;br /&gt;
=== Repair Filesystem ===&lt;br /&gt;
 # Unmount the partition first&lt;br /&gt;
 sudo umount /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Run filesystem check&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # For ext4 specifically&lt;br /&gt;
 sudo e2fsck -f /dev/sdXN&lt;br /&gt;
Performance Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Resource Hogs ===&lt;br /&gt;
 # CPU usage by process&lt;br /&gt;
 top -o %CPU&lt;br /&gt;
 &lt;br /&gt;
 # Memory usage by process&lt;br /&gt;
 top -o %MEM&lt;br /&gt;
 &lt;br /&gt;
 # Disk usage by directory&lt;br /&gt;
 du -sh /* | sort -h&lt;br /&gt;
 &lt;br /&gt;
 # Find large files&lt;br /&gt;
 find / -type f -size +100M 2&amp;gt;/dev/null&lt;br /&gt;
 &lt;br /&gt;
 # Check running processes sorted by memory use&lt;br /&gt;
 ps aux --sort=-%mem | head -20&lt;br /&gt;
&lt;br /&gt;
=== System Temperature Monitoring ===&lt;br /&gt;
 # Install lm-sensors if not already present&lt;br /&gt;
 sudo apt install lm-sensors&lt;br /&gt;
 sudo sensors-detect&lt;br /&gt;
 &lt;br /&gt;
 # View temperatures&lt;br /&gt;
 sensors&lt;br /&gt;
 &lt;br /&gt;
 # Real-time temperature monitoring&lt;br /&gt;
 watch -n 2 sensors&lt;br /&gt;
See section 12 for a shell alias that makes temperature monitoring more convenient.&lt;br /&gt;
&lt;br /&gt;
Service &amp;amp; Application Errors&lt;br /&gt;
&lt;br /&gt;
=== Debug Service Problems ===&lt;br /&gt;
 # Check service status&lt;br /&gt;
 sudo systemctl status service-name&lt;br /&gt;
 &lt;br /&gt;
 # View service logs&lt;br /&gt;
 sudo journalctl -u service-name&lt;br /&gt;
 &lt;br /&gt;
 # Restart a service&lt;br /&gt;
 sudo systemctl restart service-name&lt;br /&gt;
 &lt;br /&gt;
 # Enable service at boot&lt;br /&gt;
 sudo systemctl enable service-name&lt;br /&gt;
 &lt;br /&gt;
 # View recent service failures&lt;br /&gt;
 journalctl -p err -b&lt;br /&gt;
&lt;br /&gt;
=== Application Crash Investigation ===&lt;br /&gt;
 # Check for core dumps&lt;br /&gt;
 ls -lh /var/crash/&lt;br /&gt;
 &lt;br /&gt;
 # View available application logs&lt;br /&gt;
 ls /var/log/&lt;br /&gt;
 &lt;br /&gt;
 # Follow syslog for application errors in real-time&lt;br /&gt;
 sudo tail -f /var/log/syslog&lt;br /&gt;
Permission &amp;amp; Access Issues&lt;br /&gt;
&lt;br /&gt;
=== Fix Common Permission Problems ===&lt;br /&gt;
 # Check file ownership&lt;br /&gt;
 ls -l /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change ownership (user:group)&lt;br /&gt;
 sudo chown user:group /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change permissions&lt;br /&gt;
 sudo chmod 644 /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Recursively fix permissions on a directory&lt;br /&gt;
 sudo chown -R user:group /path/to/directory&lt;br /&gt;
&lt;br /&gt;
=== User &amp;amp; Authentication Issues ===&lt;br /&gt;
 # Check user information&lt;br /&gt;
 id username&lt;br /&gt;
 &lt;br /&gt;
 # View user login history&lt;br /&gt;
 last -a&lt;br /&gt;
 &lt;br /&gt;
 # Check failed login attempts&lt;br /&gt;
 sudo journalctl | grep &amp;quot;authentication failure&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Reset user password&lt;br /&gt;
 sudo passwd username&lt;br /&gt;
Hardware Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Hardware ===&lt;br /&gt;
 # List all hardware (install if needed: sudo apt install lshw)&lt;br /&gt;
 sudo lshw -short&lt;br /&gt;
 &lt;br /&gt;
 # PCI devices&lt;br /&gt;
 lspci -v&lt;br /&gt;
 &lt;br /&gt;
 # USB devices&lt;br /&gt;
 lsusb -v&lt;br /&gt;
 &lt;br /&gt;
 # CPU information&lt;br /&gt;
 lscpu&lt;br /&gt;
 &lt;br /&gt;
 # Memory information&lt;br /&gt;
 sudo dmidecode --type memory&lt;br /&gt;
&lt;br /&gt;
=== Check Hardware Errors ===&lt;br /&gt;
 # Kernel ring buffer (hardware messages)&lt;br /&gt;
 dmesg | less&lt;br /&gt;
 # Press q to quit&lt;br /&gt;
 &lt;br /&gt;
 # Search for specific hardware issues&lt;br /&gt;
 dmesg | grep -i &amp;quot;error\|fail\|warn&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Check for USB issues&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
Quick Diagnostic Commands&lt;br /&gt;
&lt;br /&gt;
=== System Information at a Glance ===&lt;br /&gt;
 # Uptime and load average&lt;br /&gt;
 uptime&lt;br /&gt;
 &lt;br /&gt;
 # Kernel version&lt;br /&gt;
 uname -r&lt;br /&gt;
 &lt;br /&gt;
 # Debian version&lt;br /&gt;
 cat /etc/debian_version&lt;br /&gt;
 &lt;br /&gt;
 # Full system summary (install if needed: sudo apt install inxi)&lt;br /&gt;
 sudo inxi -Fxz&lt;br /&gt;
&lt;br /&gt;
=== Emergency Toolkit ===&lt;br /&gt;
 # Create a consolidated diagnostic report&lt;br /&gt;
 sudo journalctl -b &amp;gt; ~/system-report.txt&lt;br /&gt;
 dmesg &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 systemctl --failed &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 df -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 free -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 &lt;br /&gt;
 # Watch logs in real-time&lt;br /&gt;
 sudo journalctl -f&lt;br /&gt;
 &lt;br /&gt;
 # Monitor system resources continuously&lt;br /&gt;
 watch -n 1 &#039;free -h &amp;amp;&amp;amp; df -h&#039;&lt;br /&gt;
Useful Aliases &amp;amp; Shortcuts&lt;br /&gt;
Add these to your ~/.bashrc for quick access to common troubleshooting commands:&lt;br /&gt;
 # Monitor system temperatures in real-time&lt;br /&gt;
 alias temps=&amp;quot;watch -n 2 &#039;for i in /sys/class/hwmon/hwmon*/; do echo -n \&amp;quot;\$(cat \${i}name): \&amp;quot;; cat \${i}temp*_input 2&amp;gt;/dev/null | while read temp; do echo \&amp;quot;scale=1; \$temp/1000\&amp;quot; | bc; done | tr \&amp;quot;\n\&amp;quot; \&amp;quot; \&amp;quot;; echo \&amp;quot;°C\&amp;quot;; done&#039;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Quick system status&lt;br /&gt;
 alias sysstat=&#039;echo &amp;quot;=== CPU ===&amp;quot; &amp;amp;&amp;amp; uptime &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Memory ===&amp;quot; &amp;amp;&amp;amp; free -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Disk ===&amp;quot; &amp;amp;&amp;amp; df -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Top Processes ===&amp;quot; &amp;amp;&amp;amp; ps aux --sort=-%mem | head -10&#039;&lt;br /&gt;
 &lt;br /&gt;
 # View last boot logs&lt;br /&gt;
 alias lastboot=&#039;journalctl -b -1&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Check failed services&lt;br /&gt;
 alias failedservices=&#039;systemctl --failed&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Monitor logs in real-time&lt;br /&gt;
 alias watchlog=&#039;sudo journalctl -f&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Quick network status&lt;br /&gt;
 alias netstatus=&#039;ip addr show &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Routes ===&amp;quot; &amp;amp;&amp;amp; ip route show&#039;&lt;br /&gt;
After adding these, reload your shell configuration:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
Tips for Effective Troubleshooting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check logs first.&#039;&#039;&#039; journalctl and dmesg are your best starting point for almost any problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Change one thing at a time.&#039;&#039;&#039; It’s tempting to make several changes at once, but doing so makes it impossible to know what actually fixed—or broke—the problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Document your changes.&#039;&#039;&#039; Keep notes on what you’ve tried and what the results were. You’ll thank yourself later.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use exact error messages.&#039;&#039;&#039; Copy error messages verbatim and search for them alongside “Debian” and the version number—for example, “Debian 13” or “Debian 13.1” for point releases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check what changed recently.&#039;&#039;&#039; Did you install something, update packages, or change the kernel before the problem appeared? Start there.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Back up before making major changes.&#039;&#039;&#039; This goes without saying, but it’s easy to skip when you’re in a hurry.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use verbose mode.&#039;&#039;&#039; Adding -v or -vv flags to commands often reveals what would otherwise be silent failures.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the community.&#039;&#039;&#039; The Debian forums, Reddit, Stack Exchange, and the Debian mailing lists are all active and well-indexed. Someone has usually seen your problem before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by &amp;lt;dfn&amp;gt;distro-nix&amp;lt;/dfn&amp;gt; to the Debian User Forums on 2025-10-27.&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=273</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=273"/>
		<updated>2026-05-15T22:22:25Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Author&#039;&#039;&#039; &#039;&#039;&#039;Profile:&#039;&#039;&#039; [https://forums.debian.net/memberlist.php?mode=viewprofile&amp;amp;u=239099 distro-nix]  &#039;&#039;&#039;Debian Version:&#039;&#039;&#039; Debian 13 (Trixie) &#039;&#039;&#039;Kernel Versions Tested:&#039;&#039;&#039; 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64 (x86_64) &#039;&#039;&#039;Created:&#039;&#039;&#039; 2025-10-27 &#039;&#039;&#039;Last Updated:&#039;&#039;&#039; 2026-05-15 &#039;&#039;&#039;ID:&#039;&#039;&#039; 544201 &#039;&#039;&#039;License:&#039;&#039;&#039; CC BY-SA 4.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This guide is preserved in its original form. Questions and feedback welcome via the author’s &amp;lt;dfn&amp;gt;Debian Forums profile&amp;lt;/dfn&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The Debian First Aid Kit is a practical reference for diagnosing and resolving common system problems on Debian GNU/Linux. It covers commonly occuring categories of failure: system freezes and crashes, boot problems, network issues, package management, disk and filesystem errors, performance degradation, service and application failures, permission and access problems, hardware identification and errors, and quick diagnostics. Each section gives the relevant commands so you can understand what they do and why, rather than a bare list to copy and paste blindly. A dedicated section covers MTR (Matt’s Traceroute) in depth, including output interpretation, practical troubleshooting, and how to monitor continuously. The guide also includes a set of shell aliases for faster access to common diagnostic tasks. All commands are verified on Debian 13 (Trixie) running kernel 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64. This document is intended for users with basic command-line familiarity who need a reliable, consolidated reference when something goes wrong.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Keywords:&#039;&#039;&#039; Debian, troubleshooting, system administration, MTR, network diagnostics, package management, journalctl, filesystem repair&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tested Commands Disclaimer ==&lt;br /&gt;
All commands in this document have been verified on Debian 13 (Trixie) with the kernel versions listed above. Results may vary on other releases or hardware configurations. Always test in a safe environment before applying any procedure to a production system.&lt;br /&gt;
&lt;br /&gt;
== Conventions Used in This Document ==&lt;br /&gt;
Command examples throughout this guide follow standard Unix prompt conventions. A $ prefix indicates a command run as a regular user. Where elevated privileges are required, sudo is shown explicitly and # with a brief explanation if needed:&lt;br /&gt;
 $ journalctl -b -1          # regular user&lt;br /&gt;
 $ sudo apt install mtr      # requires elevation via sudo&lt;br /&gt;
In recovery shell contexts, where you are operating directly as root, the prompt is #.&lt;br /&gt;
&lt;br /&gt;
== System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics:&#039;&#039;&#039; Search for “kernel panic” or “Oops”&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM):&#039;&#039;&#039; Search for “Out of memory” or “oom-killer”&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors:&#039;&#039;&#039; Look for “MCE” (Machine Check Exception) or “hardware error”&lt;br /&gt;
* &#039;&#039;&#039;Driver issues:&#039;&#039;&#039; Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating:&#039;&#039;&#039; Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 $ free -h                      # memory usage&lt;br /&gt;
&lt;br /&gt;
 $ df -h                        # disk space&lt;br /&gt;
&lt;br /&gt;
 $ htop                         # interactive resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ top                          # alternative resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt install btop        # btop is a more detailed alternative&lt;br /&gt;
&lt;br /&gt;
 $ sudo dmesg | grep -i error   # check for disk errors&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN         # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX  # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub            # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab              # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
The following are permanent errors caused by incomplete or buggy ACPI tables in the BIOS. They are harmless and can be safely ignored if they appear on your system:&lt;br /&gt;
 [0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&lt;br /&gt;
 [0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&lt;br /&gt;
 [0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&lt;br /&gt;
&lt;br /&gt;
== Boot Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Check Boot Process ===&lt;br /&gt;
 $ systemd-analyze blame            # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemd-analyze blame            # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemctl --failed               # units that failed during boot&lt;br /&gt;
&lt;br /&gt;
 $ systemctl status &amp;lt;service-name&amp;gt;  # e.g. systemctl status NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN              # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX       # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub                 # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab                   # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
== Network Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose Network Connection ===&lt;br /&gt;
 $ ip addr show                         # check network interfaces&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 4 8.8.8.8                    # test IPv4 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 6 2a00:1450:4007:809::200e   # test IPv6 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ nslookup google.com                  # check DNS resolution&lt;br /&gt;
&lt;br /&gt;
 $ ip route show                        # view routing table&lt;br /&gt;
&lt;br /&gt;
 $ ss -tuln                             # check active connections &lt;br /&gt;
&lt;br /&gt;
=== Restart Network Service ===&lt;br /&gt;
 $ sudo systemctl restart NetworkManager   # for systems using NetworkManager&lt;br /&gt;
&lt;br /&gt;
 $ sudo systemctl restart networking       # for systems using networking service&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 down              # bring interface down&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 up                # bring interface back up&lt;br /&gt;
&lt;br /&gt;
== MTR (Matt’s Traceroute) ==&lt;br /&gt;
MTR combines the functionality of ping and traceroute into a single real-time network diagnostic tool. It continuously monitors the path between your system and a destination, providing detailed statistics about latency and packet loss at each hop. When you need to demonstrate a network problem that is outside your control—to your hosting provider, for example—MTR gives you the evidence you need.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
 $ sudo apt install mtr&lt;br /&gt;
&lt;br /&gt;
=== Basic Usage ===&lt;br /&gt;
 $ mtr google.com                          # interactive mode&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report google.com                 # report mode (10 cycles then exit)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 50 google.com       # specify number of cycles&lt;br /&gt;
&lt;br /&gt;
 $ mtr --tcp google.com                    # use TCP instead of ICMP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --udp google.com                    # use UDP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --no-dns google.com                 # skip DNS resolution (faster)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --show-ips google.com               # show both hostnames and IPs&lt;br /&gt;
&lt;br /&gt;
== Understanding MTR Output ==&lt;br /&gt;
&lt;br /&gt;
==== Sample Output ====&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    10   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
   4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   5.|-- google.com                 0.0%    10   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
&lt;br /&gt;
=== Column Meanings ===&lt;br /&gt;
&#039;&#039;&#039;HOST&#039;&#039;&#039; — Hostname or IP address of each hop in the route.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loss%&#039;&#039;&#039; — Percentage of packets lost at this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Snt&#039;&#039;&#039; — Number of packets sent to this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last&#039;&#039;&#039; — Latency of the most recent packet, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Avg&#039;&#039;&#039; — Average latency across all packets sent, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best&#039;&#039;&#039; — Lowest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wrst&#039;&#039;&#039; — Highest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StDev&#039;&#039;&#039; — Standard deviation of latency measurements—lower values indicate a more stable connection.&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Results ===&lt;br /&gt;
A healthy network shows 0% loss on all hops, stable latency with low StDev values, a gradual latency increase as hop count increases, and consistent response times.&lt;br /&gt;
&lt;br /&gt;
==== Problem Indicators ====&lt;br /&gt;
&#039;&#039;&#039;1. High Packet Loss at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 5.|-- problem-router.net        25.0%    10   45.3  48.2  42.1  65.8  8.4&lt;br /&gt;
If loss continues to the destination, there is a real problem at that router. If loss appears only at that hop but not beyond, the router is likely rate-limiting ICMP responses—a false positive, not a real problem. The rule of thumb: if packet loss appears at hop N but hops N+1, N+2, and beyond show 0% loss, it’s almost certainly ICMP rate limiting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. High Latency at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 3.|-- slow-link.net              0.0%    10  150.3 155.2 148.1 165.8  5.4&lt;br /&gt;
This indicates a network bottleneck, a congested link, geographical distance (intercontinental hops), or slow routing equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. No Response (???)&#039;&#039;&#039;&lt;br /&gt;
 4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
The router at this hop is configured not to respond to ICMP or traceroute packets, or a firewall is blocking diagnostic packets. This is not necessarily a problem if later hops respond normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. High Jitter (StDev)&#039;&#039;&#039;&lt;br /&gt;
 6.|-- unstable.net               0.0%    10   35.3  52.8  28.1  95.2  24.7&lt;br /&gt;
A high StDev (24.7ms in this example) indicates inconsistent latency caused by network congestion or instability. This is particularly noticeable in real-time applications such as VoIP, gaming, and video calls.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Sudden Latency Spike&#039;&#039;&#039;&lt;br /&gt;
 1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
 2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
 3.|-- problematic-hop.net        0.0%    10  180.5 185.2 178.1 195.8  6.4&lt;br /&gt;
 4.|-- next-hop.net               0.0%    10  182.3 187.8 180.5 198.2  6.8&lt;br /&gt;
Hop 3 introduces approximately 170ms of additional latency (jumping from 9ms to 180ms). Everything from hop 3 onward carries that penalty.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Report Mode with Different Output Formats ====&lt;br /&gt;
 $ mtr --report --csv google.com &amp;gt; network-report.csv    # CSV for logging&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report --json google.com                        # JSON for parsing&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report --xml google.com                         # XML format&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-wide google.com                          # wide report, no abbreviations&lt;br /&gt;
&lt;br /&gt;
==== Protocol Selection ====&lt;br /&gt;
 $ mtr google.com                                        # ICMP (default)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --udp google.com                                  # UDP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --tcp google.com                                  # TCP&lt;br /&gt;
&lt;br /&gt;
 $ sudo mtr --tcp --port 443 google.com                  # specific TCP port&lt;br /&gt;
&lt;br /&gt;
 $ sudo mtr --tcp --port 22 remote-server.com            # default TCP port&lt;br /&gt;
&lt;br /&gt;
==== Timing and Duration ====&lt;br /&gt;
 $ mtr --interval 0.5 google.com           # interval between pings (default 1s)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 100 google.com      # extended test, 100 cycles&lt;br /&gt;
&lt;br /&gt;
 $ mtr google.com                          # continuous monitoring (Ctrl+C to stop)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 10 google.com       # quick 10-cycle report&lt;br /&gt;
&lt;br /&gt;
==== Advanced Options ====&lt;br /&gt;
 $ mtr --aslookup google.com               # show Autonomous System (AS) numbers&lt;br /&gt;
&lt;br /&gt;
 $ mtr --max-ttl 20 google.com             # set maximum number of hops&lt;br /&gt;
&lt;br /&gt;
 $ mtr --psize 1000 google.com             # set packet size&lt;br /&gt;
&lt;br /&gt;
 $ mtr --show-ips google.com               # show both IP and hostname&lt;br /&gt;
&lt;br /&gt;
 $ mtr --address 192.168.1.100 google.com  # specify source address&lt;br /&gt;
&lt;br /&gt;
 $ mtr -4 google.com                       # IPv4 only&lt;br /&gt;
&lt;br /&gt;
 $ mtr -6 google.com                       # IPv6 only&lt;br /&gt;
&lt;br /&gt;
=== Interactive Mode Commands ===&lt;br /&gt;
When running MTR in interactive mode (mtr hostname), the following keys are available:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;h&#039;&#039;&#039; — Display help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d&#039;&#039;&#039; — Toggle display mode, cycling through different views.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;n&#039;&#039;&#039; — Toggle between hostnames and IP addresses.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;r&#039;&#039;&#039; — Reset all statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;p&#039;&#039;&#039; — Pause/unpause the display.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;q&#039;&#039;&#039; — Quit MTR.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;u&#039;&#039;&#039; — Switch between ICMP, UDP, and TCP modes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;y&#039;&#039;&#039; — Switch between IPv4 and IPv6.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;o&#039;&#039;&#039; — Toggle field display options.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;j&#039;&#039;&#039; — Toggle latency display.&lt;br /&gt;
&lt;br /&gt;
=== Practical Troubleshooting Scenarios ===&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1: Diagnosing a Slow Website ====&lt;br /&gt;
 $ mtr --report-cycles 100 --no-dns example.com&lt;br /&gt;
Look for high average latency at specific hops, packet loss at the destination, and high StDev values indicating jitter.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2: Testing if a Firewall Blocks SSH ====&lt;br /&gt;
 $ sudo mtr --tcp --port 22 --report-cycles 50 remote-server.com&lt;br /&gt;
If the last hop shows 100% loss but earlier hops are fine, port 22 may be filtered. Run a standard ICMP test for comparison.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3: ISP Performance Issues ====&lt;br /&gt;
 $ mtr --report-cycles 100 8.8.8.8&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 100 1.1.1.1&lt;br /&gt;
If issues appear in the first three or four hops, the problem is likely within your ISP’s network. If issues appear later, the problem lies beyond your ISP.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4: VPN Troubleshooting ====&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; before-vpn.txt   # before VPN&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; after-vpn.txt    # after VPN&lt;br /&gt;
&lt;br /&gt;
 $ diff before-vpn.txt after-vpn.txt                              # compare the two&lt;br /&gt;
&lt;br /&gt;
==== Scenario 5: Gaming/Streaming Performance ====&lt;br /&gt;
 $ mtr --report-cycles 200 game-server.com&lt;br /&gt;
For real-time applications, look for low average latency (under 50ms for gaming), low StDev (under 5ms preferred), and zero packet loss.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 6: Intermittent Connectivity ====&lt;br /&gt;
 $ mtr --report-cycles 500 --interval 1 target.com &amp;gt; long-test.txt   # long-running test&lt;br /&gt;
&lt;br /&gt;
 $ mtr target.com                                                    # real-time monitoring&lt;br /&gt;
&lt;br /&gt;
=== Continuous Monitoring ===&lt;br /&gt;
&lt;br /&gt;
==== Log Network Performance Over Time ====&lt;br /&gt;
 while true; do&lt;br /&gt;
     timestamp=$(date +%Y%m%d-%H%M%S)&lt;br /&gt;
     mtr --report --report-cycles 50 google.com &amp;gt; &amp;quot;mtr-$timestamp.txt&amp;quot;&lt;br /&gt;
     sleep 3600&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Monitor Multiple Destinations ====&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 echo &amp;quot;=== MTR Report $(date) ===&amp;quot; &amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Google DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 8.8.8.8 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Cloudflare DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 1.1.1.1 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Your Server:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 your-server.com &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
&lt;br /&gt;
=== Useful Aliases for .bashrc ===&lt;br /&gt;
 Quick network path analysis&lt;br /&gt;
 alias mtrreport=&#039;mtr --report --report-cycles 50 --no-dns&#039;&lt;br /&gt;
 &lt;br /&gt;
 Monitor connection to Google DNS&lt;br /&gt;
 alias netcheck=&#039;mtr --report-cycles 20 8.8.8.8&#039;&lt;br /&gt;
 &lt;br /&gt;
 Extended network test&lt;br /&gt;
 alias mtrlong=&#039;mtr --report-cycles 100&#039;&lt;br /&gt;
 &lt;br /&gt;
 TCP port 443 test (HTTPS)&lt;br /&gt;
 alias mtrhttps=&#039;sudo mtr --tcp --port 443 --report-cycles 30&#039;&lt;br /&gt;
 &lt;br /&gt;
 Quick comparison of major DNS providers&lt;br /&gt;
 alias dnstest=&#039;echo &amp;quot;Google:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 8.8.8.8 &amp;amp;&amp;amp; echo -e &amp;quot;\nCloudflare:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 1.1.1.1&#039;&lt;br /&gt;
After adding to ~/.bashrc, reload with:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting Tips ===&lt;br /&gt;
&#039;&#039;&#039;Permission issues with TCP mode:&#039;&#039;&#039;&lt;br /&gt;
 Use sudo for TCP on privileged ports&lt;br /&gt;
 $ sudo mtr --tcp --port 443 example.com&lt;br /&gt;
 &lt;br /&gt;
 Or set capabilities (one-time setup)&lt;br /&gt;
 $ sudo setcap cap_net_raw+ep /usr/bin/mtr-packet&lt;br /&gt;
&#039;&#039;&#039;False positives:&#039;&#039;&#039; Packet loss at an intermediate hop but not at the destination is almost always ICMP rate limiting at that router, not a real problem. Example:&lt;br /&gt;
 3.|-- router.isp.net            20.0%    50   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
 4.|-- next-hop.net               0.0%    50   18.5  19.2  17.8  22.1   1.3&lt;br /&gt;
 5.|-- destination.com            0.0%    50   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
Hop 3 shows 20% loss, but hops 4 and 5 show 0%. Traffic is flowing normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DNS resolution delays:&#039;&#039;&#039; If MTR is slow to start, skip DNS resolution with mtr --no-dns target.com and resolve addresses afterward with host 203.0.113.1 if needed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Comparing results:&#039;&#039;&#039;&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test1.txt&lt;br /&gt;
 $ sleep 60&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test2.txt&lt;br /&gt;
 $ diff test1.txt test2.txt&lt;br /&gt;
&lt;br /&gt;
=== When to Use MTR vs Other Tools ===&lt;br /&gt;
&#039;&#039;&#039;MTR&#039;&#039;&#039; — Best for continuous monitoring, identifying problem hops, and gathering detailed statistics. Requires installation via apt.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ping&#039;&#039;&#039; — Best for a quick connectivity test or simple latency check. Only tests the endpoint, not the path.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;traceroute&#039;&#039;&#039; — Best for one-time path discovery. Provides no continuous monitoring.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ss / netstat&#039;&#039;&#039; — Best for checking local connection status. Doesn’t test remote paths.&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
Run at least 50–100 cycles for accurate statistics. Use --no-dns for faster results and to avoid DNS resolution issues during testing. Test at different times of day, since network conditions vary. If one protocol shows issues, compare ICMP, UDP, and TCP modes. Save reports with timestamps for trend analysis. Use 8.8.8.8 or 1.1.1.1 as known-good hosts to verify your local network first. Let MTR run for at least 30–60 seconds before drawing conclusions.&lt;br /&gt;
&lt;br /&gt;
=== Reading Between the Lines ===&lt;br /&gt;
&#039;&#039;&#039;Good network health:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.1   1.2   0.9   2.1   0.2&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    50    8.2   8.5   7.5  10.2   0.5&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    50   15.1  15.5  14.0  18.3   0.8&lt;br /&gt;
   4.|-- google.com                 0.0%    50   24.8  25.2  23.5  28.1   1.1&lt;br /&gt;
No packet loss, consistent latency, low jitter throughout.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problematic network:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.2   1.5   1.0   2.3   0.3&lt;br /&gt;
   2.|-- 10.0.0.1                   5.0%    50   45.3  52.8  8.1  245.2  45.7&lt;br /&gt;
   3.|-- ???                       100.0%   50    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   4.|-- destination.com           15.0%    50   95.4 125.8  48.2 385.5  78.2&lt;br /&gt;
Packet loss at hop 2 and the destination, high jitter, and a very high worst-case latency all point to a genuine problem at or near hop 2.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
MTR is your friend when it comes to diagnostics. Use --report-cycles 50 or higher for reliable data. Watch for packet loss at the destination—intermediate losses may be false positives. High StDev indicates an unstable connection. High average latency points to slow links. Use --no-dns for faster results. Compare ICMP, UDP, and TCP modes if issues appear. Test at different times of day for a complete picture.&lt;br /&gt;
== Package Management Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Fix Broken Packages ===&lt;br /&gt;
 $ sudo apt update                     # update package lists&lt;br /&gt;
 $ sudo apt --fix-broken install       # fix broken dependencies&lt;br /&gt;
 $ sudo dpkg --configure -a            # reconfigure packages (no output = nothing to do)&lt;br /&gt;
 $ sudo apt clean                      # clean package cache&lt;br /&gt;
 $ sudo apt autoclean&lt;br /&gt;
 $ sudo apt autoremove                 # remove unused packages&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # Fix broken dependencies&lt;br /&gt;
 sudo apt --fix-broken install&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure packages&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
 # No output means there is nothing to reconfigure&lt;br /&gt;
 &lt;br /&gt;
 # Clean package cache&lt;br /&gt;
 sudo apt clean&lt;br /&gt;
 sudo apt autoclean&lt;br /&gt;
 &lt;br /&gt;
 # Remove unused packages&lt;br /&gt;
 sudo apt autoremove&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 # If apt is locked, find the process holding the lock&lt;br /&gt;
 sudo lsof /var/lib/dpkg/lock-frontend&lt;br /&gt;
 &lt;br /&gt;
 # Remove the lock (use with caution—only if no package manager is running)&lt;br /&gt;
 sudo rm /var/lib/dpkg/lock-frontend&lt;br /&gt;
 sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure dpkg&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
Disk &amp;amp; Filesystem Issues&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 # Check disk space&lt;br /&gt;
 df -h&lt;br /&gt;
 &lt;br /&gt;
 # Check inode usage&lt;br /&gt;
 df -i&lt;br /&gt;
 &lt;br /&gt;
 # View disk I/O statistics&lt;br /&gt;
 # iostat is part of the sysstat package, which also includes:&lt;br /&gt;
 # mpstat (CPU statistics), sar (system activity reporter),&lt;br /&gt;
 # pidstat (process statistics), and cifsiostat (CIFS statistics)&lt;br /&gt;
 sudo apt install sysstat&lt;br /&gt;
 &lt;br /&gt;
 iostat -x 1&lt;br /&gt;
 &lt;br /&gt;
 # Show stats in MB instead of KB&lt;br /&gt;
 iostat -xm 2&lt;br /&gt;
 &lt;br /&gt;
 # Monitor a specific device&lt;br /&gt;
 iostat -x sda 1&lt;br /&gt;
 &lt;br /&gt;
 # Check for disk errors in dmesg&lt;br /&gt;
 sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # SMART disk health (requires smartmontools)&lt;br /&gt;
 sudo apt install smartmontools&lt;br /&gt;
 sudo smartctl -a /dev/sda&lt;br /&gt;
&lt;br /&gt;
=== Repair Filesystem ===&lt;br /&gt;
 # Unmount the partition first&lt;br /&gt;
 sudo umount /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Run filesystem check&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # For ext4 specifically&lt;br /&gt;
 sudo e2fsck -f /dev/sdXN&lt;br /&gt;
Performance Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Resource Hogs ===&lt;br /&gt;
 # CPU usage by process&lt;br /&gt;
 top -o %CPU&lt;br /&gt;
 &lt;br /&gt;
 # Memory usage by process&lt;br /&gt;
 top -o %MEM&lt;br /&gt;
 &lt;br /&gt;
 # Disk usage by directory&lt;br /&gt;
 du -sh /* | sort -h&lt;br /&gt;
 &lt;br /&gt;
 # Find large files&lt;br /&gt;
 find / -type f -size +100M 2&amp;gt;/dev/null&lt;br /&gt;
 &lt;br /&gt;
 # Check running processes sorted by memory use&lt;br /&gt;
 ps aux --sort=-%mem | head -20&lt;br /&gt;
&lt;br /&gt;
=== System Temperature Monitoring ===&lt;br /&gt;
 # Install lm-sensors if not already present&lt;br /&gt;
 sudo apt install lm-sensors&lt;br /&gt;
 sudo sensors-detect&lt;br /&gt;
 &lt;br /&gt;
 # View temperatures&lt;br /&gt;
 sensors&lt;br /&gt;
 &lt;br /&gt;
 # Real-time temperature monitoring&lt;br /&gt;
 watch -n 2 sensors&lt;br /&gt;
See section 12 for a shell alias that makes temperature monitoring more convenient.&lt;br /&gt;
&lt;br /&gt;
Service &amp;amp; Application Errors&lt;br /&gt;
&lt;br /&gt;
=== Debug Service Problems ===&lt;br /&gt;
 # Check service status&lt;br /&gt;
 sudo systemctl status service-name&lt;br /&gt;
 &lt;br /&gt;
 # View service logs&lt;br /&gt;
 sudo journalctl -u service-name&lt;br /&gt;
 &lt;br /&gt;
 # Restart a service&lt;br /&gt;
 sudo systemctl restart service-name&lt;br /&gt;
 &lt;br /&gt;
 # Enable service at boot&lt;br /&gt;
 sudo systemctl enable service-name&lt;br /&gt;
 &lt;br /&gt;
 # View recent service failures&lt;br /&gt;
 journalctl -p err -b&lt;br /&gt;
&lt;br /&gt;
=== Application Crash Investigation ===&lt;br /&gt;
 # Check for core dumps&lt;br /&gt;
 ls -lh /var/crash/&lt;br /&gt;
 &lt;br /&gt;
 # View available application logs&lt;br /&gt;
 ls /var/log/&lt;br /&gt;
 &lt;br /&gt;
 # Follow syslog for application errors in real-time&lt;br /&gt;
 sudo tail -f /var/log/syslog&lt;br /&gt;
Permission &amp;amp; Access Issues&lt;br /&gt;
&lt;br /&gt;
=== Fix Common Permission Problems ===&lt;br /&gt;
 # Check file ownership&lt;br /&gt;
 ls -l /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change ownership (user:group)&lt;br /&gt;
 sudo chown user:group /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change permissions&lt;br /&gt;
 sudo chmod 644 /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Recursively fix permissions on a directory&lt;br /&gt;
 sudo chown -R user:group /path/to/directory&lt;br /&gt;
&lt;br /&gt;
=== User &amp;amp; Authentication Issues ===&lt;br /&gt;
 # Check user information&lt;br /&gt;
 id username&lt;br /&gt;
 &lt;br /&gt;
 # View user login history&lt;br /&gt;
 last -a&lt;br /&gt;
 &lt;br /&gt;
 # Check failed login attempts&lt;br /&gt;
 sudo journalctl | grep &amp;quot;authentication failure&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Reset user password&lt;br /&gt;
 sudo passwd username&lt;br /&gt;
Hardware Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Hardware ===&lt;br /&gt;
 # List all hardware (install if needed: sudo apt install lshw)&lt;br /&gt;
 sudo lshw -short&lt;br /&gt;
 &lt;br /&gt;
 # PCI devices&lt;br /&gt;
 lspci -v&lt;br /&gt;
 &lt;br /&gt;
 # USB devices&lt;br /&gt;
 lsusb -v&lt;br /&gt;
 &lt;br /&gt;
 # CPU information&lt;br /&gt;
 lscpu&lt;br /&gt;
 &lt;br /&gt;
 # Memory information&lt;br /&gt;
 sudo dmidecode --type memory&lt;br /&gt;
&lt;br /&gt;
=== Check Hardware Errors ===&lt;br /&gt;
 # Kernel ring buffer (hardware messages)&lt;br /&gt;
 dmesg | less&lt;br /&gt;
 # Press q to quit&lt;br /&gt;
 &lt;br /&gt;
 # Search for specific hardware issues&lt;br /&gt;
 dmesg | grep -i &amp;quot;error\|fail\|warn&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Check for USB issues&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
Quick Diagnostic Commands&lt;br /&gt;
&lt;br /&gt;
=== System Information at a Glance ===&lt;br /&gt;
 # Uptime and load average&lt;br /&gt;
 uptime&lt;br /&gt;
 &lt;br /&gt;
 # Kernel version&lt;br /&gt;
 uname -r&lt;br /&gt;
 &lt;br /&gt;
 # Debian version&lt;br /&gt;
 cat /etc/debian_version&lt;br /&gt;
 &lt;br /&gt;
 # Full system summary (install if needed: sudo apt install inxi)&lt;br /&gt;
 sudo inxi -Fxz&lt;br /&gt;
&lt;br /&gt;
=== Emergency Toolkit ===&lt;br /&gt;
 # Create a consolidated diagnostic report&lt;br /&gt;
 sudo journalctl -b &amp;gt; ~/system-report.txt&lt;br /&gt;
 dmesg &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 systemctl --failed &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 df -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 free -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 &lt;br /&gt;
 # Watch logs in real-time&lt;br /&gt;
 sudo journalctl -f&lt;br /&gt;
 &lt;br /&gt;
 # Monitor system resources continuously&lt;br /&gt;
 watch -n 1 &#039;free -h &amp;amp;&amp;amp; df -h&#039;&lt;br /&gt;
Useful Aliases &amp;amp; Shortcuts&lt;br /&gt;
Add these to your ~/.bashrc for quick access to common troubleshooting commands:&lt;br /&gt;
 # Monitor system temperatures in real-time&lt;br /&gt;
 alias temps=&amp;quot;watch -n 2 &#039;for i in /sys/class/hwmon/hwmon*/; do echo -n \&amp;quot;\$(cat \${i}name): \&amp;quot;; cat \${i}temp*_input 2&amp;gt;/dev/null | while read temp; do echo \&amp;quot;scale=1; \$temp/1000\&amp;quot; | bc; done | tr \&amp;quot;\n\&amp;quot; \&amp;quot; \&amp;quot;; echo \&amp;quot;°C\&amp;quot;; done&#039;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Quick system status&lt;br /&gt;
 alias sysstat=&#039;echo &amp;quot;=== CPU ===&amp;quot; &amp;amp;&amp;amp; uptime &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Memory ===&amp;quot; &amp;amp;&amp;amp; free -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Disk ===&amp;quot; &amp;amp;&amp;amp; df -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Top Processes ===&amp;quot; &amp;amp;&amp;amp; ps aux --sort=-%mem | head -10&#039;&lt;br /&gt;
 &lt;br /&gt;
 # View last boot logs&lt;br /&gt;
 alias lastboot=&#039;journalctl -b -1&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Check failed services&lt;br /&gt;
 alias failedservices=&#039;systemctl --failed&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Monitor logs in real-time&lt;br /&gt;
 alias watchlog=&#039;sudo journalctl -f&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Quick network status&lt;br /&gt;
 alias netstatus=&#039;ip addr show &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Routes ===&amp;quot; &amp;amp;&amp;amp; ip route show&#039;&lt;br /&gt;
After adding these, reload your shell configuration:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
Tips for Effective Troubleshooting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check logs first.&#039;&#039;&#039; journalctl and dmesg are your best starting point for almost any problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Change one thing at a time.&#039;&#039;&#039; It’s tempting to make several changes at once, but doing so makes it impossible to know what actually fixed—or broke—the problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Document your changes.&#039;&#039;&#039; Keep notes on what you’ve tried and what the results were. You’ll thank yourself later.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use exact error messages.&#039;&#039;&#039; Copy error messages verbatim and search for them alongside “Debian” and the version number—for example, “Debian 13” or “Debian 13.1” for point releases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check what changed recently.&#039;&#039;&#039; Did you install something, update packages, or change the kernel before the problem appeared? Start there.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Back up before making major changes.&#039;&#039;&#039; This goes without saying, but it’s easy to skip when you’re in a hurry.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use verbose mode.&#039;&#039;&#039; Adding -v or -vv flags to commands often reveals what would otherwise be silent failures.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the community.&#039;&#039;&#039; The Debian forums, Reddit, Stack Exchange, and the Debian mailing lists are all active and well-indexed. Someone has usually seen your problem before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by &amp;lt;dfn&amp;gt;distro-nix&amp;lt;/dfn&amp;gt; to the Debian User Forums on 2025-10-27.&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=272</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=272"/>
		<updated>2026-05-15T22:21:45Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: forum profile link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Author:&#039;&#039;&#039; distro-nix &#039;&#039;&#039;Forum Profile:&#039;&#039;&#039; [https://forums.debian.net/memberlist.php?mode=viewprofile&amp;amp;u=239099 distro-nix]  &#039;&#039;&#039;Debian Version:&#039;&#039;&#039; Debian 13 (Trixie) &#039;&#039;&#039;Kernel Versions Tested:&#039;&#039;&#039; 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64 (x86_64) &#039;&#039;&#039;Created:&#039;&#039;&#039; 2025-10-27 &#039;&#039;&#039;Last Updated:&#039;&#039;&#039; 2026-05-15 &#039;&#039;&#039;ID:&#039;&#039;&#039; 544201 &#039;&#039;&#039;License:&#039;&#039;&#039; CC BY-SA 4.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This guide is preserved in its original form. Questions and feedback welcome via the author’s &amp;lt;dfn&amp;gt;Debian Forums profile&amp;lt;/dfn&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The Debian First Aid Kit is a practical reference for diagnosing and resolving common system problems on Debian GNU/Linux. It covers commonly occuring categories of failure: system freezes and crashes, boot problems, network issues, package management, disk and filesystem errors, performance degradation, service and application failures, permission and access problems, hardware identification and errors, and quick diagnostics. Each section gives the relevant commands so you can understand what they do and why, rather than a bare list to copy and paste blindly. A dedicated section covers MTR (Matt’s Traceroute) in depth, including output interpretation, practical troubleshooting, and how to monitor continuously. The guide also includes a set of shell aliases for faster access to common diagnostic tasks. All commands are verified on Debian 13 (Trixie) running kernel 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64. This document is intended for users with basic command-line familiarity who need a reliable, consolidated reference when something goes wrong.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Keywords:&#039;&#039;&#039; Debian, troubleshooting, system administration, MTR, network diagnostics, package management, journalctl, filesystem repair&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tested Commands Disclaimer ==&lt;br /&gt;
All commands in this document have been verified on Debian 13 (Trixie) with the kernel versions listed above. Results may vary on other releases or hardware configurations. Always test in a safe environment before applying any procedure to a production system.&lt;br /&gt;
&lt;br /&gt;
== Conventions Used in This Document ==&lt;br /&gt;
Command examples throughout this guide follow standard Unix prompt conventions. A $ prefix indicates a command run as a regular user. Where elevated privileges are required, sudo is shown explicitly and # with a brief explanation if needed:&lt;br /&gt;
 $ journalctl -b -1          # regular user&lt;br /&gt;
 $ sudo apt install mtr      # requires elevation via sudo&lt;br /&gt;
In recovery shell contexts, where you are operating directly as root, the prompt is #.&lt;br /&gt;
&lt;br /&gt;
== System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics:&#039;&#039;&#039; Search for “kernel panic” or “Oops”&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM):&#039;&#039;&#039; Search for “Out of memory” or “oom-killer”&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors:&#039;&#039;&#039; Look for “MCE” (Machine Check Exception) or “hardware error”&lt;br /&gt;
* &#039;&#039;&#039;Driver issues:&#039;&#039;&#039; Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating:&#039;&#039;&#039; Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 $ free -h                      # memory usage&lt;br /&gt;
&lt;br /&gt;
 $ df -h                        # disk space&lt;br /&gt;
&lt;br /&gt;
 $ htop                         # interactive resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ top                          # alternative resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt install btop        # btop is a more detailed alternative&lt;br /&gt;
&lt;br /&gt;
 $ sudo dmesg | grep -i error   # check for disk errors&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN         # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX  # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub            # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab              # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
The following are permanent errors caused by incomplete or buggy ACPI tables in the BIOS. They are harmless and can be safely ignored if they appear on your system:&lt;br /&gt;
 [0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&lt;br /&gt;
 [0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&lt;br /&gt;
 [0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&lt;br /&gt;
&lt;br /&gt;
== Boot Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Check Boot Process ===&lt;br /&gt;
 $ systemd-analyze blame            # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemd-analyze blame            # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemctl --failed               # units that failed during boot&lt;br /&gt;
&lt;br /&gt;
 $ systemctl status &amp;lt;service-name&amp;gt;  # e.g. systemctl status NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN              # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX       # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub                 # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab                   # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
== Network Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose Network Connection ===&lt;br /&gt;
 $ ip addr show                         # check network interfaces&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 4 8.8.8.8                    # test IPv4 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 6 2a00:1450:4007:809::200e   # test IPv6 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ nslookup google.com                  # check DNS resolution&lt;br /&gt;
&lt;br /&gt;
 $ ip route show                        # view routing table&lt;br /&gt;
&lt;br /&gt;
 $ ss -tuln                             # check active connections &lt;br /&gt;
&lt;br /&gt;
=== Restart Network Service ===&lt;br /&gt;
 $ sudo systemctl restart NetworkManager   # for systems using NetworkManager&lt;br /&gt;
&lt;br /&gt;
 $ sudo systemctl restart networking       # for systems using networking service&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 down              # bring interface down&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 up                # bring interface back up&lt;br /&gt;
&lt;br /&gt;
== MTR (Matt’s Traceroute) ==&lt;br /&gt;
MTR combines the functionality of ping and traceroute into a single real-time network diagnostic tool. It continuously monitors the path between your system and a destination, providing detailed statistics about latency and packet loss at each hop. When you need to demonstrate a network problem that is outside your control—to your hosting provider, for example—MTR gives you the evidence you need.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
 $ sudo apt install mtr&lt;br /&gt;
&lt;br /&gt;
=== Basic Usage ===&lt;br /&gt;
 $ mtr google.com                          # interactive mode&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report google.com                 # report mode (10 cycles then exit)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 50 google.com       # specify number of cycles&lt;br /&gt;
&lt;br /&gt;
 $ mtr --tcp google.com                    # use TCP instead of ICMP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --udp google.com                    # use UDP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --no-dns google.com                 # skip DNS resolution (faster)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --show-ips google.com               # show both hostnames and IPs&lt;br /&gt;
&lt;br /&gt;
== Understanding MTR Output ==&lt;br /&gt;
&lt;br /&gt;
==== Sample Output ====&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    10   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
   4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   5.|-- google.com                 0.0%    10   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
&lt;br /&gt;
=== Column Meanings ===&lt;br /&gt;
&#039;&#039;&#039;HOST&#039;&#039;&#039; — Hostname or IP address of each hop in the route.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loss%&#039;&#039;&#039; — Percentage of packets lost at this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Snt&#039;&#039;&#039; — Number of packets sent to this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last&#039;&#039;&#039; — Latency of the most recent packet, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Avg&#039;&#039;&#039; — Average latency across all packets sent, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best&#039;&#039;&#039; — Lowest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wrst&#039;&#039;&#039; — Highest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StDev&#039;&#039;&#039; — Standard deviation of latency measurements—lower values indicate a more stable connection.&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Results ===&lt;br /&gt;
A healthy network shows 0% loss on all hops, stable latency with low StDev values, a gradual latency increase as hop count increases, and consistent response times.&lt;br /&gt;
&lt;br /&gt;
==== Problem Indicators ====&lt;br /&gt;
&#039;&#039;&#039;1. High Packet Loss at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 5.|-- problem-router.net        25.0%    10   45.3  48.2  42.1  65.8  8.4&lt;br /&gt;
If loss continues to the destination, there is a real problem at that router. If loss appears only at that hop but not beyond, the router is likely rate-limiting ICMP responses—a false positive, not a real problem. The rule of thumb: if packet loss appears at hop N but hops N+1, N+2, and beyond show 0% loss, it’s almost certainly ICMP rate limiting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. High Latency at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 3.|-- slow-link.net              0.0%    10  150.3 155.2 148.1 165.8  5.4&lt;br /&gt;
This indicates a network bottleneck, a congested link, geographical distance (intercontinental hops), or slow routing equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. No Response (???)&#039;&#039;&#039;&lt;br /&gt;
 4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
The router at this hop is configured not to respond to ICMP or traceroute packets, or a firewall is blocking diagnostic packets. This is not necessarily a problem if later hops respond normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. High Jitter (StDev)&#039;&#039;&#039;&lt;br /&gt;
 6.|-- unstable.net               0.0%    10   35.3  52.8  28.1  95.2  24.7&lt;br /&gt;
A high StDev (24.7ms in this example) indicates inconsistent latency caused by network congestion or instability. This is particularly noticeable in real-time applications such as VoIP, gaming, and video calls.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Sudden Latency Spike&#039;&#039;&#039;&lt;br /&gt;
 1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
 2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
 3.|-- problematic-hop.net        0.0%    10  180.5 185.2 178.1 195.8  6.4&lt;br /&gt;
 4.|-- next-hop.net               0.0%    10  182.3 187.8 180.5 198.2  6.8&lt;br /&gt;
Hop 3 introduces approximately 170ms of additional latency (jumping from 9ms to 180ms). Everything from hop 3 onward carries that penalty.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Report Mode with Different Output Formats ====&lt;br /&gt;
 $ mtr --report --csv google.com &amp;gt; network-report.csv    # CSV for logging&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report --json google.com                        # JSON for parsing&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report --xml google.com                         # XML format&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-wide google.com                          # wide report, no abbreviations&lt;br /&gt;
&lt;br /&gt;
==== Protocol Selection ====&lt;br /&gt;
 $ mtr google.com                                        # ICMP (default)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --udp google.com                                  # UDP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --tcp google.com                                  # TCP&lt;br /&gt;
&lt;br /&gt;
 $ sudo mtr --tcp --port 443 google.com                  # specific TCP port&lt;br /&gt;
&lt;br /&gt;
 $ sudo mtr --tcp --port 22 remote-server.com            # default TCP port&lt;br /&gt;
&lt;br /&gt;
==== Timing and Duration ====&lt;br /&gt;
 $ mtr --interval 0.5 google.com           # interval between pings (default 1s)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 100 google.com      # extended test, 100 cycles&lt;br /&gt;
&lt;br /&gt;
 $ mtr google.com                          # continuous monitoring (Ctrl+C to stop)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 10 google.com       # quick 10-cycle report&lt;br /&gt;
&lt;br /&gt;
==== Advanced Options ====&lt;br /&gt;
 $ mtr --aslookup google.com               # show Autonomous System (AS) numbers&lt;br /&gt;
&lt;br /&gt;
 $ mtr --max-ttl 20 google.com             # set maximum number of hops&lt;br /&gt;
&lt;br /&gt;
 $ mtr --psize 1000 google.com             # set packet size&lt;br /&gt;
&lt;br /&gt;
 $ mtr --show-ips google.com               # show both IP and hostname&lt;br /&gt;
&lt;br /&gt;
 $ mtr --address 192.168.1.100 google.com  # specify source address&lt;br /&gt;
&lt;br /&gt;
 $ mtr -4 google.com                       # IPv4 only&lt;br /&gt;
&lt;br /&gt;
 $ mtr -6 google.com                       # IPv6 only&lt;br /&gt;
&lt;br /&gt;
=== Interactive Mode Commands ===&lt;br /&gt;
When running MTR in interactive mode (mtr hostname), the following keys are available:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;h&#039;&#039;&#039; — Display help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d&#039;&#039;&#039; — Toggle display mode, cycling through different views.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;n&#039;&#039;&#039; — Toggle between hostnames and IP addresses.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;r&#039;&#039;&#039; — Reset all statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;p&#039;&#039;&#039; — Pause/unpause the display.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;q&#039;&#039;&#039; — Quit MTR.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;u&#039;&#039;&#039; — Switch between ICMP, UDP, and TCP modes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;y&#039;&#039;&#039; — Switch between IPv4 and IPv6.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;o&#039;&#039;&#039; — Toggle field display options.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;j&#039;&#039;&#039; — Toggle latency display.&lt;br /&gt;
&lt;br /&gt;
=== Practical Troubleshooting Scenarios ===&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1: Diagnosing a Slow Website ====&lt;br /&gt;
 $ mtr --report-cycles 100 --no-dns example.com&lt;br /&gt;
Look for high average latency at specific hops, packet loss at the destination, and high StDev values indicating jitter.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2: Testing if a Firewall Blocks SSH ====&lt;br /&gt;
 $ sudo mtr --tcp --port 22 --report-cycles 50 remote-server.com&lt;br /&gt;
If the last hop shows 100% loss but earlier hops are fine, port 22 may be filtered. Run a standard ICMP test for comparison.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3: ISP Performance Issues ====&lt;br /&gt;
 $ mtr --report-cycles 100 8.8.8.8&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 100 1.1.1.1&lt;br /&gt;
If issues appear in the first three or four hops, the problem is likely within your ISP’s network. If issues appear later, the problem lies beyond your ISP.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4: VPN Troubleshooting ====&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; before-vpn.txt   # before VPN&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; after-vpn.txt    # after VPN&lt;br /&gt;
&lt;br /&gt;
 $ diff before-vpn.txt after-vpn.txt                              # compare the two&lt;br /&gt;
&lt;br /&gt;
==== Scenario 5: Gaming/Streaming Performance ====&lt;br /&gt;
 $ mtr --report-cycles 200 game-server.com&lt;br /&gt;
For real-time applications, look for low average latency (under 50ms for gaming), low StDev (under 5ms preferred), and zero packet loss.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 6: Intermittent Connectivity ====&lt;br /&gt;
 $ mtr --report-cycles 500 --interval 1 target.com &amp;gt; long-test.txt   # long-running test&lt;br /&gt;
&lt;br /&gt;
 $ mtr target.com                                                    # real-time monitoring&lt;br /&gt;
&lt;br /&gt;
=== Continuous Monitoring ===&lt;br /&gt;
&lt;br /&gt;
==== Log Network Performance Over Time ====&lt;br /&gt;
 while true; do&lt;br /&gt;
     timestamp=$(date +%Y%m%d-%H%M%S)&lt;br /&gt;
     mtr --report --report-cycles 50 google.com &amp;gt; &amp;quot;mtr-$timestamp.txt&amp;quot;&lt;br /&gt;
     sleep 3600&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Monitor Multiple Destinations ====&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 echo &amp;quot;=== MTR Report $(date) ===&amp;quot; &amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Google DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 8.8.8.8 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Cloudflare DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 1.1.1.1 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Your Server:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 your-server.com &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
&lt;br /&gt;
=== Useful Aliases for .bashrc ===&lt;br /&gt;
 Quick network path analysis&lt;br /&gt;
 alias mtrreport=&#039;mtr --report --report-cycles 50 --no-dns&#039;&lt;br /&gt;
 &lt;br /&gt;
 Monitor connection to Google DNS&lt;br /&gt;
 alias netcheck=&#039;mtr --report-cycles 20 8.8.8.8&#039;&lt;br /&gt;
 &lt;br /&gt;
 Extended network test&lt;br /&gt;
 alias mtrlong=&#039;mtr --report-cycles 100&#039;&lt;br /&gt;
 &lt;br /&gt;
 TCP port 443 test (HTTPS)&lt;br /&gt;
 alias mtrhttps=&#039;sudo mtr --tcp --port 443 --report-cycles 30&#039;&lt;br /&gt;
 &lt;br /&gt;
 Quick comparison of major DNS providers&lt;br /&gt;
 alias dnstest=&#039;echo &amp;quot;Google:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 8.8.8.8 &amp;amp;&amp;amp; echo -e &amp;quot;\nCloudflare:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 1.1.1.1&#039;&lt;br /&gt;
After adding to ~/.bashrc, reload with:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting Tips ===&lt;br /&gt;
&#039;&#039;&#039;Permission issues with TCP mode:&#039;&#039;&#039;&lt;br /&gt;
 Use sudo for TCP on privileged ports&lt;br /&gt;
 $ sudo mtr --tcp --port 443 example.com&lt;br /&gt;
 &lt;br /&gt;
 Or set capabilities (one-time setup)&lt;br /&gt;
 $ sudo setcap cap_net_raw+ep /usr/bin/mtr-packet&lt;br /&gt;
&#039;&#039;&#039;False positives:&#039;&#039;&#039; Packet loss at an intermediate hop but not at the destination is almost always ICMP rate limiting at that router, not a real problem. Example:&lt;br /&gt;
 3.|-- router.isp.net            20.0%    50   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
 4.|-- next-hop.net               0.0%    50   18.5  19.2  17.8  22.1   1.3&lt;br /&gt;
 5.|-- destination.com            0.0%    50   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
Hop 3 shows 20% loss, but hops 4 and 5 show 0%. Traffic is flowing normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DNS resolution delays:&#039;&#039;&#039; If MTR is slow to start, skip DNS resolution with mtr --no-dns target.com and resolve addresses afterward with host 203.0.113.1 if needed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Comparing results:&#039;&#039;&#039;&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test1.txt&lt;br /&gt;
 $ sleep 60&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test2.txt&lt;br /&gt;
 $ diff test1.txt test2.txt&lt;br /&gt;
&lt;br /&gt;
=== When to Use MTR vs Other Tools ===&lt;br /&gt;
&#039;&#039;&#039;MTR&#039;&#039;&#039; — Best for continuous monitoring, identifying problem hops, and gathering detailed statistics. Requires installation via apt.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ping&#039;&#039;&#039; — Best for a quick connectivity test or simple latency check. Only tests the endpoint, not the path.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;traceroute&#039;&#039;&#039; — Best for one-time path discovery. Provides no continuous monitoring.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ss / netstat&#039;&#039;&#039; — Best for checking local connection status. Doesn’t test remote paths.&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
Run at least 50–100 cycles for accurate statistics. Use --no-dns for faster results and to avoid DNS resolution issues during testing. Test at different times of day, since network conditions vary. If one protocol shows issues, compare ICMP, UDP, and TCP modes. Save reports with timestamps for trend analysis. Use 8.8.8.8 or 1.1.1.1 as known-good hosts to verify your local network first. Let MTR run for at least 30–60 seconds before drawing conclusions.&lt;br /&gt;
&lt;br /&gt;
=== Reading Between the Lines ===&lt;br /&gt;
&#039;&#039;&#039;Good network health:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.1   1.2   0.9   2.1   0.2&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    50    8.2   8.5   7.5  10.2   0.5&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    50   15.1  15.5  14.0  18.3   0.8&lt;br /&gt;
   4.|-- google.com                 0.0%    50   24.8  25.2  23.5  28.1   1.1&lt;br /&gt;
No packet loss, consistent latency, low jitter throughout.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problematic network:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.2   1.5   1.0   2.3   0.3&lt;br /&gt;
   2.|-- 10.0.0.1                   5.0%    50   45.3  52.8  8.1  245.2  45.7&lt;br /&gt;
   3.|-- ???                       100.0%   50    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   4.|-- destination.com           15.0%    50   95.4 125.8  48.2 385.5  78.2&lt;br /&gt;
Packet loss at hop 2 and the destination, high jitter, and a very high worst-case latency all point to a genuine problem at or near hop 2.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
MTR is your friend when it comes to diagnostics. Use --report-cycles 50 or higher for reliable data. Watch for packet loss at the destination—intermediate losses may be false positives. High StDev indicates an unstable connection. High average latency points to slow links. Use --no-dns for faster results. Compare ICMP, UDP, and TCP modes if issues appear. Test at different times of day for a complete picture.&lt;br /&gt;
== Package Management Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Fix Broken Packages ===&lt;br /&gt;
 $ sudo apt update                     # update package lists&lt;br /&gt;
 $ sudo apt --fix-broken install       # fix broken dependencies&lt;br /&gt;
 $ sudo dpkg --configure -a            # reconfigure packages (no output = nothing to do)&lt;br /&gt;
 $ sudo apt clean                      # clean package cache&lt;br /&gt;
 $ sudo apt autoclean&lt;br /&gt;
 $ sudo apt autoremove                 # remove unused packages&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # Fix broken dependencies&lt;br /&gt;
 sudo apt --fix-broken install&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure packages&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
 # No output means there is nothing to reconfigure&lt;br /&gt;
 &lt;br /&gt;
 # Clean package cache&lt;br /&gt;
 sudo apt clean&lt;br /&gt;
 sudo apt autoclean&lt;br /&gt;
 &lt;br /&gt;
 # Remove unused packages&lt;br /&gt;
 sudo apt autoremove&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 # If apt is locked, find the process holding the lock&lt;br /&gt;
 sudo lsof /var/lib/dpkg/lock-frontend&lt;br /&gt;
 &lt;br /&gt;
 # Remove the lock (use with caution—only if no package manager is running)&lt;br /&gt;
 sudo rm /var/lib/dpkg/lock-frontend&lt;br /&gt;
 sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure dpkg&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
Disk &amp;amp; Filesystem Issues&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 # Check disk space&lt;br /&gt;
 df -h&lt;br /&gt;
 &lt;br /&gt;
 # Check inode usage&lt;br /&gt;
 df -i&lt;br /&gt;
 &lt;br /&gt;
 # View disk I/O statistics&lt;br /&gt;
 # iostat is part of the sysstat package, which also includes:&lt;br /&gt;
 # mpstat (CPU statistics), sar (system activity reporter),&lt;br /&gt;
 # pidstat (process statistics), and cifsiostat (CIFS statistics)&lt;br /&gt;
 sudo apt install sysstat&lt;br /&gt;
 &lt;br /&gt;
 iostat -x 1&lt;br /&gt;
 &lt;br /&gt;
 # Show stats in MB instead of KB&lt;br /&gt;
 iostat -xm 2&lt;br /&gt;
 &lt;br /&gt;
 # Monitor a specific device&lt;br /&gt;
 iostat -x sda 1&lt;br /&gt;
 &lt;br /&gt;
 # Check for disk errors in dmesg&lt;br /&gt;
 sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # SMART disk health (requires smartmontools)&lt;br /&gt;
 sudo apt install smartmontools&lt;br /&gt;
 sudo smartctl -a /dev/sda&lt;br /&gt;
&lt;br /&gt;
=== Repair Filesystem ===&lt;br /&gt;
 # Unmount the partition first&lt;br /&gt;
 sudo umount /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Run filesystem check&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # For ext4 specifically&lt;br /&gt;
 sudo e2fsck -f /dev/sdXN&lt;br /&gt;
Performance Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Resource Hogs ===&lt;br /&gt;
 # CPU usage by process&lt;br /&gt;
 top -o %CPU&lt;br /&gt;
 &lt;br /&gt;
 # Memory usage by process&lt;br /&gt;
 top -o %MEM&lt;br /&gt;
 &lt;br /&gt;
 # Disk usage by directory&lt;br /&gt;
 du -sh /* | sort -h&lt;br /&gt;
 &lt;br /&gt;
 # Find large files&lt;br /&gt;
 find / -type f -size +100M 2&amp;gt;/dev/null&lt;br /&gt;
 &lt;br /&gt;
 # Check running processes sorted by memory use&lt;br /&gt;
 ps aux --sort=-%mem | head -20&lt;br /&gt;
&lt;br /&gt;
=== System Temperature Monitoring ===&lt;br /&gt;
 # Install lm-sensors if not already present&lt;br /&gt;
 sudo apt install lm-sensors&lt;br /&gt;
 sudo sensors-detect&lt;br /&gt;
 &lt;br /&gt;
 # View temperatures&lt;br /&gt;
 sensors&lt;br /&gt;
 &lt;br /&gt;
 # Real-time temperature monitoring&lt;br /&gt;
 watch -n 2 sensors&lt;br /&gt;
See section 12 for a shell alias that makes temperature monitoring more convenient.&lt;br /&gt;
&lt;br /&gt;
Service &amp;amp; Application Errors&lt;br /&gt;
&lt;br /&gt;
=== Debug Service Problems ===&lt;br /&gt;
 # Check service status&lt;br /&gt;
 sudo systemctl status service-name&lt;br /&gt;
 &lt;br /&gt;
 # View service logs&lt;br /&gt;
 sudo journalctl -u service-name&lt;br /&gt;
 &lt;br /&gt;
 # Restart a service&lt;br /&gt;
 sudo systemctl restart service-name&lt;br /&gt;
 &lt;br /&gt;
 # Enable service at boot&lt;br /&gt;
 sudo systemctl enable service-name&lt;br /&gt;
 &lt;br /&gt;
 # View recent service failures&lt;br /&gt;
 journalctl -p err -b&lt;br /&gt;
&lt;br /&gt;
=== Application Crash Investigation ===&lt;br /&gt;
 # Check for core dumps&lt;br /&gt;
 ls -lh /var/crash/&lt;br /&gt;
 &lt;br /&gt;
 # View available application logs&lt;br /&gt;
 ls /var/log/&lt;br /&gt;
 &lt;br /&gt;
 # Follow syslog for application errors in real-time&lt;br /&gt;
 sudo tail -f /var/log/syslog&lt;br /&gt;
Permission &amp;amp; Access Issues&lt;br /&gt;
&lt;br /&gt;
=== Fix Common Permission Problems ===&lt;br /&gt;
 # Check file ownership&lt;br /&gt;
 ls -l /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change ownership (user:group)&lt;br /&gt;
 sudo chown user:group /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change permissions&lt;br /&gt;
 sudo chmod 644 /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Recursively fix permissions on a directory&lt;br /&gt;
 sudo chown -R user:group /path/to/directory&lt;br /&gt;
&lt;br /&gt;
=== User &amp;amp; Authentication Issues ===&lt;br /&gt;
 # Check user information&lt;br /&gt;
 id username&lt;br /&gt;
 &lt;br /&gt;
 # View user login history&lt;br /&gt;
 last -a&lt;br /&gt;
 &lt;br /&gt;
 # Check failed login attempts&lt;br /&gt;
 sudo journalctl | grep &amp;quot;authentication failure&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Reset user password&lt;br /&gt;
 sudo passwd username&lt;br /&gt;
Hardware Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Hardware ===&lt;br /&gt;
 # List all hardware (install if needed: sudo apt install lshw)&lt;br /&gt;
 sudo lshw -short&lt;br /&gt;
 &lt;br /&gt;
 # PCI devices&lt;br /&gt;
 lspci -v&lt;br /&gt;
 &lt;br /&gt;
 # USB devices&lt;br /&gt;
 lsusb -v&lt;br /&gt;
 &lt;br /&gt;
 # CPU information&lt;br /&gt;
 lscpu&lt;br /&gt;
 &lt;br /&gt;
 # Memory information&lt;br /&gt;
 sudo dmidecode --type memory&lt;br /&gt;
&lt;br /&gt;
=== Check Hardware Errors ===&lt;br /&gt;
 # Kernel ring buffer (hardware messages)&lt;br /&gt;
 dmesg | less&lt;br /&gt;
 # Press q to quit&lt;br /&gt;
 &lt;br /&gt;
 # Search for specific hardware issues&lt;br /&gt;
 dmesg | grep -i &amp;quot;error\|fail\|warn&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Check for USB issues&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
Quick Diagnostic Commands&lt;br /&gt;
&lt;br /&gt;
=== System Information at a Glance ===&lt;br /&gt;
 # Uptime and load average&lt;br /&gt;
 uptime&lt;br /&gt;
 &lt;br /&gt;
 # Kernel version&lt;br /&gt;
 uname -r&lt;br /&gt;
 &lt;br /&gt;
 # Debian version&lt;br /&gt;
 cat /etc/debian_version&lt;br /&gt;
 &lt;br /&gt;
 # Full system summary (install if needed: sudo apt install inxi)&lt;br /&gt;
 sudo inxi -Fxz&lt;br /&gt;
&lt;br /&gt;
=== Emergency Toolkit ===&lt;br /&gt;
 # Create a consolidated diagnostic report&lt;br /&gt;
 sudo journalctl -b &amp;gt; ~/system-report.txt&lt;br /&gt;
 dmesg &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 systemctl --failed &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 df -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 free -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 &lt;br /&gt;
 # Watch logs in real-time&lt;br /&gt;
 sudo journalctl -f&lt;br /&gt;
 &lt;br /&gt;
 # Monitor system resources continuously&lt;br /&gt;
 watch -n 1 &#039;free -h &amp;amp;&amp;amp; df -h&#039;&lt;br /&gt;
Useful Aliases &amp;amp; Shortcuts&lt;br /&gt;
Add these to your ~/.bashrc for quick access to common troubleshooting commands:&lt;br /&gt;
 # Monitor system temperatures in real-time&lt;br /&gt;
 alias temps=&amp;quot;watch -n 2 &#039;for i in /sys/class/hwmon/hwmon*/; do echo -n \&amp;quot;\$(cat \${i}name): \&amp;quot;; cat \${i}temp*_input 2&amp;gt;/dev/null | while read temp; do echo \&amp;quot;scale=1; \$temp/1000\&amp;quot; | bc; done | tr \&amp;quot;\n\&amp;quot; \&amp;quot; \&amp;quot;; echo \&amp;quot;°C\&amp;quot;; done&#039;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Quick system status&lt;br /&gt;
 alias sysstat=&#039;echo &amp;quot;=== CPU ===&amp;quot; &amp;amp;&amp;amp; uptime &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Memory ===&amp;quot; &amp;amp;&amp;amp; free -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Disk ===&amp;quot; &amp;amp;&amp;amp; df -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Top Processes ===&amp;quot; &amp;amp;&amp;amp; ps aux --sort=-%mem | head -10&#039;&lt;br /&gt;
 &lt;br /&gt;
 # View last boot logs&lt;br /&gt;
 alias lastboot=&#039;journalctl -b -1&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Check failed services&lt;br /&gt;
 alias failedservices=&#039;systemctl --failed&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Monitor logs in real-time&lt;br /&gt;
 alias watchlog=&#039;sudo journalctl -f&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Quick network status&lt;br /&gt;
 alias netstatus=&#039;ip addr show &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Routes ===&amp;quot; &amp;amp;&amp;amp; ip route show&#039;&lt;br /&gt;
After adding these, reload your shell configuration:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
Tips for Effective Troubleshooting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check logs first.&#039;&#039;&#039; journalctl and dmesg are your best starting point for almost any problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Change one thing at a time.&#039;&#039;&#039; It’s tempting to make several changes at once, but doing so makes it impossible to know what actually fixed—or broke—the problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Document your changes.&#039;&#039;&#039; Keep notes on what you’ve tried and what the results were. You’ll thank yourself later.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use exact error messages.&#039;&#039;&#039; Copy error messages verbatim and search for them alongside “Debian” and the version number—for example, “Debian 13” or “Debian 13.1” for point releases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check what changed recently.&#039;&#039;&#039; Did you install something, update packages, or change the kernel before the problem appeared? Start there.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Back up before making major changes.&#039;&#039;&#039; This goes without saying, but it’s easy to skip when you’re in a hurry.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use verbose mode.&#039;&#039;&#039; Adding -v or -vv flags to commands often reveals what would otherwise be silent failures.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the community.&#039;&#039;&#039; The Debian forums, Reddit, Stack Exchange, and the Debian mailing lists are all active and well-indexed. Someone has usually seen your problem before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by &amp;lt;dfn&amp;gt;distro-nix&amp;lt;/dfn&amp;gt; to the Debian User Forums on 2025-10-27.&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=271</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=271"/>
		<updated>2026-05-15T22:19:22Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: Forum profile&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Author:&#039;&#039;&#039; distro-nix &#039;&#039;&#039;Forum Profile:&#039;&#039;&#039; &amp;lt;dfn&amp;gt;[[Distro-nix|https://forums.debian.net/memberlist.php?mode=viewprofile&amp;amp;u=239099]]&amp;lt;/dfn&amp;gt; &#039;&#039;&#039;Debian Version:&#039;&#039;&#039; Debian 13 (Trixie) &#039;&#039;&#039;Kernel Versions Tested:&#039;&#039;&#039; 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64 (x86_64) &#039;&#039;&#039;Created:&#039;&#039;&#039; 2025-10-27 &#039;&#039;&#039;Last Updated:&#039;&#039;&#039; 2026-05-15 &#039;&#039;&#039;ID:&#039;&#039;&#039; 544201 &#039;&#039;&#039;License:&#039;&#039;&#039; CC BY-SA 4.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This guide is preserved in its original form. Questions and feedback welcome via the author’s &amp;lt;dfn&amp;gt;Debian Forums profile&amp;lt;/dfn&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The Debian First Aid Kit is a practical reference for diagnosing and resolving common system problems on Debian GNU/Linux. It covers commonly occuring categories of failure: system freezes and crashes, boot problems, network issues, package management, disk and filesystem errors, performance degradation, service and application failures, permission and access problems, hardware identification and errors, and quick diagnostics. Each section gives the relevant commands so you can understand what they do and why, rather than a bare list to copy and paste blindly. A dedicated section covers MTR (Matt’s Traceroute) in depth, including output interpretation, practical troubleshooting, and how to monitor continuously. The guide also includes a set of shell aliases for faster access to common diagnostic tasks. All commands are verified on Debian 13 (Trixie) running kernel 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64. This document is intended for users with basic command-line familiarity who need a reliable, consolidated reference when something goes wrong.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Keywords:&#039;&#039;&#039; Debian, troubleshooting, system administration, MTR, network diagnostics, package management, journalctl, filesystem repair&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tested Commands Disclaimer ==&lt;br /&gt;
All commands in this document have been verified on Debian 13 (Trixie) with the kernel versions listed above. Results may vary on other releases or hardware configurations. Always test in a safe environment before applying any procedure to a production system.&lt;br /&gt;
&lt;br /&gt;
== Conventions Used in This Document ==&lt;br /&gt;
Command examples throughout this guide follow standard Unix prompt conventions. A $ prefix indicates a command run as a regular user. Where elevated privileges are required, sudo is shown explicitly and # with a brief explanation if needed:&lt;br /&gt;
 $ journalctl -b -1          # regular user&lt;br /&gt;
 $ sudo apt install mtr      # requires elevation via sudo&lt;br /&gt;
In recovery shell contexts, where you are operating directly as root, the prompt is #.&lt;br /&gt;
&lt;br /&gt;
== System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics:&#039;&#039;&#039; Search for “kernel panic” or “Oops”&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM):&#039;&#039;&#039; Search for “Out of memory” or “oom-killer”&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors:&#039;&#039;&#039; Look for “MCE” (Machine Check Exception) or “hardware error”&lt;br /&gt;
* &#039;&#039;&#039;Driver issues:&#039;&#039;&#039; Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating:&#039;&#039;&#039; Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 $ free -h                      # memory usage&lt;br /&gt;
&lt;br /&gt;
 $ df -h                        # disk space&lt;br /&gt;
&lt;br /&gt;
 $ htop                         # interactive resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ top                          # alternative resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt install btop        # btop is a more detailed alternative&lt;br /&gt;
&lt;br /&gt;
 $ sudo dmesg | grep -i error   # check for disk errors&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN         # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX  # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub            # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab              # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
The following are permanent errors caused by incomplete or buggy ACPI tables in the BIOS. They are harmless and can be safely ignored if they appear on your system:&lt;br /&gt;
 [0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&lt;br /&gt;
 [0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&lt;br /&gt;
 [0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&lt;br /&gt;
&lt;br /&gt;
== Boot Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Check Boot Process ===&lt;br /&gt;
 $ systemd-analyze blame            # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemd-analyze blame            # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemctl --failed               # units that failed during boot&lt;br /&gt;
&lt;br /&gt;
 $ systemctl status &amp;lt;service-name&amp;gt;  # e.g. systemctl status NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN              # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX       # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub                 # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab                   # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
== Network Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose Network Connection ===&lt;br /&gt;
 $ ip addr show                         # check network interfaces&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 4 8.8.8.8                    # test IPv4 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 6 2a00:1450:4007:809::200e   # test IPv6 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ nslookup google.com                  # check DNS resolution&lt;br /&gt;
&lt;br /&gt;
 $ ip route show                        # view routing table&lt;br /&gt;
&lt;br /&gt;
 $ ss -tuln                             # check active connections &lt;br /&gt;
&lt;br /&gt;
=== Restart Network Service ===&lt;br /&gt;
 $ sudo systemctl restart NetworkManager   # for systems using NetworkManager&lt;br /&gt;
&lt;br /&gt;
 $ sudo systemctl restart networking       # for systems using networking service&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 down              # bring interface down&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 up                # bring interface back up&lt;br /&gt;
&lt;br /&gt;
== MTR (Matt’s Traceroute) ==&lt;br /&gt;
MTR combines the functionality of ping and traceroute into a single real-time network diagnostic tool. It continuously monitors the path between your system and a destination, providing detailed statistics about latency and packet loss at each hop. When you need to demonstrate a network problem that is outside your control—to your hosting provider, for example—MTR gives you the evidence you need.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
 $ sudo apt install mtr&lt;br /&gt;
&lt;br /&gt;
=== Basic Usage ===&lt;br /&gt;
 $ mtr google.com                          # interactive mode&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report google.com                 # report mode (10 cycles then exit)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 50 google.com       # specify number of cycles&lt;br /&gt;
&lt;br /&gt;
 $ mtr --tcp google.com                    # use TCP instead of ICMP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --udp google.com                    # use UDP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --no-dns google.com                 # skip DNS resolution (faster)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --show-ips google.com               # show both hostnames and IPs&lt;br /&gt;
&lt;br /&gt;
== Understanding MTR Output ==&lt;br /&gt;
&lt;br /&gt;
==== Sample Output ====&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    10   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
   4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   5.|-- google.com                 0.0%    10   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
&lt;br /&gt;
=== Column Meanings ===&lt;br /&gt;
&#039;&#039;&#039;HOST&#039;&#039;&#039; — Hostname or IP address of each hop in the route.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loss%&#039;&#039;&#039; — Percentage of packets lost at this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Snt&#039;&#039;&#039; — Number of packets sent to this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last&#039;&#039;&#039; — Latency of the most recent packet, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Avg&#039;&#039;&#039; — Average latency across all packets sent, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best&#039;&#039;&#039; — Lowest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wrst&#039;&#039;&#039; — Highest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StDev&#039;&#039;&#039; — Standard deviation of latency measurements—lower values indicate a more stable connection.&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Results ===&lt;br /&gt;
A healthy network shows 0% loss on all hops, stable latency with low StDev values, a gradual latency increase as hop count increases, and consistent response times.&lt;br /&gt;
&lt;br /&gt;
==== Problem Indicators ====&lt;br /&gt;
&#039;&#039;&#039;1. High Packet Loss at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 5.|-- problem-router.net        25.0%    10   45.3  48.2  42.1  65.8  8.4&lt;br /&gt;
If loss continues to the destination, there is a real problem at that router. If loss appears only at that hop but not beyond, the router is likely rate-limiting ICMP responses—a false positive, not a real problem. The rule of thumb: if packet loss appears at hop N but hops N+1, N+2, and beyond show 0% loss, it’s almost certainly ICMP rate limiting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. High Latency at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 3.|-- slow-link.net              0.0%    10  150.3 155.2 148.1 165.8  5.4&lt;br /&gt;
This indicates a network bottleneck, a congested link, geographical distance (intercontinental hops), or slow routing equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. No Response (???)&#039;&#039;&#039;&lt;br /&gt;
 4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
The router at this hop is configured not to respond to ICMP or traceroute packets, or a firewall is blocking diagnostic packets. This is not necessarily a problem if later hops respond normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. High Jitter (StDev)&#039;&#039;&#039;&lt;br /&gt;
 6.|-- unstable.net               0.0%    10   35.3  52.8  28.1  95.2  24.7&lt;br /&gt;
A high StDev (24.7ms in this example) indicates inconsistent latency caused by network congestion or instability. This is particularly noticeable in real-time applications such as VoIP, gaming, and video calls.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Sudden Latency Spike&#039;&#039;&#039;&lt;br /&gt;
 1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
 2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
 3.|-- problematic-hop.net        0.0%    10  180.5 185.2 178.1 195.8  6.4&lt;br /&gt;
 4.|-- next-hop.net               0.0%    10  182.3 187.8 180.5 198.2  6.8&lt;br /&gt;
Hop 3 introduces approximately 170ms of additional latency (jumping from 9ms to 180ms). Everything from hop 3 onward carries that penalty.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Report Mode with Different Output Formats ====&lt;br /&gt;
 $ mtr --report --csv google.com &amp;gt; network-report.csv    # CSV for logging&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report --json google.com                        # JSON for parsing&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report --xml google.com                         # XML format&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-wide google.com                          # wide report, no abbreviations&lt;br /&gt;
&lt;br /&gt;
==== Protocol Selection ====&lt;br /&gt;
 $ mtr google.com                                        # ICMP (default)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --udp google.com                                  # UDP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --tcp google.com                                  # TCP&lt;br /&gt;
&lt;br /&gt;
 $ sudo mtr --tcp --port 443 google.com                  # specific TCP port&lt;br /&gt;
&lt;br /&gt;
 $ sudo mtr --tcp --port 22 remote-server.com            # default TCP port&lt;br /&gt;
&lt;br /&gt;
==== Timing and Duration ====&lt;br /&gt;
 $ mtr --interval 0.5 google.com           # interval between pings (default 1s)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 100 google.com      # extended test, 100 cycles&lt;br /&gt;
&lt;br /&gt;
 $ mtr google.com                          # continuous monitoring (Ctrl+C to stop)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 10 google.com       # quick 10-cycle report&lt;br /&gt;
&lt;br /&gt;
==== Advanced Options ====&lt;br /&gt;
 $ mtr --aslookup google.com               # show Autonomous System (AS) numbers&lt;br /&gt;
&lt;br /&gt;
 $ mtr --max-ttl 20 google.com             # set maximum number of hops&lt;br /&gt;
&lt;br /&gt;
 $ mtr --psize 1000 google.com             # set packet size&lt;br /&gt;
&lt;br /&gt;
 $ mtr --show-ips google.com               # show both IP and hostname&lt;br /&gt;
&lt;br /&gt;
 $ mtr --address 192.168.1.100 google.com  # specify source address&lt;br /&gt;
&lt;br /&gt;
 $ mtr -4 google.com                       # IPv4 only&lt;br /&gt;
&lt;br /&gt;
 $ mtr -6 google.com                       # IPv6 only&lt;br /&gt;
&lt;br /&gt;
=== Interactive Mode Commands ===&lt;br /&gt;
When running MTR in interactive mode (mtr hostname), the following keys are available:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;h&#039;&#039;&#039; — Display help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d&#039;&#039;&#039; — Toggle display mode, cycling through different views.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;n&#039;&#039;&#039; — Toggle between hostnames and IP addresses.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;r&#039;&#039;&#039; — Reset all statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;p&#039;&#039;&#039; — Pause/unpause the display.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;q&#039;&#039;&#039; — Quit MTR.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;u&#039;&#039;&#039; — Switch between ICMP, UDP, and TCP modes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;y&#039;&#039;&#039; — Switch between IPv4 and IPv6.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;o&#039;&#039;&#039; — Toggle field display options.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;j&#039;&#039;&#039; — Toggle latency display.&lt;br /&gt;
&lt;br /&gt;
=== Practical Troubleshooting Scenarios ===&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1: Diagnosing a Slow Website ====&lt;br /&gt;
 $ mtr --report-cycles 100 --no-dns example.com&lt;br /&gt;
Look for high average latency at specific hops, packet loss at the destination, and high StDev values indicating jitter.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2: Testing if a Firewall Blocks SSH ====&lt;br /&gt;
 $ sudo mtr --tcp --port 22 --report-cycles 50 remote-server.com&lt;br /&gt;
If the last hop shows 100% loss but earlier hops are fine, port 22 may be filtered. Run a standard ICMP test for comparison.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3: ISP Performance Issues ====&lt;br /&gt;
 $ mtr --report-cycles 100 8.8.8.8&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 100 1.1.1.1&lt;br /&gt;
If issues appear in the first three or four hops, the problem is likely within your ISP’s network. If issues appear later, the problem lies beyond your ISP.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4: VPN Troubleshooting ====&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; before-vpn.txt   # before VPN&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; after-vpn.txt    # after VPN&lt;br /&gt;
&lt;br /&gt;
 $ diff before-vpn.txt after-vpn.txt                              # compare the two&lt;br /&gt;
&lt;br /&gt;
==== Scenario 5: Gaming/Streaming Performance ====&lt;br /&gt;
 $ mtr --report-cycles 200 game-server.com&lt;br /&gt;
For real-time applications, look for low average latency (under 50ms for gaming), low StDev (under 5ms preferred), and zero packet loss.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 6: Intermittent Connectivity ====&lt;br /&gt;
 $ mtr --report-cycles 500 --interval 1 target.com &amp;gt; long-test.txt   # long-running test&lt;br /&gt;
&lt;br /&gt;
 $ mtr target.com                                                    # real-time monitoring&lt;br /&gt;
&lt;br /&gt;
=== Continuous Monitoring ===&lt;br /&gt;
&lt;br /&gt;
==== Log Network Performance Over Time ====&lt;br /&gt;
 while true; do&lt;br /&gt;
     timestamp=$(date +%Y%m%d-%H%M%S)&lt;br /&gt;
     mtr --report --report-cycles 50 google.com &amp;gt; &amp;quot;mtr-$timestamp.txt&amp;quot;&lt;br /&gt;
     sleep 3600&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Monitor Multiple Destinations ====&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 echo &amp;quot;=== MTR Report $(date) ===&amp;quot; &amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Google DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 8.8.8.8 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Cloudflare DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 1.1.1.1 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Your Server:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 your-server.com &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
&lt;br /&gt;
=== Useful Aliases for .bashrc ===&lt;br /&gt;
 Quick network path analysis&lt;br /&gt;
 alias mtrreport=&#039;mtr --report --report-cycles 50 --no-dns&#039;&lt;br /&gt;
 &lt;br /&gt;
 Monitor connection to Google DNS&lt;br /&gt;
 alias netcheck=&#039;mtr --report-cycles 20 8.8.8.8&#039;&lt;br /&gt;
 &lt;br /&gt;
 Extended network test&lt;br /&gt;
 alias mtrlong=&#039;mtr --report-cycles 100&#039;&lt;br /&gt;
 &lt;br /&gt;
 TCP port 443 test (HTTPS)&lt;br /&gt;
 alias mtrhttps=&#039;sudo mtr --tcp --port 443 --report-cycles 30&#039;&lt;br /&gt;
 &lt;br /&gt;
 Quick comparison of major DNS providers&lt;br /&gt;
 alias dnstest=&#039;echo &amp;quot;Google:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 8.8.8.8 &amp;amp;&amp;amp; echo -e &amp;quot;\nCloudflare:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 1.1.1.1&#039;&lt;br /&gt;
After adding to ~/.bashrc, reload with:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting Tips ===&lt;br /&gt;
&#039;&#039;&#039;Permission issues with TCP mode:&#039;&#039;&#039;&lt;br /&gt;
 Use sudo for TCP on privileged ports&lt;br /&gt;
 $ sudo mtr --tcp --port 443 example.com&lt;br /&gt;
 &lt;br /&gt;
 Or set capabilities (one-time setup)&lt;br /&gt;
 $ sudo setcap cap_net_raw+ep /usr/bin/mtr-packet&lt;br /&gt;
&#039;&#039;&#039;False positives:&#039;&#039;&#039; Packet loss at an intermediate hop but not at the destination is almost always ICMP rate limiting at that router, not a real problem. Example:&lt;br /&gt;
 3.|-- router.isp.net            20.0%    50   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
 4.|-- next-hop.net               0.0%    50   18.5  19.2  17.8  22.1   1.3&lt;br /&gt;
 5.|-- destination.com            0.0%    50   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
Hop 3 shows 20% loss, but hops 4 and 5 show 0%. Traffic is flowing normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DNS resolution delays:&#039;&#039;&#039; If MTR is slow to start, skip DNS resolution with mtr --no-dns target.com and resolve addresses afterward with host 203.0.113.1 if needed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Comparing results:&#039;&#039;&#039;&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test1.txt&lt;br /&gt;
 $ sleep 60&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test2.txt&lt;br /&gt;
 $ diff test1.txt test2.txt&lt;br /&gt;
&lt;br /&gt;
=== When to Use MTR vs Other Tools ===&lt;br /&gt;
&#039;&#039;&#039;MTR&#039;&#039;&#039; — Best for continuous monitoring, identifying problem hops, and gathering detailed statistics. Requires installation via apt.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ping&#039;&#039;&#039; — Best for a quick connectivity test or simple latency check. Only tests the endpoint, not the path.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;traceroute&#039;&#039;&#039; — Best for one-time path discovery. Provides no continuous monitoring.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ss / netstat&#039;&#039;&#039; — Best for checking local connection status. Doesn’t test remote paths.&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
Run at least 50–100 cycles for accurate statistics. Use --no-dns for faster results and to avoid DNS resolution issues during testing. Test at different times of day, since network conditions vary. If one protocol shows issues, compare ICMP, UDP, and TCP modes. Save reports with timestamps for trend analysis. Use 8.8.8.8 or 1.1.1.1 as known-good hosts to verify your local network first. Let MTR run for at least 30–60 seconds before drawing conclusions.&lt;br /&gt;
&lt;br /&gt;
=== Reading Between the Lines ===&lt;br /&gt;
&#039;&#039;&#039;Good network health:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.1   1.2   0.9   2.1   0.2&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    50    8.2   8.5   7.5  10.2   0.5&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    50   15.1  15.5  14.0  18.3   0.8&lt;br /&gt;
   4.|-- google.com                 0.0%    50   24.8  25.2  23.5  28.1   1.1&lt;br /&gt;
No packet loss, consistent latency, low jitter throughout.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problematic network:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.2   1.5   1.0   2.3   0.3&lt;br /&gt;
   2.|-- 10.0.0.1                   5.0%    50   45.3  52.8  8.1  245.2  45.7&lt;br /&gt;
   3.|-- ???                       100.0%   50    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   4.|-- destination.com           15.0%    50   95.4 125.8  48.2 385.5  78.2&lt;br /&gt;
Packet loss at hop 2 and the destination, high jitter, and a very high worst-case latency all point to a genuine problem at or near hop 2.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
MTR is your friend when it comes to diagnostics. Use --report-cycles 50 or higher for reliable data. Watch for packet loss at the destination—intermediate losses may be false positives. High StDev indicates an unstable connection. High average latency points to slow links. Use --no-dns for faster results. Compare ICMP, UDP, and TCP modes if issues appear. Test at different times of day for a complete picture.&lt;br /&gt;
== Package Management Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Fix Broken Packages ===&lt;br /&gt;
 $ sudo apt update                     # update package lists&lt;br /&gt;
 $ sudo apt --fix-broken install       # fix broken dependencies&lt;br /&gt;
 $ sudo dpkg --configure -a            # reconfigure packages (no output = nothing to do)&lt;br /&gt;
 $ sudo apt clean                      # clean package cache&lt;br /&gt;
 $ sudo apt autoclean&lt;br /&gt;
 $ sudo apt autoremove                 # remove unused packages&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # Fix broken dependencies&lt;br /&gt;
 sudo apt --fix-broken install&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure packages&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
 # No output means there is nothing to reconfigure&lt;br /&gt;
 &lt;br /&gt;
 # Clean package cache&lt;br /&gt;
 sudo apt clean&lt;br /&gt;
 sudo apt autoclean&lt;br /&gt;
 &lt;br /&gt;
 # Remove unused packages&lt;br /&gt;
 sudo apt autoremove&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 # If apt is locked, find the process holding the lock&lt;br /&gt;
 sudo lsof /var/lib/dpkg/lock-frontend&lt;br /&gt;
 &lt;br /&gt;
 # Remove the lock (use with caution—only if no package manager is running)&lt;br /&gt;
 sudo rm /var/lib/dpkg/lock-frontend&lt;br /&gt;
 sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure dpkg&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
Disk &amp;amp; Filesystem Issues&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 # Check disk space&lt;br /&gt;
 df -h&lt;br /&gt;
 &lt;br /&gt;
 # Check inode usage&lt;br /&gt;
 df -i&lt;br /&gt;
 &lt;br /&gt;
 # View disk I/O statistics&lt;br /&gt;
 # iostat is part of the sysstat package, which also includes:&lt;br /&gt;
 # mpstat (CPU statistics), sar (system activity reporter),&lt;br /&gt;
 # pidstat (process statistics), and cifsiostat (CIFS statistics)&lt;br /&gt;
 sudo apt install sysstat&lt;br /&gt;
 &lt;br /&gt;
 iostat -x 1&lt;br /&gt;
 &lt;br /&gt;
 # Show stats in MB instead of KB&lt;br /&gt;
 iostat -xm 2&lt;br /&gt;
 &lt;br /&gt;
 # Monitor a specific device&lt;br /&gt;
 iostat -x sda 1&lt;br /&gt;
 &lt;br /&gt;
 # Check for disk errors in dmesg&lt;br /&gt;
 sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # SMART disk health (requires smartmontools)&lt;br /&gt;
 sudo apt install smartmontools&lt;br /&gt;
 sudo smartctl -a /dev/sda&lt;br /&gt;
&lt;br /&gt;
=== Repair Filesystem ===&lt;br /&gt;
 # Unmount the partition first&lt;br /&gt;
 sudo umount /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Run filesystem check&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # For ext4 specifically&lt;br /&gt;
 sudo e2fsck -f /dev/sdXN&lt;br /&gt;
Performance Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Resource Hogs ===&lt;br /&gt;
 # CPU usage by process&lt;br /&gt;
 top -o %CPU&lt;br /&gt;
 &lt;br /&gt;
 # Memory usage by process&lt;br /&gt;
 top -o %MEM&lt;br /&gt;
 &lt;br /&gt;
 # Disk usage by directory&lt;br /&gt;
 du -sh /* | sort -h&lt;br /&gt;
 &lt;br /&gt;
 # Find large files&lt;br /&gt;
 find / -type f -size +100M 2&amp;gt;/dev/null&lt;br /&gt;
 &lt;br /&gt;
 # Check running processes sorted by memory use&lt;br /&gt;
 ps aux --sort=-%mem | head -20&lt;br /&gt;
&lt;br /&gt;
=== System Temperature Monitoring ===&lt;br /&gt;
 # Install lm-sensors if not already present&lt;br /&gt;
 sudo apt install lm-sensors&lt;br /&gt;
 sudo sensors-detect&lt;br /&gt;
 &lt;br /&gt;
 # View temperatures&lt;br /&gt;
 sensors&lt;br /&gt;
 &lt;br /&gt;
 # Real-time temperature monitoring&lt;br /&gt;
 watch -n 2 sensors&lt;br /&gt;
See section 12 for a shell alias that makes temperature monitoring more convenient.&lt;br /&gt;
&lt;br /&gt;
Service &amp;amp; Application Errors&lt;br /&gt;
&lt;br /&gt;
=== Debug Service Problems ===&lt;br /&gt;
 # Check service status&lt;br /&gt;
 sudo systemctl status service-name&lt;br /&gt;
 &lt;br /&gt;
 # View service logs&lt;br /&gt;
 sudo journalctl -u service-name&lt;br /&gt;
 &lt;br /&gt;
 # Restart a service&lt;br /&gt;
 sudo systemctl restart service-name&lt;br /&gt;
 &lt;br /&gt;
 # Enable service at boot&lt;br /&gt;
 sudo systemctl enable service-name&lt;br /&gt;
 &lt;br /&gt;
 # View recent service failures&lt;br /&gt;
 journalctl -p err -b&lt;br /&gt;
&lt;br /&gt;
=== Application Crash Investigation ===&lt;br /&gt;
 # Check for core dumps&lt;br /&gt;
 ls -lh /var/crash/&lt;br /&gt;
 &lt;br /&gt;
 # View available application logs&lt;br /&gt;
 ls /var/log/&lt;br /&gt;
 &lt;br /&gt;
 # Follow syslog for application errors in real-time&lt;br /&gt;
 sudo tail -f /var/log/syslog&lt;br /&gt;
Permission &amp;amp; Access Issues&lt;br /&gt;
&lt;br /&gt;
=== Fix Common Permission Problems ===&lt;br /&gt;
 # Check file ownership&lt;br /&gt;
 ls -l /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change ownership (user:group)&lt;br /&gt;
 sudo chown user:group /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change permissions&lt;br /&gt;
 sudo chmod 644 /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Recursively fix permissions on a directory&lt;br /&gt;
 sudo chown -R user:group /path/to/directory&lt;br /&gt;
&lt;br /&gt;
=== User &amp;amp; Authentication Issues ===&lt;br /&gt;
 # Check user information&lt;br /&gt;
 id username&lt;br /&gt;
 &lt;br /&gt;
 # View user login history&lt;br /&gt;
 last -a&lt;br /&gt;
 &lt;br /&gt;
 # Check failed login attempts&lt;br /&gt;
 sudo journalctl | grep &amp;quot;authentication failure&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Reset user password&lt;br /&gt;
 sudo passwd username&lt;br /&gt;
Hardware Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Hardware ===&lt;br /&gt;
 # List all hardware (install if needed: sudo apt install lshw)&lt;br /&gt;
 sudo lshw -short&lt;br /&gt;
 &lt;br /&gt;
 # PCI devices&lt;br /&gt;
 lspci -v&lt;br /&gt;
 &lt;br /&gt;
 # USB devices&lt;br /&gt;
 lsusb -v&lt;br /&gt;
 &lt;br /&gt;
 # CPU information&lt;br /&gt;
 lscpu&lt;br /&gt;
 &lt;br /&gt;
 # Memory information&lt;br /&gt;
 sudo dmidecode --type memory&lt;br /&gt;
&lt;br /&gt;
=== Check Hardware Errors ===&lt;br /&gt;
 # Kernel ring buffer (hardware messages)&lt;br /&gt;
 dmesg | less&lt;br /&gt;
 # Press q to quit&lt;br /&gt;
 &lt;br /&gt;
 # Search for specific hardware issues&lt;br /&gt;
 dmesg | grep -i &amp;quot;error\|fail\|warn&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Check for USB issues&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
Quick Diagnostic Commands&lt;br /&gt;
&lt;br /&gt;
=== System Information at a Glance ===&lt;br /&gt;
 # Uptime and load average&lt;br /&gt;
 uptime&lt;br /&gt;
 &lt;br /&gt;
 # Kernel version&lt;br /&gt;
 uname -r&lt;br /&gt;
 &lt;br /&gt;
 # Debian version&lt;br /&gt;
 cat /etc/debian_version&lt;br /&gt;
 &lt;br /&gt;
 # Full system summary (install if needed: sudo apt install inxi)&lt;br /&gt;
 sudo inxi -Fxz&lt;br /&gt;
&lt;br /&gt;
=== Emergency Toolkit ===&lt;br /&gt;
 # Create a consolidated diagnostic report&lt;br /&gt;
 sudo journalctl -b &amp;gt; ~/system-report.txt&lt;br /&gt;
 dmesg &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 systemctl --failed &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 df -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 free -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 &lt;br /&gt;
 # Watch logs in real-time&lt;br /&gt;
 sudo journalctl -f&lt;br /&gt;
 &lt;br /&gt;
 # Monitor system resources continuously&lt;br /&gt;
 watch -n 1 &#039;free -h &amp;amp;&amp;amp; df -h&#039;&lt;br /&gt;
Useful Aliases &amp;amp; Shortcuts&lt;br /&gt;
Add these to your ~/.bashrc for quick access to common troubleshooting commands:&lt;br /&gt;
 # Monitor system temperatures in real-time&lt;br /&gt;
 alias temps=&amp;quot;watch -n 2 &#039;for i in /sys/class/hwmon/hwmon*/; do echo -n \&amp;quot;\$(cat \${i}name): \&amp;quot;; cat \${i}temp*_input 2&amp;gt;/dev/null | while read temp; do echo \&amp;quot;scale=1; \$temp/1000\&amp;quot; | bc; done | tr \&amp;quot;\n\&amp;quot; \&amp;quot; \&amp;quot;; echo \&amp;quot;°C\&amp;quot;; done&#039;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Quick system status&lt;br /&gt;
 alias sysstat=&#039;echo &amp;quot;=== CPU ===&amp;quot; &amp;amp;&amp;amp; uptime &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Memory ===&amp;quot; &amp;amp;&amp;amp; free -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Disk ===&amp;quot; &amp;amp;&amp;amp; df -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Top Processes ===&amp;quot; &amp;amp;&amp;amp; ps aux --sort=-%mem | head -10&#039;&lt;br /&gt;
 &lt;br /&gt;
 # View last boot logs&lt;br /&gt;
 alias lastboot=&#039;journalctl -b -1&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Check failed services&lt;br /&gt;
 alias failedservices=&#039;systemctl --failed&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Monitor logs in real-time&lt;br /&gt;
 alias watchlog=&#039;sudo journalctl -f&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Quick network status&lt;br /&gt;
 alias netstatus=&#039;ip addr show &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Routes ===&amp;quot; &amp;amp;&amp;amp; ip route show&#039;&lt;br /&gt;
After adding these, reload your shell configuration:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
Tips for Effective Troubleshooting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check logs first.&#039;&#039;&#039; journalctl and dmesg are your best starting point for almost any problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Change one thing at a time.&#039;&#039;&#039; It’s tempting to make several changes at once, but doing so makes it impossible to know what actually fixed—or broke—the problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Document your changes.&#039;&#039;&#039; Keep notes on what you’ve tried and what the results were. You’ll thank yourself later.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use exact error messages.&#039;&#039;&#039; Copy error messages verbatim and search for them alongside “Debian” and the version number—for example, “Debian 13” or “Debian 13.1” for point releases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check what changed recently.&#039;&#039;&#039; Did you install something, update packages, or change the kernel before the problem appeared? Start there.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Back up before making major changes.&#039;&#039;&#039; This goes without saying, but it’s easy to skip when you’re in a hurry.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use verbose mode.&#039;&#039;&#039; Adding -v or -vv flags to commands often reveals what would otherwise be silent failures.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the community.&#039;&#039;&#039; The Debian forums, Reddit, Stack Exchange, and the Debian mailing lists are all active and well-indexed. Someone has usually seen your problem before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by &amp;lt;dfn&amp;gt;distro-nix&amp;lt;/dfn&amp;gt; to the Debian User Forums on 2025-10-27.&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=270</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=270"/>
		<updated>2026-05-15T22:14:45Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: Pasting more sections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Author:&#039;&#039;&#039; distro-nix &#039;&#039;&#039;Forum Profile:&#039;&#039;&#039; &amp;lt;dfn&amp;gt;&amp;lt;nowiki&amp;gt;https://forums.debian.net/memberlist.php?mode=viewprofile&amp;amp;u=239099&amp;lt;/nowiki&amp;gt;&amp;lt;/dfn&amp;gt; &#039;&#039;&#039;Debian Version:&#039;&#039;&#039; Debian 13 (Trixie) &#039;&#039;&#039;Kernel Versions Tested:&#039;&#039;&#039; 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64 (x86_64) &#039;&#039;&#039;Created:&#039;&#039;&#039; 2025-10-27 &#039;&#039;&#039;Last Updated:&#039;&#039;&#039; 2026-03-11 &#039;&#039;&#039;ID:&#039;&#039;&#039; 544201 &#039;&#039;&#039;License:&#039;&#039;&#039; CC BY-SA 4.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This guide is preserved in its original form. Questions and feedback welcome via the author’s &amp;lt;dfn&amp;gt;Debian Forums profile&amp;lt;/dfn&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The Debian First Aid Kit is a practical reference for diagnosing and resolving common system problems on Debian GNU/Linux. It covers commonly occuring categories of failure: system freezes and crashes, boot problems, network issues, package management, disk and filesystem errors, performance degradation, service and application failures, permission and access problems, hardware identification and errors, and quick diagnostics. Each section gives the relevant commands so you can understand what they do and why, rather than a bare list to copy and paste blindly. A dedicated section covers MTR (Matt’s Traceroute) in depth, including output interpretation, practical troubleshooting, and how to monitor continuously. The guide also includes a set of shell aliases for faster access to common diagnostic tasks. All commands are verified on Debian 13 (Trixie) running kernel 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64. This document is intended for users with basic command-line familiarity who need a reliable, consolidated reference when something goes wrong.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Keywords:&#039;&#039;&#039; Debian, troubleshooting, system administration, MTR, network diagnostics, package management, journalctl, filesystem repair&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tested Commands Disclaimer ==&lt;br /&gt;
All commands in this document have been verified on Debian 13 (Trixie) with the kernel versions listed above. Results may vary on other releases or hardware configurations. Always test in a safe environment before applying any procedure to a production system.&lt;br /&gt;
&lt;br /&gt;
== Conventions Used in This Document ==&lt;br /&gt;
Command examples throughout this guide follow standard Unix prompt conventions. A $ prefix indicates a command run as a regular user. Where elevated privileges are required, sudo is shown explicitly and # with a brief explanation if needed:&lt;br /&gt;
 $ journalctl -b -1          # regular user&lt;br /&gt;
 $ sudo apt install mtr      # requires elevation via sudo&lt;br /&gt;
In recovery shell contexts, where you are operating directly as root, the prompt is #.&lt;br /&gt;
&lt;br /&gt;
== System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics:&#039;&#039;&#039; Search for “kernel panic” or “Oops”&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM):&#039;&#039;&#039; Search for “Out of memory” or “oom-killer”&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors:&#039;&#039;&#039; Look for “MCE” (Machine Check Exception) or “hardware error”&lt;br /&gt;
* &#039;&#039;&#039;Driver issues:&#039;&#039;&#039; Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating:&#039;&#039;&#039; Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 $ free -h                      # memory usage&lt;br /&gt;
&lt;br /&gt;
 $ df -h                        # disk space&lt;br /&gt;
&lt;br /&gt;
 $ htop                         # interactive resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ top                          # alternative resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt install btop        # btop is a more detailed alternative&lt;br /&gt;
&lt;br /&gt;
 $ sudo dmesg | grep -i error   # check for disk errors&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN         # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX  # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub            # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab              # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
The following are permanent errors caused by incomplete or buggy ACPI tables in the BIOS. They are harmless and can be safely ignored if they appear on your system:&lt;br /&gt;
 [0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&lt;br /&gt;
 [0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&lt;br /&gt;
 [0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&lt;br /&gt;
&lt;br /&gt;
== Boot Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Check Boot Process ===&lt;br /&gt;
 $ systemd-analyze blame            # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemd-analyze blame            # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemctl --failed               # units that failed during boot&lt;br /&gt;
&lt;br /&gt;
 $ systemctl status &amp;lt;service-name&amp;gt;  # e.g. systemctl status NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN              # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX       # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub                 # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab                   # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
== Network Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose Network Connection ===&lt;br /&gt;
 $ ip addr show                         # check network interfaces&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 4 8.8.8.8                    # test IPv4 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 6 2a00:1450:4007:809::200e   # test IPv6 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ nslookup google.com                  # check DNS resolution&lt;br /&gt;
&lt;br /&gt;
 $ ip route show                        # view routing table&lt;br /&gt;
&lt;br /&gt;
 $ ss -tuln                             # check active connections &lt;br /&gt;
&lt;br /&gt;
=== Restart Network Service ===&lt;br /&gt;
 $ sudo systemctl restart NetworkManager   # for systems using NetworkManager&lt;br /&gt;
&lt;br /&gt;
 $ sudo systemctl restart networking       # for systems using networking service&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 down              # bring interface down&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 up                # bring interface back up&lt;br /&gt;
&lt;br /&gt;
== MTR (Matt’s Traceroute) ==&lt;br /&gt;
MTR combines the functionality of ping and traceroute into a single real-time network diagnostic tool. It continuously monitors the path between your system and a destination, providing detailed statistics about latency and packet loss at each hop. When you need to demonstrate a network problem that is outside your control—to your hosting provider, for example—MTR gives you the evidence you need.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
 $ sudo apt install mtr&lt;br /&gt;
&lt;br /&gt;
=== Basic Usage ===&lt;br /&gt;
 $ mtr google.com                          # interactive mode&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report google.com                 # report mode (10 cycles then exit)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 50 google.com       # specify number of cycles&lt;br /&gt;
&lt;br /&gt;
 $ mtr --tcp google.com                    # use TCP instead of ICMP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --udp google.com                    # use UDP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --no-dns google.com                 # skip DNS resolution (faster)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --show-ips google.com               # show both hostnames and IPs&lt;br /&gt;
&lt;br /&gt;
== Understanding MTR Output ==&lt;br /&gt;
&lt;br /&gt;
==== Sample Output ====&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    10   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
   4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   5.|-- google.com                 0.0%    10   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
&lt;br /&gt;
=== Column Meanings ===&lt;br /&gt;
&#039;&#039;&#039;HOST&#039;&#039;&#039; — Hostname or IP address of each hop in the route.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loss%&#039;&#039;&#039; — Percentage of packets lost at this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Snt&#039;&#039;&#039; — Number of packets sent to this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last&#039;&#039;&#039; — Latency of the most recent packet, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Avg&#039;&#039;&#039; — Average latency across all packets sent, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best&#039;&#039;&#039; — Lowest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wrst&#039;&#039;&#039; — Highest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StDev&#039;&#039;&#039; — Standard deviation of latency measurements—lower values indicate a more stable connection.&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Results ===&lt;br /&gt;
A healthy network shows 0% loss on all hops, stable latency with low StDev values, a gradual latency increase as hop count increases, and consistent response times.&lt;br /&gt;
&lt;br /&gt;
==== Problem Indicators ====&lt;br /&gt;
&#039;&#039;&#039;1. High Packet Loss at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 5.|-- problem-router.net        25.0%    10   45.3  48.2  42.1  65.8  8.4&lt;br /&gt;
If loss continues to the destination, there is a real problem at that router. If loss appears only at that hop but not beyond, the router is likely rate-limiting ICMP responses—a false positive, not a real problem. The rule of thumb: if packet loss appears at hop N but hops N+1, N+2, and beyond show 0% loss, it’s almost certainly ICMP rate limiting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. High Latency at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 3.|-- slow-link.net              0.0%    10  150.3 155.2 148.1 165.8  5.4&lt;br /&gt;
This indicates a network bottleneck, a congested link, geographical distance (intercontinental hops), or slow routing equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. No Response (???)&#039;&#039;&#039;&lt;br /&gt;
 4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
The router at this hop is configured not to respond to ICMP or traceroute packets, or a firewall is blocking diagnostic packets. This is not necessarily a problem if later hops respond normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. High Jitter (StDev)&#039;&#039;&#039;&lt;br /&gt;
 6.|-- unstable.net               0.0%    10   35.3  52.8  28.1  95.2  24.7&lt;br /&gt;
A high StDev (24.7ms in this example) indicates inconsistent latency caused by network congestion or instability. This is particularly noticeable in real-time applications such as VoIP, gaming, and video calls.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Sudden Latency Spike&#039;&#039;&#039;&lt;br /&gt;
 1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
 2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
 3.|-- problematic-hop.net        0.0%    10  180.5 185.2 178.1 195.8  6.4&lt;br /&gt;
 4.|-- next-hop.net               0.0%    10  182.3 187.8 180.5 198.2  6.8&lt;br /&gt;
Hop 3 introduces approximately 170ms of additional latency (jumping from 9ms to 180ms). Everything from hop 3 onward carries that penalty.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Report Mode with Different Output Formats ====&lt;br /&gt;
 $ mtr --report --csv google.com &amp;gt; network-report.csv    # CSV for logging&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report --json google.com                        # JSON for parsing&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report --xml google.com                         # XML format&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-wide google.com                          # wide report, no abbreviations&lt;br /&gt;
&lt;br /&gt;
==== Protocol Selection ====&lt;br /&gt;
 $ mtr google.com                                        # ICMP (default)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --udp google.com                                  # UDP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --tcp google.com                                  # TCP&lt;br /&gt;
&lt;br /&gt;
 $ sudo mtr --tcp --port 443 google.com                  # specific TCP port&lt;br /&gt;
&lt;br /&gt;
 $ sudo mtr --tcp --port 22 remote-server.com            # default TCP port&lt;br /&gt;
&lt;br /&gt;
==== Timing and Duration ====&lt;br /&gt;
 $ mtr --interval 0.5 google.com           # interval between pings (default 1s)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 100 google.com      # extended test, 100 cycles&lt;br /&gt;
&lt;br /&gt;
 $ mtr google.com                          # continuous monitoring (Ctrl+C to stop)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 10 google.com       # quick 10-cycle report&lt;br /&gt;
&lt;br /&gt;
==== Advanced Options ====&lt;br /&gt;
 $ mtr --aslookup google.com               # show Autonomous System (AS) numbers&lt;br /&gt;
&lt;br /&gt;
 $ mtr --max-ttl 20 google.com             # set maximum number of hops&lt;br /&gt;
&lt;br /&gt;
 $ mtr --psize 1000 google.com             # set packet size&lt;br /&gt;
&lt;br /&gt;
 $ mtr --show-ips google.com               # show both IP and hostname&lt;br /&gt;
&lt;br /&gt;
 $ mtr --address 192.168.1.100 google.com  # specify source address&lt;br /&gt;
&lt;br /&gt;
 $ mtr -4 google.com                       # IPv4 only&lt;br /&gt;
&lt;br /&gt;
 $ mtr -6 google.com                       # IPv6 only&lt;br /&gt;
&lt;br /&gt;
=== Interactive Mode Commands ===&lt;br /&gt;
When running MTR in interactive mode (mtr hostname), the following keys are available:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;h&#039;&#039;&#039; — Display help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d&#039;&#039;&#039; — Toggle display mode, cycling through different views.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;n&#039;&#039;&#039; — Toggle between hostnames and IP addresses.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;r&#039;&#039;&#039; — Reset all statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;p&#039;&#039;&#039; — Pause/unpause the display.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;q&#039;&#039;&#039; — Quit MTR.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;u&#039;&#039;&#039; — Switch between ICMP, UDP, and TCP modes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;y&#039;&#039;&#039; — Switch between IPv4 and IPv6.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;o&#039;&#039;&#039; — Toggle field display options.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;j&#039;&#039;&#039; — Toggle latency display.&lt;br /&gt;
&lt;br /&gt;
=== Practical Troubleshooting Scenarios ===&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1: Diagnosing a Slow Website ====&lt;br /&gt;
 $ mtr --report-cycles 100 --no-dns example.com&lt;br /&gt;
Look for high average latency at specific hops, packet loss at the destination, and high StDev values indicating jitter.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2: Testing if a Firewall Blocks SSH ====&lt;br /&gt;
 $ sudo mtr --tcp --port 22 --report-cycles 50 remote-server.com&lt;br /&gt;
If the last hop shows 100% loss but earlier hops are fine, port 22 may be filtered. Run a standard ICMP test for comparison.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3: ISP Performance Issues ====&lt;br /&gt;
 $ mtr --report-cycles 100 8.8.8.8&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 100 1.1.1.1&lt;br /&gt;
If issues appear in the first three or four hops, the problem is likely within your ISP’s network. If issues appear later, the problem lies beyond your ISP.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4: VPN Troubleshooting ====&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; before-vpn.txt   # before VPN&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; after-vpn.txt    # after VPN&lt;br /&gt;
&lt;br /&gt;
 $ diff before-vpn.txt after-vpn.txt                              # compare the two&lt;br /&gt;
&lt;br /&gt;
==== Scenario 5: Gaming/Streaming Performance ====&lt;br /&gt;
 $ mtr --report-cycles 200 game-server.com&lt;br /&gt;
For real-time applications, look for low average latency (under 50ms for gaming), low StDev (under 5ms preferred), and zero packet loss.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 6: Intermittent Connectivity ====&lt;br /&gt;
 $ mtr --report-cycles 500 --interval 1 target.com &amp;gt; long-test.txt   # long-running test&lt;br /&gt;
&lt;br /&gt;
 $ mtr target.com                                                    # real-time monitoring&lt;br /&gt;
&lt;br /&gt;
=== Continuous Monitoring ===&lt;br /&gt;
&lt;br /&gt;
==== Log Network Performance Over Time ====&lt;br /&gt;
 while true; do&lt;br /&gt;
     timestamp=$(date +%Y%m%d-%H%M%S)&lt;br /&gt;
     mtr --report --report-cycles 50 google.com &amp;gt; &amp;quot;mtr-$timestamp.txt&amp;quot;&lt;br /&gt;
     sleep 3600&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Monitor Multiple Destinations ====&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 echo &amp;quot;=== MTR Report $(date) ===&amp;quot; &amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Google DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 8.8.8.8 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Cloudflare DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 1.1.1.1 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Your Server:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 your-server.com &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
&lt;br /&gt;
=== Useful Aliases for .bashrc ===&lt;br /&gt;
 Quick network path analysis&lt;br /&gt;
 alias mtrreport=&#039;mtr --report --report-cycles 50 --no-dns&#039;&lt;br /&gt;
 &lt;br /&gt;
 Monitor connection to Google DNS&lt;br /&gt;
 alias netcheck=&#039;mtr --report-cycles 20 8.8.8.8&#039;&lt;br /&gt;
 &lt;br /&gt;
 Extended network test&lt;br /&gt;
 alias mtrlong=&#039;mtr --report-cycles 100&#039;&lt;br /&gt;
 &lt;br /&gt;
 TCP port 443 test (HTTPS)&lt;br /&gt;
 alias mtrhttps=&#039;sudo mtr --tcp --port 443 --report-cycles 30&#039;&lt;br /&gt;
 &lt;br /&gt;
 Quick comparison of major DNS providers&lt;br /&gt;
 alias dnstest=&#039;echo &amp;quot;Google:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 8.8.8.8 &amp;amp;&amp;amp; echo -e &amp;quot;\nCloudflare:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 1.1.1.1&#039;&lt;br /&gt;
After adding to ~/.bashrc, reload with:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting Tips ===&lt;br /&gt;
&#039;&#039;&#039;Permission issues with TCP mode:&#039;&#039;&#039;&lt;br /&gt;
 Use sudo for TCP on privileged ports&lt;br /&gt;
 $ sudo mtr --tcp --port 443 example.com&lt;br /&gt;
 &lt;br /&gt;
 Or set capabilities (one-time setup)&lt;br /&gt;
 $ sudo setcap cap_net_raw+ep /usr/bin/mtr-packet&lt;br /&gt;
&#039;&#039;&#039;False positives:&#039;&#039;&#039; Packet loss at an intermediate hop but not at the destination is almost always ICMP rate limiting at that router, not a real problem. Example:&lt;br /&gt;
 3.|-- router.isp.net            20.0%    50   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
 4.|-- next-hop.net               0.0%    50   18.5  19.2  17.8  22.1   1.3&lt;br /&gt;
 5.|-- destination.com            0.0%    50   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
Hop 3 shows 20% loss, but hops 4 and 5 show 0%. Traffic is flowing normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DNS resolution delays:&#039;&#039;&#039; If MTR is slow to start, skip DNS resolution with mtr --no-dns target.com and resolve addresses afterward with host 203.0.113.1 if needed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Comparing results:&#039;&#039;&#039;&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test1.txt&lt;br /&gt;
 $ sleep 60&lt;br /&gt;
 $ mtr --report --report-cycles 50 example.com &amp;gt; test2.txt&lt;br /&gt;
 $ diff test1.txt test2.txt&lt;br /&gt;
&lt;br /&gt;
=== When to Use MTR vs Other Tools ===&lt;br /&gt;
&#039;&#039;&#039;MTR&#039;&#039;&#039; — Best for continuous monitoring, identifying problem hops, and gathering detailed statistics. Requires installation via apt.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ping&#039;&#039;&#039; — Best for a quick connectivity test or simple latency check. Only tests the endpoint, not the path.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;traceroute&#039;&#039;&#039; — Best for one-time path discovery. Provides no continuous monitoring.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ss / netstat&#039;&#039;&#039; — Best for checking local connection status. Doesn’t test remote paths.&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
Run at least 50–100 cycles for accurate statistics. Use --no-dns for faster results and to avoid DNS resolution issues during testing. Test at different times of day, since network conditions vary. If one protocol shows issues, compare ICMP, UDP, and TCP modes. Save reports with timestamps for trend analysis. Use 8.8.8.8 or 1.1.1.1 as known-good hosts to verify your local network first. Let MTR run for at least 30–60 seconds before drawing conclusions.&lt;br /&gt;
&lt;br /&gt;
=== Reading Between the Lines ===&lt;br /&gt;
&#039;&#039;&#039;Good network health:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.1   1.2   0.9   2.1   0.2&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    50    8.2   8.5   7.5  10.2   0.5&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    50   15.1  15.5  14.0  18.3   0.8&lt;br /&gt;
   4.|-- google.com                 0.0%    50   24.8  25.2  23.5  28.1   1.1&lt;br /&gt;
No packet loss, consistent latency, low jitter throughout.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problematic network:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.2   1.5   1.0   2.3   0.3&lt;br /&gt;
   2.|-- 10.0.0.1                   5.0%    50   45.3  52.8  8.1  245.2  45.7&lt;br /&gt;
   3.|-- ???                       100.0%   50    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   4.|-- destination.com           15.0%    50   95.4 125.8  48.2 385.5  78.2&lt;br /&gt;
Packet loss at hop 2 and the destination, high jitter, and a very high worst-case latency all point to a genuine problem at or near hop 2.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
MTR is your friend when it comes to diagnostics. Use --report-cycles 50 or higher for reliable data. Watch for packet loss at the destination—intermediate losses may be false positives. High StDev indicates an unstable connection. High average latency points to slow links. Use --no-dns for faster results. Compare ICMP, UDP, and TCP modes if issues appear. Test at different times of day for a complete picture.&lt;br /&gt;
== Package Management Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Fix Broken Packages ===&lt;br /&gt;
 $ sudo apt update                     # update package lists&lt;br /&gt;
 $ sudo apt --fix-broken install       # fix broken dependencies&lt;br /&gt;
 $ sudo dpkg --configure -a            # reconfigure packages (no output = nothing to do)&lt;br /&gt;
 $ sudo apt clean                      # clean package cache&lt;br /&gt;
 $ sudo apt autoclean&lt;br /&gt;
 $ sudo apt autoremove                 # remove unused packages&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # Fix broken dependencies&lt;br /&gt;
 sudo apt --fix-broken install&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure packages&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
 # No output means there is nothing to reconfigure&lt;br /&gt;
 &lt;br /&gt;
 # Clean package cache&lt;br /&gt;
 sudo apt clean&lt;br /&gt;
 sudo apt autoclean&lt;br /&gt;
 &lt;br /&gt;
 # Remove unused packages&lt;br /&gt;
 sudo apt autoremove&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 # If apt is locked, find the process holding the lock&lt;br /&gt;
 sudo lsof /var/lib/dpkg/lock-frontend&lt;br /&gt;
 &lt;br /&gt;
 # Remove the lock (use with caution—only if no package manager is running)&lt;br /&gt;
 sudo rm /var/lib/dpkg/lock-frontend&lt;br /&gt;
 sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure dpkg&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
Disk &amp;amp; Filesystem Issues&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 # Check disk space&lt;br /&gt;
 df -h&lt;br /&gt;
 &lt;br /&gt;
 # Check inode usage&lt;br /&gt;
 df -i&lt;br /&gt;
 &lt;br /&gt;
 # View disk I/O statistics&lt;br /&gt;
 # iostat is part of the sysstat package, which also includes:&lt;br /&gt;
 # mpstat (CPU statistics), sar (system activity reporter),&lt;br /&gt;
 # pidstat (process statistics), and cifsiostat (CIFS statistics)&lt;br /&gt;
 sudo apt install sysstat&lt;br /&gt;
 &lt;br /&gt;
 iostat -x 1&lt;br /&gt;
 &lt;br /&gt;
 # Show stats in MB instead of KB&lt;br /&gt;
 iostat -xm 2&lt;br /&gt;
 &lt;br /&gt;
 # Monitor a specific device&lt;br /&gt;
 iostat -x sda 1&lt;br /&gt;
 &lt;br /&gt;
 # Check for disk errors in dmesg&lt;br /&gt;
 sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # SMART disk health (requires smartmontools)&lt;br /&gt;
 sudo apt install smartmontools&lt;br /&gt;
 sudo smartctl -a /dev/sda&lt;br /&gt;
&lt;br /&gt;
=== Repair Filesystem ===&lt;br /&gt;
 # Unmount the partition first&lt;br /&gt;
 sudo umount /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Run filesystem check&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # For ext4 specifically&lt;br /&gt;
 sudo e2fsck -f /dev/sdXN&lt;br /&gt;
Performance Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Resource Hogs ===&lt;br /&gt;
 # CPU usage by process&lt;br /&gt;
 top -o %CPU&lt;br /&gt;
 &lt;br /&gt;
 # Memory usage by process&lt;br /&gt;
 top -o %MEM&lt;br /&gt;
 &lt;br /&gt;
 # Disk usage by directory&lt;br /&gt;
 du -sh /* | sort -h&lt;br /&gt;
 &lt;br /&gt;
 # Find large files&lt;br /&gt;
 find / -type f -size +100M 2&amp;gt;/dev/null&lt;br /&gt;
 &lt;br /&gt;
 # Check running processes sorted by memory use&lt;br /&gt;
 ps aux --sort=-%mem | head -20&lt;br /&gt;
&lt;br /&gt;
=== System Temperature Monitoring ===&lt;br /&gt;
 # Install lm-sensors if not already present&lt;br /&gt;
 sudo apt install lm-sensors&lt;br /&gt;
 sudo sensors-detect&lt;br /&gt;
 &lt;br /&gt;
 # View temperatures&lt;br /&gt;
 sensors&lt;br /&gt;
 &lt;br /&gt;
 # Real-time temperature monitoring&lt;br /&gt;
 watch -n 2 sensors&lt;br /&gt;
See section 12 for a shell alias that makes temperature monitoring more convenient.&lt;br /&gt;
&lt;br /&gt;
Service &amp;amp; Application Errors&lt;br /&gt;
&lt;br /&gt;
=== Debug Service Problems ===&lt;br /&gt;
 # Check service status&lt;br /&gt;
 sudo systemctl status service-name&lt;br /&gt;
 &lt;br /&gt;
 # View service logs&lt;br /&gt;
 sudo journalctl -u service-name&lt;br /&gt;
 &lt;br /&gt;
 # Restart a service&lt;br /&gt;
 sudo systemctl restart service-name&lt;br /&gt;
 &lt;br /&gt;
 # Enable service at boot&lt;br /&gt;
 sudo systemctl enable service-name&lt;br /&gt;
 &lt;br /&gt;
 # View recent service failures&lt;br /&gt;
 journalctl -p err -b&lt;br /&gt;
&lt;br /&gt;
=== Application Crash Investigation ===&lt;br /&gt;
 # Check for core dumps&lt;br /&gt;
 ls -lh /var/crash/&lt;br /&gt;
 &lt;br /&gt;
 # View available application logs&lt;br /&gt;
 ls /var/log/&lt;br /&gt;
 &lt;br /&gt;
 # Follow syslog for application errors in real-time&lt;br /&gt;
 sudo tail -f /var/log/syslog&lt;br /&gt;
Permission &amp;amp; Access Issues&lt;br /&gt;
&lt;br /&gt;
=== Fix Common Permission Problems ===&lt;br /&gt;
 # Check file ownership&lt;br /&gt;
 ls -l /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change ownership (user:group)&lt;br /&gt;
 sudo chown user:group /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change permissions&lt;br /&gt;
 sudo chmod 644 /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Recursively fix permissions on a directory&lt;br /&gt;
 sudo chown -R user:group /path/to/directory&lt;br /&gt;
&lt;br /&gt;
=== User &amp;amp; Authentication Issues ===&lt;br /&gt;
 # Check user information&lt;br /&gt;
 id username&lt;br /&gt;
 &lt;br /&gt;
 # View user login history&lt;br /&gt;
 last -a&lt;br /&gt;
 &lt;br /&gt;
 # Check failed login attempts&lt;br /&gt;
 sudo journalctl | grep &amp;quot;authentication failure&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Reset user password&lt;br /&gt;
 sudo passwd username&lt;br /&gt;
Hardware Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Hardware ===&lt;br /&gt;
 # List all hardware (install if needed: sudo apt install lshw)&lt;br /&gt;
 sudo lshw -short&lt;br /&gt;
 &lt;br /&gt;
 # PCI devices&lt;br /&gt;
 lspci -v&lt;br /&gt;
 &lt;br /&gt;
 # USB devices&lt;br /&gt;
 lsusb -v&lt;br /&gt;
 &lt;br /&gt;
 # CPU information&lt;br /&gt;
 lscpu&lt;br /&gt;
 &lt;br /&gt;
 # Memory information&lt;br /&gt;
 sudo dmidecode --type memory&lt;br /&gt;
&lt;br /&gt;
=== Check Hardware Errors ===&lt;br /&gt;
 # Kernel ring buffer (hardware messages)&lt;br /&gt;
 dmesg | less&lt;br /&gt;
 # Press q to quit&lt;br /&gt;
 &lt;br /&gt;
 # Search for specific hardware issues&lt;br /&gt;
 dmesg | grep -i &amp;quot;error\|fail\|warn&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Check for USB issues&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
Quick Diagnostic Commands&lt;br /&gt;
&lt;br /&gt;
=== System Information at a Glance ===&lt;br /&gt;
 # Uptime and load average&lt;br /&gt;
 uptime&lt;br /&gt;
 &lt;br /&gt;
 # Kernel version&lt;br /&gt;
 uname -r&lt;br /&gt;
 &lt;br /&gt;
 # Debian version&lt;br /&gt;
 cat /etc/debian_version&lt;br /&gt;
 &lt;br /&gt;
 # Full system summary (install if needed: sudo apt install inxi)&lt;br /&gt;
 sudo inxi -Fxz&lt;br /&gt;
&lt;br /&gt;
=== Emergency Toolkit ===&lt;br /&gt;
 # Create a consolidated diagnostic report&lt;br /&gt;
 sudo journalctl -b &amp;gt; ~/system-report.txt&lt;br /&gt;
 dmesg &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 systemctl --failed &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 df -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 free -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 &lt;br /&gt;
 # Watch logs in real-time&lt;br /&gt;
 sudo journalctl -f&lt;br /&gt;
 &lt;br /&gt;
 # Monitor system resources continuously&lt;br /&gt;
 watch -n 1 &#039;free -h &amp;amp;&amp;amp; df -h&#039;&lt;br /&gt;
Useful Aliases &amp;amp; Shortcuts&lt;br /&gt;
Add these to your ~/.bashrc for quick access to common troubleshooting commands:&lt;br /&gt;
 # Monitor system temperatures in real-time&lt;br /&gt;
 alias temps=&amp;quot;watch -n 2 &#039;for i in /sys/class/hwmon/hwmon*/; do echo -n \&amp;quot;\$(cat \${i}name): \&amp;quot;; cat \${i}temp*_input 2&amp;gt;/dev/null | while read temp; do echo \&amp;quot;scale=1; \$temp/1000\&amp;quot; | bc; done | tr \&amp;quot;\n\&amp;quot; \&amp;quot; \&amp;quot;; echo \&amp;quot;°C\&amp;quot;; done&#039;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Quick system status&lt;br /&gt;
 alias sysstat=&#039;echo &amp;quot;=== CPU ===&amp;quot; &amp;amp;&amp;amp; uptime &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Memory ===&amp;quot; &amp;amp;&amp;amp; free -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Disk ===&amp;quot; &amp;amp;&amp;amp; df -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Top Processes ===&amp;quot; &amp;amp;&amp;amp; ps aux --sort=-%mem | head -10&#039;&lt;br /&gt;
 &lt;br /&gt;
 # View last boot logs&lt;br /&gt;
 alias lastboot=&#039;journalctl -b -1&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Check failed services&lt;br /&gt;
 alias failedservices=&#039;systemctl --failed&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Monitor logs in real-time&lt;br /&gt;
 alias watchlog=&#039;sudo journalctl -f&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Quick network status&lt;br /&gt;
 alias netstatus=&#039;ip addr show &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Routes ===&amp;quot; &amp;amp;&amp;amp; ip route show&#039;&lt;br /&gt;
After adding these, reload your shell configuration:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
Tips for Effective Troubleshooting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check logs first.&#039;&#039;&#039; journalctl and dmesg are your best starting point for almost any problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Change one thing at a time.&#039;&#039;&#039; It’s tempting to make several changes at once, but doing so makes it impossible to know what actually fixed—or broke—the problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Document your changes.&#039;&#039;&#039; Keep notes on what you’ve tried and what the results were. You’ll thank yourself later.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use exact error messages.&#039;&#039;&#039; Copy error messages verbatim and search for them alongside “Debian” and the version number—for example, “Debian 13” or “Debian 13.1” for point releases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check what changed recently.&#039;&#039;&#039; Did you install something, update packages, or change the kernel before the problem appeared? Start there.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Back up before making major changes.&#039;&#039;&#039; This goes without saying, but it’s easy to skip when you’re in a hurry.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use verbose mode.&#039;&#039;&#039; Adding -v or -vv flags to commands often reveals what would otherwise be silent failures.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the community.&#039;&#039;&#039; The Debian forums, Reddit, Stack Exchange, and the Debian mailing lists are all active and well-indexed. Someone has usually seen your problem before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by &amp;lt;dfn&amp;gt;distro-nix&amp;lt;/dfn&amp;gt; to the Debian User Forums on 2025-10-27.&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Forums_Cache:About&amp;diff=269</id>
		<title>Debian Forums Cache:About</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Forums_Cache:About&amp;diff=269"/>
		<updated>2026-05-15T13:20:35Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: Added disclaimer&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== About Debian Forums Cache: ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;About Debian Forums Cache&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Debian Forums Cache exists because good technical work deserves a permanent home.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The Debian forums hold a lot of useful knowledge—tested procedures, hard-won solutions, and practical guides built from real experience. The Archives allows the authors to have cited works and permanent links to their works, something the forums cannot offer.&lt;br /&gt;
&lt;br /&gt;
Forum threads age, and when the forums are down or gone, that knowledge is gone with them.&lt;br /&gt;
&lt;br /&gt;
This cache means content is attributed, versioned, and stable—available whether the forums are there or not. If you wrote something worth keeping, it gets a permanent link. If you are looking for something or sharing something, even in your own writing, you can cite what you find in a readable and professional format.&lt;br /&gt;
&lt;br /&gt;
We&#039;re not an open wiki. Submissions go through a review process, which keeps the quality high and the spam out. That accountability runs both ways: authors stand behind what they publish, and readers can trust that what they&#039;re reading has been verified by their peers, and is known to work with their version.&lt;br /&gt;
&lt;br /&gt;
With that being said, please enjoy the best work of the Debian User Forum community.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A note on accuracy&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Technical content ages. Debian moves forward, and a procedure that worked on Trixie may need adjustment by the time Forky is stable. Every entry in the Cache carries a publication date and the Debian version it was tested against—use those as your guide. If something doesn&#039;t work as described, check the version, check the date, and if you&#039;ve found a genuine error, the CacheHandlers want to know.&lt;br /&gt;
&lt;br /&gt;
The Cache is maintained by community volunteers. Content is peer-reviewed but not formally audited. Use your judgment, test in a safe environment before applying anything critical to production, and as always—have a backup.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Disclaimer&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The papers are provided by the Cache on behalf of the authors, and are provided without any express or implied warranty. This includes, but is not limited to, the implied warranties of merchantability and fitness for a particular purpose. Readers assume all risk relating to the quality of the papers when applying their contents. Should the paper contain incorrect information, readers will be responsible for the cost of all necessary servicing, repairs or corrections. Unless required by applicable law or agreed in writing, no member of the Debian Forum or Cache site will be liable to you for any damages arising from your use of the paper. This includes general, special, incidental or consequential damages, such as loss of or damage to data, or losses sustained by you or third parties, or failure to follow the instructions supplied with the paper. This applies even if they have been advised of the possibility of such damages.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=268</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=268"/>
		<updated>2026-05-14T21:15:20Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: /* Check System Resources */ Adding helpers to each input&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Author:&#039;&#039;&#039; distro-nix &#039;&#039;&#039;Forum Profile:&#039;&#039;&#039; &amp;lt;dfn&amp;gt;&amp;lt;nowiki&amp;gt;https://forums.debian.net/memberlist.php?mode=viewprofile&amp;amp;u=239099&amp;lt;/nowiki&amp;gt;&amp;lt;/dfn&amp;gt; &#039;&#039;&#039;Debian Version:&#039;&#039;&#039; Debian 13 (Trixie) &#039;&#039;&#039;Kernel Versions Tested:&#039;&#039;&#039; 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64 (x86_64) &#039;&#039;&#039;Created:&#039;&#039;&#039; 2025-10-27 &#039;&#039;&#039;Last Updated:&#039;&#039;&#039; 2026-03-11 &#039;&#039;&#039;ID:&#039;&#039;&#039; 544201 &#039;&#039;&#039;License:&#039;&#039;&#039; CC BY-SA 4.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This guide is preserved in its original form. Questions and feedback welcome via the author’s &amp;lt;dfn&amp;gt;Debian Forums profile&amp;lt;/dfn&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The Debian First Aid Kit is a practical reference for diagnosing and resolving common system problems on Debian GNU/Linux. It covers commonly occuring categories of failure: system freezes and crashes, boot problems, network issues, package management, disk and filesystem errors, performance degradation, service and application failures, permission and access problems, hardware identification and errors, and quick diagnostics. Each section gives the relevant commands so you can understand what they do and why, rather than a bare list to copy and paste blindly. A dedicated section covers MTR (Matt’s Traceroute) in depth, including output interpretation, practical troubleshooting, and how to monitor continuously. The guide also includes a set of shell aliases for faster access to common diagnostic tasks. All commands are verified on Debian 13 (Trixie) running kernel 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64. This document is intended for users with basic command-line familiarity who need a reliable, consolidated reference when something goes wrong.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Keywords:&#039;&#039;&#039; Debian, troubleshooting, system administration, MTR, network diagnostics, package management, journalctl, filesystem repair&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tested Commands Disclaimer ==&lt;br /&gt;
All commands in this document have been verified on Debian 13 (Trixie) with the kernel versions listed above. Results may vary on other releases or hardware configurations. Always test in a safe environment before applying any procedure to a production system.&lt;br /&gt;
&lt;br /&gt;
== Conventions Used in This Document ==&lt;br /&gt;
Command examples throughout this guide follow standard Unix prompt conventions. A $ prefix indicates a command run as a regular user. Where elevated privileges are required, sudo is shown explicitly and # with a brief explanation if needed:&lt;br /&gt;
 $ journalctl -b -1          # regular user&lt;br /&gt;
 $ sudo apt install mtr      # requires elevation via sudo&lt;br /&gt;
In recovery shell contexts, where you are operating directly as root, the prompt is #.&lt;br /&gt;
&lt;br /&gt;
== System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics:&#039;&#039;&#039; Search for “kernel panic” or “Oops”&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM):&#039;&#039;&#039; Search for “Out of memory” or “oom-killer”&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors:&#039;&#039;&#039; Look for “MCE” (Machine Check Exception) or “hardware error”&lt;br /&gt;
* &#039;&#039;&#039;Driver issues:&#039;&#039;&#039; Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating:&#039;&#039;&#039; Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 $ free -h                      # memory usage&lt;br /&gt;
&lt;br /&gt;
 $ df -h                        # disk space&lt;br /&gt;
&lt;br /&gt;
 $ htop                         # interactive resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ top                          # alternative resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt install btop        # btop is a more detailed alternative&lt;br /&gt;
&lt;br /&gt;
 $ sudo dmesg | grep -i error   # check for disk errors&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN         # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX  # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub            # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab              # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
The following are permanent errors caused by incomplete or buggy ACPI tables in the BIOS. They are harmless and can be safely ignored if they appear on your system:&lt;br /&gt;
 [0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&lt;br /&gt;
 [0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&lt;br /&gt;
 [0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&lt;br /&gt;
&lt;br /&gt;
== Boot Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Check Boot Process ===&lt;br /&gt;
 $ systemd-analyze blame                        # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemd-analyze blame                        # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemctl --failed                           # units that failed during boot&lt;br /&gt;
&lt;br /&gt;
 $ systemctl status &amp;lt;service-name&amp;gt;              # e.g. systemctl status NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN           # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX  # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub               # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab                       # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
== Network Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose Network Connection ===&lt;br /&gt;
 $ ip addr show                         # check network interfaces&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 4 8.8.8.8                    # test IPv4 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ ping -c 6 2a00:1450:4007:809::200e   # test IPv6 connectivity&lt;br /&gt;
&lt;br /&gt;
 $ nslookup google.com                  # check DNS resolution&lt;br /&gt;
&lt;br /&gt;
 $ ip route show                        # view routing table&lt;br /&gt;
&lt;br /&gt;
 $ ss -tuln                             # check active connections &lt;br /&gt;
&lt;br /&gt;
=== Restart Network Service ===&lt;br /&gt;
 $ sudo systemctl restart NetworkManager   # for systems using NetworkManager&lt;br /&gt;
&lt;br /&gt;
 $ sudo systemctl restart networking       # for systems using networking service&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 down              # bring interface down&lt;br /&gt;
&lt;br /&gt;
 $ sudo ip link set eth0 up                # bring interface back up&lt;br /&gt;
&lt;br /&gt;
== MTR (Matt’s Traceroute) ==&lt;br /&gt;
MTR combines the functionality of ping and traceroute into a single real-time network diagnostic tool. It continuously monitors the path between your system and a destination, providing detailed statistics about latency and packet loss at each hop. When you need to demonstrate a network problem that is outside your control—to your hosting provider, for example—MTR gives you the evidence you need.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
 $ sudo apt install mtr&lt;br /&gt;
&lt;br /&gt;
=== Basic Usage ===&lt;br /&gt;
 $ mtr google.com                          # interactive mode&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report google.com                 # report mode (10 cycles then exit)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 50 google.com       # specify number of cycles&lt;br /&gt;
&lt;br /&gt;
 $ mtr --tcp google.com                    # use TCP instead of ICMP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --udp google.com                    # use UDP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --no-dns google.com                 # skip DNS resolution (faster)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --show-ips google.com               # show both hostnames and IPs&lt;br /&gt;
&lt;br /&gt;
== Understanding MTR Output ==&lt;br /&gt;
&lt;br /&gt;
==== Sample Output ====&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    10   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
   4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   5.|-- google.com                 0.0%    10   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
&lt;br /&gt;
=== Column Meanings ===&lt;br /&gt;
&#039;&#039;&#039;HOST&#039;&#039;&#039; — Hostname or IP address of each hop in the route.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loss%&#039;&#039;&#039; — Percentage of packets lost at this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Snt&#039;&#039;&#039; — Number of packets sent to this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last&#039;&#039;&#039; — Latency of the most recent packet, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Avg&#039;&#039;&#039; — Average latency across all packets sent, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best&#039;&#039;&#039; — Lowest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wrst&#039;&#039;&#039; — Highest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StDev&#039;&#039;&#039; — Standard deviation of latency measurements—lower values indicate a more stable connection.&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Results ===&lt;br /&gt;
A healthy network shows 0% loss on all hops, stable latency with low StDev values, a gradual latency increase as hop count increases, and consistent response times.&lt;br /&gt;
&lt;br /&gt;
==== Problem Indicators ====&lt;br /&gt;
&#039;&#039;&#039;1. High Packet Loss at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 5.|-- problem-router.net        25.0%    10   45.3  48.2  42.1  65.8  8.4&lt;br /&gt;
If loss continues to the destination, there is a real problem at that router. If loss appears only at that hop but not beyond, the router is likely rate-limiting ICMP responses—a false positive, not a real problem. The rule of thumb: if packet loss appears at hop N but hops N+1, N+2, and beyond show 0% loss, it’s almost certainly ICMP rate limiting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. High Latency at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 3.|-- slow-link.net              0.0%    10  150.3 155.2 148.1 165.8  5.4&lt;br /&gt;
This indicates a network bottleneck, a congested link, geographical distance (intercontinental hops), or slow routing equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. No Response (???)&#039;&#039;&#039;&lt;br /&gt;
 4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
The router at this hop is configured not to respond to ICMP or traceroute packets, or a firewall is blocking diagnostic packets. This is not necessarily a problem if later hops respond normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. High Jitter (StDev)&#039;&#039;&#039;&lt;br /&gt;
 6.|-- unstable.net               0.0%    10   35.3  52.8  28.1  95.2  24.7&lt;br /&gt;
A high StDev (24.7ms in this example) indicates inconsistent latency caused by network congestion or instability. This is particularly noticeable in real-time applications such as VoIP, gaming, and video calls.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Sudden Latency Spike&#039;&#039;&#039;&lt;br /&gt;
 1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
 2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
 3.|-- problematic-hop.net        0.0%    10  180.5 185.2 178.1 195.8  6.4&lt;br /&gt;
 4.|-- next-hop.net               0.0%    10  182.3 187.8 180.5 198.2  6.8&lt;br /&gt;
Hop 3 introduces approximately 170ms of additional latency (jumping from 9ms to 180ms). Everything from hop 3 onward carries that penalty.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Report Mode with Different Output Formats ====&lt;br /&gt;
 $ mtr --report --csv google.com &amp;gt; network-report.csv    # CSV for logging&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report --json google.com                        # JSON for parsing&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report --xml google.com                         # XML format&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-wide google.com                          # wide report, no abbreviations&lt;br /&gt;
&lt;br /&gt;
==== Protocol Selection ====&lt;br /&gt;
 $ mtr google.com                                        # ICMP (default)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --udp google.com                                  # UDP&lt;br /&gt;
&lt;br /&gt;
 $ mtr --tcp google.com                                  # TCP&lt;br /&gt;
&lt;br /&gt;
 $ sudo mtr --tcp --port 443 google.com                  # specific TCP port&lt;br /&gt;
&lt;br /&gt;
 $ sudo mtr --tcp --port 22 remote-server.com            # default TCP port&lt;br /&gt;
&lt;br /&gt;
==== Timing and Duration ====&lt;br /&gt;
 $ mtr --interval 0.5 google.com           # interval between pings (default 1s)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 100 google.com      # extended test, 100 cycles&lt;br /&gt;
&lt;br /&gt;
 $ mtr google.com                          # continuous monitoring (Ctrl+C to stop)&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 10 google.com       # quick 10-cycle report&lt;br /&gt;
&lt;br /&gt;
==== Advanced Options ====&lt;br /&gt;
 $ mtr --aslookup google.com               # show Autonomous System (AS) numbers&lt;br /&gt;
&lt;br /&gt;
 $ mtr --max-ttl 20 google.com             # set maximum number of hops&lt;br /&gt;
&lt;br /&gt;
 $ mtr --psize 1000 google.com             # set packet size&lt;br /&gt;
&lt;br /&gt;
 $ mtr --show-ips google.com               # show both IP and hostname&lt;br /&gt;
&lt;br /&gt;
 $ mtr --address 192.168.1.100 google.com  # specify source address&lt;br /&gt;
&lt;br /&gt;
 $ mtr -4 google.com                       # IPv4 only&lt;br /&gt;
&lt;br /&gt;
 $ mtr -6 google.com                       # IPv6 only&lt;br /&gt;
&lt;br /&gt;
=== Interactive Mode Commands ===&lt;br /&gt;
When running MTR in interactive mode (mtr hostname), the following keys are available:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;h&#039;&#039;&#039; — Display help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d&#039;&#039;&#039; — Toggle display mode, cycling through different views.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;n&#039;&#039;&#039; — Toggle between hostnames and IP addresses.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;r&#039;&#039;&#039; — Reset all statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;p&#039;&#039;&#039; — Pause/unpause the display.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;q&#039;&#039;&#039; — Quit MTR.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;u&#039;&#039;&#039; — Switch between ICMP, UDP, and TCP modes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;y&#039;&#039;&#039; — Switch between IPv4 and IPv6.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;o&#039;&#039;&#039; — Toggle field display options.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;j&#039;&#039;&#039; — Toggle latency display.&lt;br /&gt;
&lt;br /&gt;
=== Practical Troubleshooting Scenarios ===&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1: Diagnosing a Slow Website ====&lt;br /&gt;
 $ mtr --report-cycles 100 --no-dns example.com&lt;br /&gt;
Look for high average latency at specific hops, packet loss at the destination, and high StDev values indicating jitter.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2: Testing if a Firewall Blocks SSH ====&lt;br /&gt;
 $ sudo mtr --tcp --port 22 --report-cycles 50 remote-server.com&lt;br /&gt;
If the last hop shows 100% loss but earlier hops are fine, port 22 may be filtered. Run a standard ICMP test for comparison.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3: ISP Performance Issues ====&lt;br /&gt;
 $ mtr --report-cycles 100 8.8.8.8&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 100 1.1.1.1&lt;br /&gt;
If issues appear in the first three or four hops, the problem is likely within your ISP’s network. If issues appear later, the problem lies beyond your ISP.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4: VPN Troubleshooting ====&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; before-vpn.txt   # before VPN&lt;br /&gt;
&lt;br /&gt;
 $ mtr --report-cycles 50 --no-dns google.com &amp;gt; after-vpn.txt    # after VPN&lt;br /&gt;
&lt;br /&gt;
 $ diff before-vpn.txt after-vpn.txt                              # compare the two&lt;br /&gt;
&lt;br /&gt;
==== Scenario 5: Gaming/Streaming Performance ====&lt;br /&gt;
 $ mtr --report-cycles 200 game-server.com&lt;br /&gt;
For real-time applications, look for low average latency (under 50ms for gaming), low StDev (under 5ms preferred), and zero packet loss.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 6: Intermittent Connectivity ====&lt;br /&gt;
 $ mtr --report-cycles 500 --interval 1 target.com &amp;gt; long-test.txt   # long-running test&lt;br /&gt;
&lt;br /&gt;
 $ mtr target.com                                                    # real-time monitoring&lt;br /&gt;
&lt;br /&gt;
=== Continuous Monitoring ===&lt;br /&gt;
&lt;br /&gt;
==== Log Network Performance Over Time ====&lt;br /&gt;
 while true; do&lt;br /&gt;
     timestamp=$(date +%Y%m%d-%H%M%S)&lt;br /&gt;
     mtr --report --report-cycles 50 google.com &amp;gt; &amp;quot;mtr-$timestamp.txt&amp;quot;&lt;br /&gt;
     sleep 3600&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Monitor Multiple Destinations ====&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 echo &amp;quot;=== MTR Report $(date) ===&amp;quot; &amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Google DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 8.8.8.8 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Cloudflare DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 1.1.1.1 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Your Server:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 your-server.com &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
&lt;br /&gt;
=== Useful Aliases for .bashrc ===&lt;br /&gt;
 # Quick network path analysis&lt;br /&gt;
 alias mtrreport=&#039;mtr --report --report-cycles 50 --no-dns&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Monitor connection to Google DNS&lt;br /&gt;
 alias netcheck=&#039;mtr --report-cycles 20 8.8.8.8&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Extended network test&lt;br /&gt;
 alias mtrlong=&#039;mtr --report-cycles 100&#039;&lt;br /&gt;
 &lt;br /&gt;
 # TCP port 443 test (HTTPS)&lt;br /&gt;
 alias mtrhttps=&#039;sudo mtr --tcp --port 443 --report-cycles 30&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Quick comparison of major DNS providers&lt;br /&gt;
 alias dnstest=&#039;echo &amp;quot;Google:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 8.8.8.8 &amp;amp;&amp;amp; echo -e &amp;quot;\nCloudflare:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 1.1.1.1&#039;&lt;br /&gt;
After adding to ~/.bashrc, reload with:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting Tips ===&lt;br /&gt;
&#039;&#039;&#039;Permission issues with TCP mode:&#039;&#039;&#039;&lt;br /&gt;
 # Use sudo for TCP on privileged ports&lt;br /&gt;
 sudo mtr --tcp --port 443 example.com&lt;br /&gt;
 &lt;br /&gt;
 # Or set capabilities (one-time setup)&lt;br /&gt;
 sudo setcap cap_net_raw+ep /usr/bin/mtr-packet&lt;br /&gt;
&#039;&#039;&#039;False positives:&#039;&#039;&#039; Packet loss at an intermediate hop but not at the destination is almost always ICMP rate limiting at that router, not a real problem. Example:&lt;br /&gt;
 3.|-- router.isp.net            20.0%    50   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
 4.|-- next-hop.net               0.0%    50   18.5  19.2  17.8  22.1   1.3&lt;br /&gt;
 5.|-- destination.com            0.0%    50   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
Hop 3 shows 20% loss, but hops 4 and 5 show 0%. Traffic is flowing normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DNS resolution delays:&#039;&#039;&#039; If MTR is slow to start, skip DNS resolution with mtr --no-dns target.com and resolve addresses afterward with host 203.0.113.1 if needed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Comparing results:&#039;&#039;&#039;&lt;br /&gt;
 mtr --report --report-cycles 50 example.com &amp;gt; test1.txt&lt;br /&gt;
 sleep 60&lt;br /&gt;
 mtr --report --report-cycles 50 example.com &amp;gt; test2.txt&lt;br /&gt;
 diff test1.txt test2.txt&lt;br /&gt;
&lt;br /&gt;
=== When to Use MTR vs Other Tools ===&lt;br /&gt;
&#039;&#039;&#039;MTR&#039;&#039;&#039; — Best for continuous monitoring, identifying problem hops, and gathering detailed statistics. Requires installation via apt.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ping&#039;&#039;&#039; — Best for a quick connectivity test or simple latency check. Only tests the endpoint, not the path.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;traceroute&#039;&#039;&#039; — Best for one-time path discovery. Provides no continuous monitoring.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ss / netstat&#039;&#039;&#039; — Best for checking local connection status. Doesn’t test remote paths.&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
Run at least 50–100 cycles for accurate statistics. Use --no-dns for faster results and to avoid DNS resolution issues during testing. Test at different times of day, since network conditions vary. If one protocol shows issues, compare ICMP, UDP, and TCP modes. Save reports with timestamps for trend analysis. Use 8.8.8.8 or 1.1.1.1 as known-good hosts to verify your local network first. Let MTR run for at least 30–60 seconds before drawing conclusions.&lt;br /&gt;
&lt;br /&gt;
=== Reading Between the Lines ===&lt;br /&gt;
&#039;&#039;&#039;Good network health:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.1   1.2   0.9   2.1   0.2&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    50    8.2   8.5   7.5  10.2   0.5&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    50   15.1  15.5  14.0  18.3   0.8&lt;br /&gt;
   4.|-- google.com                 0.0%    50   24.8  25.2  23.5  28.1   1.1&lt;br /&gt;
No packet loss, consistent latency, low jitter throughout.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problematic network:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.2   1.5   1.0   2.3   0.3&lt;br /&gt;
   2.|-- 10.0.0.1                   5.0%    50   45.3  52.8  8.1  245.2  45.7&lt;br /&gt;
   3.|-- ???                       100.0%   50    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   4.|-- destination.com           15.0%    50   95.4 125.8  48.2 385.5  78.2&lt;br /&gt;
Packet loss at hop 2 and the destination, high jitter, and a very high worst-case latency all point to a genuine problem at or near hop 2.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
MTR is your Swiss Army knife for network diagnostics. Use --report-cycles 50 or higher for reliable data. Watch for packet loss at the destination—intermediate losses may be false positives. High StDev indicates an unstable connection. High average latency points to slow links. Use --no-dns for faster results. Compare ICMP, UDP, and TCP modes if issues appear. Test at different times of day for a complete picture.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 5. Package Management Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Fix Broken Packages ===&lt;br /&gt;
 # Update package lists&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 &lt;br /&gt;
 # Fix broken dependencies&lt;br /&gt;
 sudo apt --fix-broken install&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure packages&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
 # No output means there is nothing to reconfigure&lt;br /&gt;
 &lt;br /&gt;
 # Clean package cache&lt;br /&gt;
 sudo apt clean&lt;br /&gt;
 sudo apt autoclean&lt;br /&gt;
 &lt;br /&gt;
 # Remove unused packages&lt;br /&gt;
 sudo apt autoremove&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 # If apt is locked, find the process holding the lock&lt;br /&gt;
 sudo lsof /var/lib/dpkg/lock-frontend&lt;br /&gt;
 &lt;br /&gt;
 # Remove the lock (use with caution—only if no package manager is running)&lt;br /&gt;
 sudo rm /var/lib/dpkg/lock-frontend&lt;br /&gt;
 sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure dpkg&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
Disk &amp;amp; Filesystem Issues&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 # Check disk space&lt;br /&gt;
 df -h&lt;br /&gt;
 &lt;br /&gt;
 # Check inode usage&lt;br /&gt;
 df -i&lt;br /&gt;
 &lt;br /&gt;
 # View disk I/O statistics&lt;br /&gt;
 # iostat is part of the sysstat package, which also includes:&lt;br /&gt;
 # mpstat (CPU statistics), sar (system activity reporter),&lt;br /&gt;
 # pidstat (process statistics), and cifsiostat (CIFS statistics)&lt;br /&gt;
 sudo apt install sysstat&lt;br /&gt;
 &lt;br /&gt;
 iostat -x 1&lt;br /&gt;
 &lt;br /&gt;
 # Show stats in MB instead of KB&lt;br /&gt;
 iostat -xm 2&lt;br /&gt;
 &lt;br /&gt;
 # Monitor a specific device&lt;br /&gt;
 iostat -x sda 1&lt;br /&gt;
 &lt;br /&gt;
 # Check for disk errors in dmesg&lt;br /&gt;
 sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # SMART disk health (requires smartmontools)&lt;br /&gt;
 sudo apt install smartmontools&lt;br /&gt;
 sudo smartctl -a /dev/sda&lt;br /&gt;
&lt;br /&gt;
=== Repair Filesystem ===&lt;br /&gt;
 # Unmount the partition first&lt;br /&gt;
 sudo umount /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Run filesystem check&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # For ext4 specifically&lt;br /&gt;
 sudo e2fsck -f /dev/sdXN&lt;br /&gt;
Performance Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Resource Hogs ===&lt;br /&gt;
 # CPU usage by process&lt;br /&gt;
 top -o %CPU&lt;br /&gt;
 &lt;br /&gt;
 # Memory usage by process&lt;br /&gt;
 top -o %MEM&lt;br /&gt;
 &lt;br /&gt;
 # Disk usage by directory&lt;br /&gt;
 du -sh /* | sort -h&lt;br /&gt;
 &lt;br /&gt;
 # Find large files&lt;br /&gt;
 find / -type f -size +100M 2&amp;gt;/dev/null&lt;br /&gt;
 &lt;br /&gt;
 # Check running processes sorted by memory use&lt;br /&gt;
 ps aux --sort=-%mem | head -20&lt;br /&gt;
&lt;br /&gt;
=== System Temperature Monitoring ===&lt;br /&gt;
 # Install lm-sensors if not already present&lt;br /&gt;
 sudo apt install lm-sensors&lt;br /&gt;
 sudo sensors-detect&lt;br /&gt;
 &lt;br /&gt;
 # View temperatures&lt;br /&gt;
 sensors&lt;br /&gt;
 &lt;br /&gt;
 # Real-time temperature monitoring&lt;br /&gt;
 watch -n 2 sensors&lt;br /&gt;
See section 12 for a shell alias that makes temperature monitoring more convenient.&lt;br /&gt;
&lt;br /&gt;
Service &amp;amp; Application Errors&lt;br /&gt;
&lt;br /&gt;
=== Debug Service Problems ===&lt;br /&gt;
 # Check service status&lt;br /&gt;
 sudo systemctl status service-name&lt;br /&gt;
 &lt;br /&gt;
 # View service logs&lt;br /&gt;
 sudo journalctl -u service-name&lt;br /&gt;
 &lt;br /&gt;
 # Restart a service&lt;br /&gt;
 sudo systemctl restart service-name&lt;br /&gt;
 &lt;br /&gt;
 # Enable service at boot&lt;br /&gt;
 sudo systemctl enable service-name&lt;br /&gt;
 &lt;br /&gt;
 # View recent service failures&lt;br /&gt;
 journalctl -p err -b&lt;br /&gt;
&lt;br /&gt;
=== Application Crash Investigation ===&lt;br /&gt;
 # Check for core dumps&lt;br /&gt;
 ls -lh /var/crash/&lt;br /&gt;
 &lt;br /&gt;
 # View available application logs&lt;br /&gt;
 ls /var/log/&lt;br /&gt;
 &lt;br /&gt;
 # Follow syslog for application errors in real-time&lt;br /&gt;
 sudo tail -f /var/log/syslog&lt;br /&gt;
Permission &amp;amp; Access Issues&lt;br /&gt;
&lt;br /&gt;
=== Fix Common Permission Problems ===&lt;br /&gt;
 # Check file ownership&lt;br /&gt;
 ls -l /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change ownership (user:group)&lt;br /&gt;
 sudo chown user:group /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change permissions&lt;br /&gt;
 sudo chmod 644 /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Recursively fix permissions on a directory&lt;br /&gt;
 sudo chown -R user:group /path/to/directory&lt;br /&gt;
&lt;br /&gt;
=== User &amp;amp; Authentication Issues ===&lt;br /&gt;
 # Check user information&lt;br /&gt;
 id username&lt;br /&gt;
 &lt;br /&gt;
 # View user login history&lt;br /&gt;
 last -a&lt;br /&gt;
 &lt;br /&gt;
 # Check failed login attempts&lt;br /&gt;
 sudo journalctl | grep &amp;quot;authentication failure&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Reset user password&lt;br /&gt;
 sudo passwd username&lt;br /&gt;
Hardware Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Hardware ===&lt;br /&gt;
 # List all hardware (install if needed: sudo apt install lshw)&lt;br /&gt;
 sudo lshw -short&lt;br /&gt;
 &lt;br /&gt;
 # PCI devices&lt;br /&gt;
 lspci -v&lt;br /&gt;
 &lt;br /&gt;
 # USB devices&lt;br /&gt;
 lsusb -v&lt;br /&gt;
 &lt;br /&gt;
 # CPU information&lt;br /&gt;
 lscpu&lt;br /&gt;
 &lt;br /&gt;
 # Memory information&lt;br /&gt;
 sudo dmidecode --type memory&lt;br /&gt;
&lt;br /&gt;
=== Check Hardware Errors ===&lt;br /&gt;
 # Kernel ring buffer (hardware messages)&lt;br /&gt;
 dmesg | less&lt;br /&gt;
 # Press q to quit&lt;br /&gt;
 &lt;br /&gt;
 # Search for specific hardware issues&lt;br /&gt;
 dmesg | grep -i &amp;quot;error\|fail\|warn&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Check for USB issues&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
Quick Diagnostic Commands&lt;br /&gt;
&lt;br /&gt;
=== System Information at a Glance ===&lt;br /&gt;
 # Uptime and load average&lt;br /&gt;
 uptime&lt;br /&gt;
 &lt;br /&gt;
 # Kernel version&lt;br /&gt;
 uname -r&lt;br /&gt;
 &lt;br /&gt;
 # Debian version&lt;br /&gt;
 cat /etc/debian_version&lt;br /&gt;
 &lt;br /&gt;
 # Full system summary (install if needed: sudo apt install inxi)&lt;br /&gt;
 sudo inxi -Fxz&lt;br /&gt;
&lt;br /&gt;
=== Emergency Toolkit ===&lt;br /&gt;
 # Create a consolidated diagnostic report&lt;br /&gt;
 sudo journalctl -b &amp;gt; ~/system-report.txt&lt;br /&gt;
 dmesg &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 systemctl --failed &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 df -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 free -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 &lt;br /&gt;
 # Watch logs in real-time&lt;br /&gt;
 sudo journalctl -f&lt;br /&gt;
 &lt;br /&gt;
 # Monitor system resources continuously&lt;br /&gt;
 watch -n 1 &#039;free -h &amp;amp;&amp;amp; df -h&#039;&lt;br /&gt;
Useful Aliases &amp;amp; Shortcuts&lt;br /&gt;
Add these to your ~/.bashrc for quick access to common troubleshooting commands:&lt;br /&gt;
 # Monitor system temperatures in real-time&lt;br /&gt;
 alias temps=&amp;quot;watch -n 2 &#039;for i in /sys/class/hwmon/hwmon*/; do echo -n \&amp;quot;\$(cat \${i}name): \&amp;quot;; cat \${i}temp*_input 2&amp;gt;/dev/null | while read temp; do echo \&amp;quot;scale=1; \$temp/1000\&amp;quot; | bc; done | tr \&amp;quot;\n\&amp;quot; \&amp;quot; \&amp;quot;; echo \&amp;quot;°C\&amp;quot;; done&#039;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Quick system status&lt;br /&gt;
 alias sysstat=&#039;echo &amp;quot;=== CPU ===&amp;quot; &amp;amp;&amp;amp; uptime &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Memory ===&amp;quot; &amp;amp;&amp;amp; free -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Disk ===&amp;quot; &amp;amp;&amp;amp; df -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Top Processes ===&amp;quot; &amp;amp;&amp;amp; ps aux --sort=-%mem | head -10&#039;&lt;br /&gt;
 &lt;br /&gt;
 # View last boot logs&lt;br /&gt;
 alias lastboot=&#039;journalctl -b -1&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Check failed services&lt;br /&gt;
 alias failedservices=&#039;systemctl --failed&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Monitor logs in real-time&lt;br /&gt;
 alias watchlog=&#039;sudo journalctl -f&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Quick network status&lt;br /&gt;
 alias netstatus=&#039;ip addr show &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Routes ===&amp;quot; &amp;amp;&amp;amp; ip route show&#039;&lt;br /&gt;
After adding these, reload your shell configuration:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
Tips for Effective Troubleshooting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check logs first.&#039;&#039;&#039; journalctl and dmesg are your best starting point for almost any problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Change one thing at a time.&#039;&#039;&#039; It’s tempting to make several changes at once, but doing so makes it impossible to know what actually fixed—or broke—the problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Document your changes.&#039;&#039;&#039; Keep notes on what you’ve tried and what the results were. You’ll thank yourself later.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use exact error messages.&#039;&#039;&#039; Copy error messages verbatim and search for them alongside “Debian” and the version number—for example, “Debian 13” or “Debian 13.1” for point releases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check what changed recently.&#039;&#039;&#039; Did you install something, update packages, or change the kernel before the problem appeared? Start there.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Back up before making major changes.&#039;&#039;&#039; This goes without saying, but it’s easy to skip when you’re in a hurry.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use verbose mode.&#039;&#039;&#039; Adding -v or -vv flags to commands often reveals what would otherwise be silent failures.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the community.&#039;&#039;&#039; The Debian forums, Reddit, Stack Exchange, and the Debian mailing lists are all active and well-indexed. Someone has usually seen your problem before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by &amp;lt;dfn&amp;gt;distro-nix&amp;lt;/dfn&amp;gt; to the Debian User Forums on 2025-10-27.&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=267</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=267"/>
		<updated>2026-05-14T20:47:57Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: /* The following are permanent errors caused by incomplete or buggy ACPI tables in the BIOS. They are harmless and can be safely ignored if they appear on your system: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Author:&#039;&#039;&#039; distro-nix &#039;&#039;&#039;Forum Profile:&#039;&#039;&#039; &amp;lt;dfn&amp;gt;&amp;lt;nowiki&amp;gt;https://forums.debian.net/memberlist.php?mode=viewprofile&amp;amp;u=239099&amp;lt;/nowiki&amp;gt;&amp;lt;/dfn&amp;gt; &#039;&#039;&#039;Debian Version:&#039;&#039;&#039; Debian 13 (Trixie) &#039;&#039;&#039;Kernel Versions Tested:&#039;&#039;&#039; 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64 (x86_64) &#039;&#039;&#039;Created:&#039;&#039;&#039; 2025-10-27 &#039;&#039;&#039;Last Updated:&#039;&#039;&#039; 2026-03-11 &#039;&#039;&#039;ID:&#039;&#039;&#039; 544201 &#039;&#039;&#039;License:&#039;&#039;&#039; CC BY-SA 4.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This guide is preserved in its original form. Questions and feedback welcome via the author’s &amp;lt;dfn&amp;gt;Debian Forums profile&amp;lt;/dfn&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The Debian First Aid Kit is a practical reference for diagnosing and resolving common system problems on Debian GNU/Linux. It covers commonly occuring categories of failure: system freezes and crashes, boot problems, network issues, package management, disk and filesystem errors, performance degradation, service and application failures, permission and access problems, hardware identification and errors, and quick diagnostics. Each section gives the relevant commands so you can understand what they do and why, rather than a bare list to copy and paste blindly. A dedicated section covers MTR (Matt’s Traceroute) in depth, including output interpretation, practical troubleshooting, and how to monitor continuously. The guide also includes a set of shell aliases for faster access to common diagnostic tasks. All commands are verified on Debian 13 (Trixie) running kernel 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64. This document is intended for users with basic command-line familiarity who need a reliable, consolidated reference when something goes wrong.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Keywords:&#039;&#039;&#039; Debian, troubleshooting, system administration, MTR, network diagnostics, package management, journalctl, filesystem repair&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tested Commands Disclaimer ==&lt;br /&gt;
All commands in this document have been verified on Debian 13 (Trixie) with the kernel versions listed above. Results may vary on other releases or hardware configurations. Always test in a safe environment before applying any procedure to a production system.&lt;br /&gt;
&lt;br /&gt;
== Conventions Used in This Document ==&lt;br /&gt;
Command examples throughout this guide follow standard Unix prompt conventions. A $ prefix indicates a command run as a regular user. Where elevated privileges are required, sudo is shown explicitly and # with a brief explanation if needed:&lt;br /&gt;
 $ journalctl -b -1          # regular user&lt;br /&gt;
 $ sudo apt install mtr      # requires elevation via sudo&lt;br /&gt;
In recovery shell contexts, where you are operating directly as root, the prompt is #.&lt;br /&gt;
&lt;br /&gt;
== System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics:&#039;&#039;&#039; Search for “kernel panic” or “Oops”&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM):&#039;&#039;&#039; Search for “Out of memory” or “oom-killer”&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors:&#039;&#039;&#039; Look for “MCE” (Machine Check Exception) or “hardware error”&lt;br /&gt;
* &#039;&#039;&#039;Driver issues:&#039;&#039;&#039; Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating:&#039;&#039;&#039; Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 $ free -h                      # memory usage&lt;br /&gt;
&lt;br /&gt;
 $ df -h                        # disk space&lt;br /&gt;
&lt;br /&gt;
 $ htop                         # interactive resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ top                          # alternative resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt install btop        # btop is a more detailed alternative&lt;br /&gt;
&lt;br /&gt;
 $ sudo dmesg | grep -i error   # check for disk errors&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN         # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX  # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub            # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab              # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
The following are permanent errors caused by incomplete or buggy ACPI tables in the BIOS. They are harmless and can be safely ignored if they appear on your system:&lt;br /&gt;
 [0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&lt;br /&gt;
 [0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&lt;br /&gt;
 [0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&lt;br /&gt;
&lt;br /&gt;
== Boot Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Check Boot Process ===&lt;br /&gt;
 $ systemd-analyze blame                        # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemd-analyze blame                        # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemctl --failed                           # units that failed during boot&lt;br /&gt;
&lt;br /&gt;
 $ systemctl status &amp;lt;service-name&amp;gt;              # e.g. systemctl status NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 Repair filesystem errors — first identify the device with lsblk&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Reinstall GRUB bootloader&lt;br /&gt;
 sudo grub-install /dev/sdX&lt;br /&gt;
 sudo update-grub&lt;br /&gt;
 &lt;br /&gt;
 # Check fstab for mount errors&lt;br /&gt;
 cat /etc/fstab&lt;br /&gt;
&lt;br /&gt;
== Network Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose Network Connection ===&lt;br /&gt;
 # Check network interfaces&lt;br /&gt;
 ip addr show&lt;br /&gt;
 &lt;br /&gt;
 # Test IPv4 connectivity&lt;br /&gt;
 ping -c 4 8.8.8.8&lt;br /&gt;
 &lt;br /&gt;
 # Test IPv6 connectivity&lt;br /&gt;
 ping -c 6 2a00:1450:4007:809::200e&lt;br /&gt;
 &lt;br /&gt;
 # Check DNS resolution&lt;br /&gt;
 nslookup google.com&lt;br /&gt;
 &lt;br /&gt;
 # View routing table&lt;br /&gt;
 ip route show&lt;br /&gt;
 &lt;br /&gt;
 # Check active connections&lt;br /&gt;
 ss -tuln&lt;br /&gt;
&lt;br /&gt;
=== Restart Network Service ===&lt;br /&gt;
 # For systems with NetworkManager&lt;br /&gt;
 sudo systemctl restart NetworkManager&lt;br /&gt;
 &lt;br /&gt;
 # For systems with networking service&lt;br /&gt;
 sudo systemctl restart networking&lt;br /&gt;
 &lt;br /&gt;
 # Bring interface down and up&lt;br /&gt;
 sudo ip link set eth0 down&lt;br /&gt;
 sudo ip link set eth0 up&lt;br /&gt;
&lt;br /&gt;
== MTR (Matt’s Traceroute) ==&lt;br /&gt;
MTR combines the functionality of ping and traceroute into a single real-time network diagnostic tool. It continuously monitors the path between your system and a destination, providing detailed statistics about latency and packet loss at each hop. When you need to demonstrate a network problem that is outside your control—to your hosting provider, for example—MTR gives you the evidence to do so.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
 sudo apt install mtr&lt;br /&gt;
&lt;br /&gt;
=== Basic Usage ===&lt;br /&gt;
 # Basic MTR (interactive mode)&lt;br /&gt;
 mtr google.com&lt;br /&gt;
 &lt;br /&gt;
 # Report mode (run 10 cycles and exit)&lt;br /&gt;
 mtr --report google.com&lt;br /&gt;
 &lt;br /&gt;
 # Specify number of pings&lt;br /&gt;
 mtr --report-cycles 50 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use TCP instead of ICMP&lt;br /&gt;
 mtr --tcp google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use UDP&lt;br /&gt;
 mtr --udp google.com&lt;br /&gt;
 &lt;br /&gt;
 # No DNS resolution (faster, shows IPs only)&lt;br /&gt;
 mtr --no-dns google.com&lt;br /&gt;
 &lt;br /&gt;
 # Show both hostnames and IPs&lt;br /&gt;
 mtr --show-ips google.com&lt;br /&gt;
&lt;br /&gt;
== Understanding MTR Output ==&lt;br /&gt;
&lt;br /&gt;
==== Sample Output ====&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    10   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
   4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   5.|-- google.com                 0.0%    10   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
&lt;br /&gt;
=== Column Meanings ===&lt;br /&gt;
&#039;&#039;&#039;HOST&#039;&#039;&#039; — Hostname or IP address of each hop in the route.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loss%&#039;&#039;&#039; — Percentage of packets lost at this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Snt&#039;&#039;&#039; — Number of packets sent to this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last&#039;&#039;&#039; — Latency of the most recent packet, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Avg&#039;&#039;&#039; — Average latency across all packets sent, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best&#039;&#039;&#039; — Lowest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wrst&#039;&#039;&#039; — Highest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StDev&#039;&#039;&#039; — Standard deviation of latency measurements—lower values indicate a more stable connection.&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Results ===&lt;br /&gt;
A healthy network shows 0% loss on all hops, stable latency with low StDev values, a gradual latency increase as hop count increases, and consistent response times.&lt;br /&gt;
&lt;br /&gt;
==== Problem Indicators ====&lt;br /&gt;
&#039;&#039;&#039;1. High Packet Loss at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 5.|-- problem-router.net        25.0%    10   45.3  48.2  42.1  65.8  8.4&lt;br /&gt;
If loss continues to the destination, there is a real problem at that router. If loss appears only at that hop but not beyond, the router is likely rate-limiting ICMP responses—a false positive, not a real problem. The rule of thumb: if packet loss appears at hop N but hops N+1, N+2, and beyond show 0% loss, it’s almost certainly ICMP rate limiting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. High Latency at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 3.|-- slow-link.net              0.0%    10  150.3 155.2 148.1 165.8  5.4&lt;br /&gt;
This indicates a network bottleneck, a congested link, geographical distance (intercontinental hops), or slow routing equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. No Response (???)&#039;&#039;&#039;&lt;br /&gt;
 4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
The router at this hop is configured not to respond to ICMP or traceroute packets, or a firewall is blocking diagnostic packets. This is not necessarily a problem if later hops respond normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. High Jitter (StDev)&#039;&#039;&#039;&lt;br /&gt;
 6.|-- unstable.net               0.0%    10   35.3  52.8  28.1  95.2  24.7&lt;br /&gt;
A high StDev (24.7ms in this example) indicates inconsistent latency caused by network congestion or instability. This is particularly noticeable in real-time applications such as VoIP, gaming, and video calls.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Sudden Latency Spike&#039;&#039;&#039;&lt;br /&gt;
 1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
 2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
 3.|-- problematic-hop.net        0.0%    10  180.5 185.2 178.1 195.8  6.4&lt;br /&gt;
 4.|-- next-hop.net               0.0%    10  182.3 187.8 180.5 198.2  6.8&lt;br /&gt;
Hop 3 introduces approximately 170ms of additional latency (jumping from 9ms to 180ms). Everything from hop 3 onward carries that penalty.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Report Mode with Different Output Formats ====&lt;br /&gt;
 # CSV format for logging and analysis&lt;br /&gt;
 mtr --report --csv google.com &amp;gt; network-report.csv&lt;br /&gt;
 &lt;br /&gt;
 # JSON output for parsing&lt;br /&gt;
 mtr --report --json google.com&lt;br /&gt;
 &lt;br /&gt;
 # XML format&lt;br /&gt;
 mtr --report --xml google.com&lt;br /&gt;
 &lt;br /&gt;
 # Wide report (no abbreviations)&lt;br /&gt;
 mtr --report-wide google.com&lt;br /&gt;
&lt;br /&gt;
==== Protocol Selection ====&lt;br /&gt;
 # Use ICMP (default)&lt;br /&gt;
 mtr google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use UDP&lt;br /&gt;
 mtr --udp google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use TCP&lt;br /&gt;
 mtr --tcp google.com&lt;br /&gt;
 &lt;br /&gt;
 # Test a specific TCP port&lt;br /&gt;
 sudo mtr --tcp --port 443 google.com&lt;br /&gt;
 sudo mtr --tcp --port 22 remote-server.com&lt;br /&gt;
&lt;br /&gt;
==== Timing and Duration ====&lt;br /&gt;
 # Specify interval between pings (default 1 second)&lt;br /&gt;
 mtr --interval 0.5 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Extended test with 100 cycles&lt;br /&gt;
 mtr --report-cycles 100 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Continuous monitoring (Ctrl+C to stop)&lt;br /&gt;
 mtr google.com&lt;br /&gt;
 &lt;br /&gt;
 # Quick 10-cycle report&lt;br /&gt;
 mtr --report-cycles 10 google.com&lt;br /&gt;
&lt;br /&gt;
==== Advanced Options ====&lt;br /&gt;
 # Show Autonomous System (AS) numbers&lt;br /&gt;
 mtr --aslookup google.com&lt;br /&gt;
 &lt;br /&gt;
 # Set maximum number of hops&lt;br /&gt;
 mtr --max-ttl 20 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Set packet size&lt;br /&gt;
 mtr --psize 1000 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Show both IP and hostname&lt;br /&gt;
 mtr --show-ips google.com&lt;br /&gt;
 &lt;br /&gt;
 # Specify source address (useful with multiple network interfaces)&lt;br /&gt;
 mtr --address 192.168.1.100 google.com&lt;br /&gt;
 &lt;br /&gt;
 # IPv4 only&lt;br /&gt;
 mtr -4 google.com&lt;br /&gt;
 &lt;br /&gt;
 # IPv6 only&lt;br /&gt;
 mtr -6 google.com&lt;br /&gt;
&lt;br /&gt;
=== Interactive Mode Commands ===&lt;br /&gt;
When running MTR in interactive mode (mtr hostname), the following keys are available:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;h&#039;&#039;&#039; — Display help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d&#039;&#039;&#039; — Toggle display mode, cycling through different views.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;n&#039;&#039;&#039; — Toggle between hostnames and IP addresses.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;r&#039;&#039;&#039; — Reset all statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;p&#039;&#039;&#039; — Pause/unpause the display.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;q&#039;&#039;&#039; — Quit MTR.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;u&#039;&#039;&#039; — Switch between ICMP, UDP, and TCP modes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;y&#039;&#039;&#039; — Switch between IPv4 and IPv6.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;o&#039;&#039;&#039; — Toggle field display options.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;j&#039;&#039;&#039; — Toggle latency display.&lt;br /&gt;
&lt;br /&gt;
=== Practical Troubleshooting Scenarios ===&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1: Diagnosing a Slow Website ====&lt;br /&gt;
 mtr --report-cycles 100 --no-dns example.com&lt;br /&gt;
Look for high average latency at specific hops, packet loss at the destination, and high StDev values indicating jitter.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2: Testing if a Firewall Blocks SSH ====&lt;br /&gt;
 sudo mtr --tcp --port 22 --report-cycles 50 remote-server.com&lt;br /&gt;
If the last hop shows 100% loss but earlier hops are fine, port 22 may be filtered. Run a standard ICMP test for comparison.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3: ISP Performance Issues ====&lt;br /&gt;
 mtr --report-cycles 100 8.8.8.8&lt;br /&gt;
 mtr --report-cycles 100 1.1.1.1&lt;br /&gt;
If issues appear in the first three or four hops, the problem is likely within your ISP’s network. If issues appear later, the problem lies beyond your ISP.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4: VPN Troubleshooting ====&lt;br /&gt;
 # Test before connecting to VPN&lt;br /&gt;
 mtr --report-cycles 50 --no-dns google.com &amp;gt; before-vpn.txt&lt;br /&gt;
 &lt;br /&gt;
 # Test after connecting to VPN&lt;br /&gt;
 mtr --report-cycles 50 --no-dns google.com &amp;gt; after-vpn.txt&lt;br /&gt;
 &lt;br /&gt;
 # Compare the two&lt;br /&gt;
 diff before-vpn.txt after-vpn.txt&lt;br /&gt;
&lt;br /&gt;
==== Scenario 5: Gaming/Streaming Performance ====&lt;br /&gt;
 mtr --report-cycles 200 game-server.com&lt;br /&gt;
For real-time applications, look for low average latency (under 50ms for gaming), low StDev (under 5ms preferred), and zero packet loss.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 6: Intermittent Connectivity ====&lt;br /&gt;
 # Long-running test to catch intermittent issues&lt;br /&gt;
 mtr --report-cycles 500 --interval 1 target.com &amp;gt; long-test.txt&lt;br /&gt;
 &lt;br /&gt;
 # Or monitor in real-time for several minutes&lt;br /&gt;
 mtr target.com&lt;br /&gt;
&lt;br /&gt;
=== Continuous Monitoring ===&lt;br /&gt;
&lt;br /&gt;
==== Log Network Performance Over Time ====&lt;br /&gt;
 while true; do&lt;br /&gt;
     timestamp=$(date +%Y%m%d-%H%M%S)&lt;br /&gt;
     mtr --report --report-cycles 50 google.com &amp;gt; &amp;quot;mtr-$timestamp.txt&amp;quot;&lt;br /&gt;
     sleep 3600&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Monitor Multiple Destinations ====&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 echo &amp;quot;=== MTR Report $(date) ===&amp;quot; &amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Google DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 8.8.8.8 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Cloudflare DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 1.1.1.1 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Your Server:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 your-server.com &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
&lt;br /&gt;
=== Useful Aliases for .bashrc ===&lt;br /&gt;
 # Quick network path analysis&lt;br /&gt;
 alias mtrreport=&#039;mtr --report --report-cycles 50 --no-dns&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Monitor connection to Google DNS&lt;br /&gt;
 alias netcheck=&#039;mtr --report-cycles 20 8.8.8.8&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Extended network test&lt;br /&gt;
 alias mtrlong=&#039;mtr --report-cycles 100&#039;&lt;br /&gt;
 &lt;br /&gt;
 # TCP port 443 test (HTTPS)&lt;br /&gt;
 alias mtrhttps=&#039;sudo mtr --tcp --port 443 --report-cycles 30&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Quick comparison of major DNS providers&lt;br /&gt;
 alias dnstest=&#039;echo &amp;quot;Google:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 8.8.8.8 &amp;amp;&amp;amp; echo -e &amp;quot;\nCloudflare:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 1.1.1.1&#039;&lt;br /&gt;
After adding to ~/.bashrc, reload with:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting Tips ===&lt;br /&gt;
&#039;&#039;&#039;Permission issues with TCP mode:&#039;&#039;&#039;&lt;br /&gt;
 # Use sudo for TCP on privileged ports&lt;br /&gt;
 sudo mtr --tcp --port 443 example.com&lt;br /&gt;
 &lt;br /&gt;
 # Or set capabilities (one-time setup)&lt;br /&gt;
 sudo setcap cap_net_raw+ep /usr/bin/mtr-packet&lt;br /&gt;
&#039;&#039;&#039;False positives:&#039;&#039;&#039; Packet loss at an intermediate hop but not at the destination is almost always ICMP rate limiting at that router, not a real problem. Example:&lt;br /&gt;
 3.|-- router.isp.net            20.0%    50   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
 4.|-- next-hop.net               0.0%    50   18.5  19.2  17.8  22.1   1.3&lt;br /&gt;
 5.|-- destination.com            0.0%    50   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
Hop 3 shows 20% loss, but hops 4 and 5 show 0%. Traffic is flowing normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DNS resolution delays:&#039;&#039;&#039; If MTR is slow to start, skip DNS resolution with mtr --no-dns target.com and resolve addresses afterward with host 203.0.113.1 if needed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Comparing results:&#039;&#039;&#039;&lt;br /&gt;
 mtr --report --report-cycles 50 example.com &amp;gt; test1.txt&lt;br /&gt;
 sleep 60&lt;br /&gt;
 mtr --report --report-cycles 50 example.com &amp;gt; test2.txt&lt;br /&gt;
 diff test1.txt test2.txt&lt;br /&gt;
&lt;br /&gt;
=== When to Use MTR vs Other Tools ===&lt;br /&gt;
&#039;&#039;&#039;MTR&#039;&#039;&#039; — Best for continuous monitoring, identifying problem hops, and gathering detailed statistics. Requires installation via apt.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ping&#039;&#039;&#039; — Best for a quick connectivity test or simple latency check. Only tests the endpoint, not the path.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;traceroute&#039;&#039;&#039; — Best for one-time path discovery. Provides no continuous monitoring.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ss / netstat&#039;&#039;&#039; — Best for checking local connection status. Doesn’t test remote paths.&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
Run at least 50–100 cycles for accurate statistics. Use --no-dns for faster results and to avoid DNS resolution issues during testing. Test at different times of day, since network conditions vary. If one protocol shows issues, compare ICMP, UDP, and TCP modes. Save reports with timestamps for trend analysis. Use 8.8.8.8 or 1.1.1.1 as known-good hosts to verify your local network first. Let MTR run for at least 30–60 seconds before drawing conclusions.&lt;br /&gt;
&lt;br /&gt;
=== Reading Between the Lines ===&lt;br /&gt;
&#039;&#039;&#039;Good network health:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.1   1.2   0.9   2.1   0.2&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    50    8.2   8.5   7.5  10.2   0.5&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    50   15.1  15.5  14.0  18.3   0.8&lt;br /&gt;
   4.|-- google.com                 0.0%    50   24.8  25.2  23.5  28.1   1.1&lt;br /&gt;
No packet loss, consistent latency, low jitter throughout.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problematic network:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.2   1.5   1.0   2.3   0.3&lt;br /&gt;
   2.|-- 10.0.0.1                   5.0%    50   45.3  52.8  8.1  245.2  45.7&lt;br /&gt;
   3.|-- ???                       100.0%   50    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   4.|-- destination.com           15.0%    50   95.4 125.8  48.2 385.5  78.2&lt;br /&gt;
Packet loss at hop 2 and the destination, high jitter, and a very high worst-case latency all point to a genuine problem at or near hop 2.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
MTR is your Swiss Army knife for network diagnostics. Use --report-cycles 50 or higher for reliable data. Watch for packet loss at the destination—intermediate losses may be false positives. High StDev indicates an unstable connection. High average latency points to slow links. Use --no-dns for faster results. Compare ICMP, UDP, and TCP modes if issues appear. Test at different times of day for a complete picture.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 5. Package Management Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Fix Broken Packages ===&lt;br /&gt;
 # Update package lists&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 &lt;br /&gt;
 # Fix broken dependencies&lt;br /&gt;
 sudo apt --fix-broken install&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure packages&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
 # No output means there is nothing to reconfigure&lt;br /&gt;
 &lt;br /&gt;
 # Clean package cache&lt;br /&gt;
 sudo apt clean&lt;br /&gt;
 sudo apt autoclean&lt;br /&gt;
 &lt;br /&gt;
 # Remove unused packages&lt;br /&gt;
 sudo apt autoremove&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 # If apt is locked, find the process holding the lock&lt;br /&gt;
 sudo lsof /var/lib/dpkg/lock-frontend&lt;br /&gt;
 &lt;br /&gt;
 # Remove the lock (use with caution—only if no package manager is running)&lt;br /&gt;
 sudo rm /var/lib/dpkg/lock-frontend&lt;br /&gt;
 sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure dpkg&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
Disk &amp;amp; Filesystem Issues&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 # Check disk space&lt;br /&gt;
 df -h&lt;br /&gt;
 &lt;br /&gt;
 # Check inode usage&lt;br /&gt;
 df -i&lt;br /&gt;
 &lt;br /&gt;
 # View disk I/O statistics&lt;br /&gt;
 # iostat is part of the sysstat package, which also includes:&lt;br /&gt;
 # mpstat (CPU statistics), sar (system activity reporter),&lt;br /&gt;
 # pidstat (process statistics), and cifsiostat (CIFS statistics)&lt;br /&gt;
 sudo apt install sysstat&lt;br /&gt;
 &lt;br /&gt;
 iostat -x 1&lt;br /&gt;
 &lt;br /&gt;
 # Show stats in MB instead of KB&lt;br /&gt;
 iostat -xm 2&lt;br /&gt;
 &lt;br /&gt;
 # Monitor a specific device&lt;br /&gt;
 iostat -x sda 1&lt;br /&gt;
 &lt;br /&gt;
 # Check for disk errors in dmesg&lt;br /&gt;
 sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # SMART disk health (requires smartmontools)&lt;br /&gt;
 sudo apt install smartmontools&lt;br /&gt;
 sudo smartctl -a /dev/sda&lt;br /&gt;
&lt;br /&gt;
=== Repair Filesystem ===&lt;br /&gt;
 # Unmount the partition first&lt;br /&gt;
 sudo umount /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Run filesystem check&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # For ext4 specifically&lt;br /&gt;
 sudo e2fsck -f /dev/sdXN&lt;br /&gt;
Performance Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Resource Hogs ===&lt;br /&gt;
 # CPU usage by process&lt;br /&gt;
 top -o %CPU&lt;br /&gt;
 &lt;br /&gt;
 # Memory usage by process&lt;br /&gt;
 top -o %MEM&lt;br /&gt;
 &lt;br /&gt;
 # Disk usage by directory&lt;br /&gt;
 du -sh /* | sort -h&lt;br /&gt;
 &lt;br /&gt;
 # Find large files&lt;br /&gt;
 find / -type f -size +100M 2&amp;gt;/dev/null&lt;br /&gt;
 &lt;br /&gt;
 # Check running processes sorted by memory use&lt;br /&gt;
 ps aux --sort=-%mem | head -20&lt;br /&gt;
&lt;br /&gt;
=== System Temperature Monitoring ===&lt;br /&gt;
 # Install lm-sensors if not already present&lt;br /&gt;
 sudo apt install lm-sensors&lt;br /&gt;
 sudo sensors-detect&lt;br /&gt;
 &lt;br /&gt;
 # View temperatures&lt;br /&gt;
 sensors&lt;br /&gt;
 &lt;br /&gt;
 # Real-time temperature monitoring&lt;br /&gt;
 watch -n 2 sensors&lt;br /&gt;
See section 12 for a shell alias that makes temperature monitoring more convenient.&lt;br /&gt;
&lt;br /&gt;
Service &amp;amp; Application Errors&lt;br /&gt;
&lt;br /&gt;
=== Debug Service Problems ===&lt;br /&gt;
 # Check service status&lt;br /&gt;
 sudo systemctl status service-name&lt;br /&gt;
 &lt;br /&gt;
 # View service logs&lt;br /&gt;
 sudo journalctl -u service-name&lt;br /&gt;
 &lt;br /&gt;
 # Restart a service&lt;br /&gt;
 sudo systemctl restart service-name&lt;br /&gt;
 &lt;br /&gt;
 # Enable service at boot&lt;br /&gt;
 sudo systemctl enable service-name&lt;br /&gt;
 &lt;br /&gt;
 # View recent service failures&lt;br /&gt;
 journalctl -p err -b&lt;br /&gt;
&lt;br /&gt;
=== Application Crash Investigation ===&lt;br /&gt;
 # Check for core dumps&lt;br /&gt;
 ls -lh /var/crash/&lt;br /&gt;
 &lt;br /&gt;
 # View available application logs&lt;br /&gt;
 ls /var/log/&lt;br /&gt;
 &lt;br /&gt;
 # Follow syslog for application errors in real-time&lt;br /&gt;
 sudo tail -f /var/log/syslog&lt;br /&gt;
Permission &amp;amp; Access Issues&lt;br /&gt;
&lt;br /&gt;
=== Fix Common Permission Problems ===&lt;br /&gt;
 # Check file ownership&lt;br /&gt;
 ls -l /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change ownership (user:group)&lt;br /&gt;
 sudo chown user:group /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change permissions&lt;br /&gt;
 sudo chmod 644 /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Recursively fix permissions on a directory&lt;br /&gt;
 sudo chown -R user:group /path/to/directory&lt;br /&gt;
&lt;br /&gt;
=== User &amp;amp; Authentication Issues ===&lt;br /&gt;
 # Check user information&lt;br /&gt;
 id username&lt;br /&gt;
 &lt;br /&gt;
 # View user login history&lt;br /&gt;
 last -a&lt;br /&gt;
 &lt;br /&gt;
 # Check failed login attempts&lt;br /&gt;
 sudo journalctl | grep &amp;quot;authentication failure&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Reset user password&lt;br /&gt;
 sudo passwd username&lt;br /&gt;
Hardware Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Hardware ===&lt;br /&gt;
 # List all hardware (install if needed: sudo apt install lshw)&lt;br /&gt;
 sudo lshw -short&lt;br /&gt;
 &lt;br /&gt;
 # PCI devices&lt;br /&gt;
 lspci -v&lt;br /&gt;
 &lt;br /&gt;
 # USB devices&lt;br /&gt;
 lsusb -v&lt;br /&gt;
 &lt;br /&gt;
 # CPU information&lt;br /&gt;
 lscpu&lt;br /&gt;
 &lt;br /&gt;
 # Memory information&lt;br /&gt;
 sudo dmidecode --type memory&lt;br /&gt;
&lt;br /&gt;
=== Check Hardware Errors ===&lt;br /&gt;
 # Kernel ring buffer (hardware messages)&lt;br /&gt;
 dmesg | less&lt;br /&gt;
 # Press q to quit&lt;br /&gt;
 &lt;br /&gt;
 # Search for specific hardware issues&lt;br /&gt;
 dmesg | grep -i &amp;quot;error\|fail\|warn&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Check for USB issues&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
Quick Diagnostic Commands&lt;br /&gt;
&lt;br /&gt;
=== System Information at a Glance ===&lt;br /&gt;
 # Uptime and load average&lt;br /&gt;
 uptime&lt;br /&gt;
 &lt;br /&gt;
 # Kernel version&lt;br /&gt;
 uname -r&lt;br /&gt;
 &lt;br /&gt;
 # Debian version&lt;br /&gt;
 cat /etc/debian_version&lt;br /&gt;
 &lt;br /&gt;
 # Full system summary (install if needed: sudo apt install inxi)&lt;br /&gt;
 sudo inxi -Fxz&lt;br /&gt;
&lt;br /&gt;
=== Emergency Toolkit ===&lt;br /&gt;
 # Create a consolidated diagnostic report&lt;br /&gt;
 sudo journalctl -b &amp;gt; ~/system-report.txt&lt;br /&gt;
 dmesg &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 systemctl --failed &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 df -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 free -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 &lt;br /&gt;
 # Watch logs in real-time&lt;br /&gt;
 sudo journalctl -f&lt;br /&gt;
 &lt;br /&gt;
 # Monitor system resources continuously&lt;br /&gt;
 watch -n 1 &#039;free -h &amp;amp;&amp;amp; df -h&#039;&lt;br /&gt;
Useful Aliases &amp;amp; Shortcuts&lt;br /&gt;
Add these to your ~/.bashrc for quick access to common troubleshooting commands:&lt;br /&gt;
 # Monitor system temperatures in real-time&lt;br /&gt;
 alias temps=&amp;quot;watch -n 2 &#039;for i in /sys/class/hwmon/hwmon*/; do echo -n \&amp;quot;\$(cat \${i}name): \&amp;quot;; cat \${i}temp*_input 2&amp;gt;/dev/null | while read temp; do echo \&amp;quot;scale=1; \$temp/1000\&amp;quot; | bc; done | tr \&amp;quot;\n\&amp;quot; \&amp;quot; \&amp;quot;; echo \&amp;quot;°C\&amp;quot;; done&#039;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Quick system status&lt;br /&gt;
 alias sysstat=&#039;echo &amp;quot;=== CPU ===&amp;quot; &amp;amp;&amp;amp; uptime &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Memory ===&amp;quot; &amp;amp;&amp;amp; free -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Disk ===&amp;quot; &amp;amp;&amp;amp; df -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Top Processes ===&amp;quot; &amp;amp;&amp;amp; ps aux --sort=-%mem | head -10&#039;&lt;br /&gt;
 &lt;br /&gt;
 # View last boot logs&lt;br /&gt;
 alias lastboot=&#039;journalctl -b -1&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Check failed services&lt;br /&gt;
 alias failedservices=&#039;systemctl --failed&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Monitor logs in real-time&lt;br /&gt;
 alias watchlog=&#039;sudo journalctl -f&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Quick network status&lt;br /&gt;
 alias netstatus=&#039;ip addr show &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Routes ===&amp;quot; &amp;amp;&amp;amp; ip route show&#039;&lt;br /&gt;
After adding these, reload your shell configuration:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
Tips for Effective Troubleshooting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check logs first.&#039;&#039;&#039; journalctl and dmesg are your best starting point for almost any problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Change one thing at a time.&#039;&#039;&#039; It’s tempting to make several changes at once, but doing so makes it impossible to know what actually fixed—or broke—the problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Document your changes.&#039;&#039;&#039; Keep notes on what you’ve tried and what the results were. You’ll thank yourself later.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use exact error messages.&#039;&#039;&#039; Copy error messages verbatim and search for them alongside “Debian” and the version number—for example, “Debian 13” or “Debian 13.1” for point releases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check what changed recently.&#039;&#039;&#039; Did you install something, update packages, or change the kernel before the problem appeared? Start there.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Back up before making major changes.&#039;&#039;&#039; This goes without saying, but it’s easy to skip when you’re in a hurry.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use verbose mode.&#039;&#039;&#039; Adding -v or -vv flags to commands often reveals what would otherwise be silent failures.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the community.&#039;&#039;&#039; The Debian forums, Reddit, Stack Exchange, and the Debian mailing lists are all active and well-indexed. Someone has usually seen your problem before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by &amp;lt;dfn&amp;gt;distro-nix&amp;lt;/dfn&amp;gt; to the Debian User Forums on 2025-10-27.&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=266</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=266"/>
		<updated>2026-05-14T20:45:49Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Author:&#039;&#039;&#039; distro-nix &#039;&#039;&#039;Forum Profile:&#039;&#039;&#039; &amp;lt;dfn&amp;gt;&amp;lt;nowiki&amp;gt;https://forums.debian.net/memberlist.php?mode=viewprofile&amp;amp;u=239099&amp;lt;/nowiki&amp;gt;&amp;lt;/dfn&amp;gt; &#039;&#039;&#039;Debian Version:&#039;&#039;&#039; Debian 13 (Trixie) &#039;&#039;&#039;Kernel Versions Tested:&#039;&#039;&#039; 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64 (x86_64) &#039;&#039;&#039;Created:&#039;&#039;&#039; 2025-10-27 &#039;&#039;&#039;Last Updated:&#039;&#039;&#039; 2026-03-11 &#039;&#039;&#039;ID:&#039;&#039;&#039; 544201 &#039;&#039;&#039;License:&#039;&#039;&#039; CC BY-SA 4.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This guide is preserved in its original form. Questions and feedback welcome via the author’s &amp;lt;dfn&amp;gt;Debian Forums profile&amp;lt;/dfn&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The Debian First Aid Kit is a practical reference for diagnosing and resolving common system problems on Debian GNU/Linux. It covers commonly occuring categories of failure: system freezes and crashes, boot problems, network issues, package management, disk and filesystem errors, performance degradation, service and application failures, permission and access problems, hardware identification and errors, and quick diagnostics. Each section gives the relevant commands so you can understand what they do and why, rather than a bare list to copy and paste blindly. A dedicated section covers MTR (Matt’s Traceroute) in depth, including output interpretation, practical troubleshooting, and how to monitor continuously. The guide also includes a set of shell aliases for faster access to common diagnostic tasks. All commands are verified on Debian 13 (Trixie) running kernel 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64. This document is intended for users with basic command-line familiarity who need a reliable, consolidated reference when something goes wrong.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Keywords:&#039;&#039;&#039; Debian, troubleshooting, system administration, MTR, network diagnostics, package management, journalctl, filesystem repair&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tested Commands Disclaimer ==&lt;br /&gt;
All commands in this document have been verified on Debian 13 (Trixie) with the kernel versions listed above. Results may vary on other releases or hardware configurations. Always test in a safe environment before applying any procedure to a production system.&lt;br /&gt;
&lt;br /&gt;
== Conventions Used in This Document ==&lt;br /&gt;
Command examples throughout this guide follow standard Unix prompt conventions. A $ prefix indicates a command run as a regular user. Where elevated privileges are required, sudo is shown explicitly and # with a brief explanation if needed:&lt;br /&gt;
 $ journalctl -b -1          # regular user&lt;br /&gt;
 $ sudo apt install mtr      # requires elevation via sudo&lt;br /&gt;
In recovery shell contexts, where you are operating directly as root, the prompt is #.&lt;br /&gt;
&lt;br /&gt;
== System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics:&#039;&#039;&#039; Search for “kernel panic” or “Oops”&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM):&#039;&#039;&#039; Search for “Out of memory” or “oom-killer”&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors:&#039;&#039;&#039; Look for “MCE” (Machine Check Exception) or “hardware error”&lt;br /&gt;
* &#039;&#039;&#039;Driver issues:&#039;&#039;&#039; Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating:&#039;&#039;&#039; Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 $ free -h                      # memory usage&lt;br /&gt;
&lt;br /&gt;
 $ df -h                        # disk space&lt;br /&gt;
&lt;br /&gt;
 $ htop                         # interactive resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ top                          # alternative resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt install btop        # btop is a more detailed alternative&lt;br /&gt;
&lt;br /&gt;
 $ sudo dmesg | grep -i error   # check for disk errors&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN         # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX  # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub            # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab              # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The following are permanent errors caused by incomplete or buggy ACPI tables in the BIOS. They are harmless and can be safely ignored if they appear on your system: ===&lt;br /&gt;
 [0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&lt;br /&gt;
 [0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&lt;br /&gt;
 [0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&lt;br /&gt;
&lt;br /&gt;
== Boot Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Check Boot Process ===&lt;br /&gt;
 $ systemd-analyze blame                        # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemd-analyze blame                        # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemctl --failed                           # units that failed during boot&lt;br /&gt;
&lt;br /&gt;
 $ systemctl status &amp;lt;service-name&amp;gt;              # e.g. systemctl status NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 Repair filesystem errors — first identify the device with lsblk&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Reinstall GRUB bootloader&lt;br /&gt;
 sudo grub-install /dev/sdX&lt;br /&gt;
 sudo update-grub&lt;br /&gt;
 &lt;br /&gt;
 # Check fstab for mount errors&lt;br /&gt;
 cat /etc/fstab&lt;br /&gt;
&lt;br /&gt;
== Network Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose Network Connection ===&lt;br /&gt;
 # Check network interfaces&lt;br /&gt;
 ip addr show&lt;br /&gt;
 &lt;br /&gt;
 # Test IPv4 connectivity&lt;br /&gt;
 ping -c 4 8.8.8.8&lt;br /&gt;
 &lt;br /&gt;
 # Test IPv6 connectivity&lt;br /&gt;
 ping -c 6 2a00:1450:4007:809::200e&lt;br /&gt;
 &lt;br /&gt;
 # Check DNS resolution&lt;br /&gt;
 nslookup google.com&lt;br /&gt;
 &lt;br /&gt;
 # View routing table&lt;br /&gt;
 ip route show&lt;br /&gt;
 &lt;br /&gt;
 # Check active connections&lt;br /&gt;
 ss -tuln&lt;br /&gt;
&lt;br /&gt;
=== Restart Network Service ===&lt;br /&gt;
 # For systems with NetworkManager&lt;br /&gt;
 sudo systemctl restart NetworkManager&lt;br /&gt;
 &lt;br /&gt;
 # For systems with networking service&lt;br /&gt;
 sudo systemctl restart networking&lt;br /&gt;
 &lt;br /&gt;
 # Bring interface down and up&lt;br /&gt;
 sudo ip link set eth0 down&lt;br /&gt;
 sudo ip link set eth0 up&lt;br /&gt;
&lt;br /&gt;
== MTR (Matt’s Traceroute) ==&lt;br /&gt;
MTR combines the functionality of ping and traceroute into a single real-time network diagnostic tool. It continuously monitors the path between your system and a destination, providing detailed statistics about latency and packet loss at each hop. When you need to demonstrate a network problem that is outside your control—to your hosting provider, for example—MTR gives you the evidence to do so.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
 sudo apt install mtr&lt;br /&gt;
&lt;br /&gt;
=== Basic Usage ===&lt;br /&gt;
 # Basic MTR (interactive mode)&lt;br /&gt;
 mtr google.com&lt;br /&gt;
 &lt;br /&gt;
 # Report mode (run 10 cycles and exit)&lt;br /&gt;
 mtr --report google.com&lt;br /&gt;
 &lt;br /&gt;
 # Specify number of pings&lt;br /&gt;
 mtr --report-cycles 50 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use TCP instead of ICMP&lt;br /&gt;
 mtr --tcp google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use UDP&lt;br /&gt;
 mtr --udp google.com&lt;br /&gt;
 &lt;br /&gt;
 # No DNS resolution (faster, shows IPs only)&lt;br /&gt;
 mtr --no-dns google.com&lt;br /&gt;
 &lt;br /&gt;
 # Show both hostnames and IPs&lt;br /&gt;
 mtr --show-ips google.com&lt;br /&gt;
&lt;br /&gt;
== Understanding MTR Output ==&lt;br /&gt;
&lt;br /&gt;
==== Sample Output ====&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    10   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
   4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   5.|-- google.com                 0.0%    10   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
&lt;br /&gt;
=== Column Meanings ===&lt;br /&gt;
&#039;&#039;&#039;HOST&#039;&#039;&#039; — Hostname or IP address of each hop in the route.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loss%&#039;&#039;&#039; — Percentage of packets lost at this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Snt&#039;&#039;&#039; — Number of packets sent to this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last&#039;&#039;&#039; — Latency of the most recent packet, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Avg&#039;&#039;&#039; — Average latency across all packets sent, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best&#039;&#039;&#039; — Lowest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wrst&#039;&#039;&#039; — Highest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StDev&#039;&#039;&#039; — Standard deviation of latency measurements—lower values indicate a more stable connection.&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Results ===&lt;br /&gt;
A healthy network shows 0% loss on all hops, stable latency with low StDev values, a gradual latency increase as hop count increases, and consistent response times.&lt;br /&gt;
&lt;br /&gt;
==== Problem Indicators ====&lt;br /&gt;
&#039;&#039;&#039;1. High Packet Loss at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 5.|-- problem-router.net        25.0%    10   45.3  48.2  42.1  65.8  8.4&lt;br /&gt;
If loss continues to the destination, there is a real problem at that router. If loss appears only at that hop but not beyond, the router is likely rate-limiting ICMP responses—a false positive, not a real problem. The rule of thumb: if packet loss appears at hop N but hops N+1, N+2, and beyond show 0% loss, it’s almost certainly ICMP rate limiting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. High Latency at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 3.|-- slow-link.net              0.0%    10  150.3 155.2 148.1 165.8  5.4&lt;br /&gt;
This indicates a network bottleneck, a congested link, geographical distance (intercontinental hops), or slow routing equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. No Response (???)&#039;&#039;&#039;&lt;br /&gt;
 4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
The router at this hop is configured not to respond to ICMP or traceroute packets, or a firewall is blocking diagnostic packets. This is not necessarily a problem if later hops respond normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. High Jitter (StDev)&#039;&#039;&#039;&lt;br /&gt;
 6.|-- unstable.net               0.0%    10   35.3  52.8  28.1  95.2  24.7&lt;br /&gt;
A high StDev (24.7ms in this example) indicates inconsistent latency caused by network congestion or instability. This is particularly noticeable in real-time applications such as VoIP, gaming, and video calls.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Sudden Latency Spike&#039;&#039;&#039;&lt;br /&gt;
 1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
 2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
 3.|-- problematic-hop.net        0.0%    10  180.5 185.2 178.1 195.8  6.4&lt;br /&gt;
 4.|-- next-hop.net               0.0%    10  182.3 187.8 180.5 198.2  6.8&lt;br /&gt;
Hop 3 introduces approximately 170ms of additional latency (jumping from 9ms to 180ms). Everything from hop 3 onward carries that penalty.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Report Mode with Different Output Formats ====&lt;br /&gt;
 # CSV format for logging and analysis&lt;br /&gt;
 mtr --report --csv google.com &amp;gt; network-report.csv&lt;br /&gt;
 &lt;br /&gt;
 # JSON output for parsing&lt;br /&gt;
 mtr --report --json google.com&lt;br /&gt;
 &lt;br /&gt;
 # XML format&lt;br /&gt;
 mtr --report --xml google.com&lt;br /&gt;
 &lt;br /&gt;
 # Wide report (no abbreviations)&lt;br /&gt;
 mtr --report-wide google.com&lt;br /&gt;
&lt;br /&gt;
==== Protocol Selection ====&lt;br /&gt;
 # Use ICMP (default)&lt;br /&gt;
 mtr google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use UDP&lt;br /&gt;
 mtr --udp google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use TCP&lt;br /&gt;
 mtr --tcp google.com&lt;br /&gt;
 &lt;br /&gt;
 # Test a specific TCP port&lt;br /&gt;
 sudo mtr --tcp --port 443 google.com&lt;br /&gt;
 sudo mtr --tcp --port 22 remote-server.com&lt;br /&gt;
&lt;br /&gt;
==== Timing and Duration ====&lt;br /&gt;
 # Specify interval between pings (default 1 second)&lt;br /&gt;
 mtr --interval 0.5 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Extended test with 100 cycles&lt;br /&gt;
 mtr --report-cycles 100 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Continuous monitoring (Ctrl+C to stop)&lt;br /&gt;
 mtr google.com&lt;br /&gt;
 &lt;br /&gt;
 # Quick 10-cycle report&lt;br /&gt;
 mtr --report-cycles 10 google.com&lt;br /&gt;
&lt;br /&gt;
==== Advanced Options ====&lt;br /&gt;
 # Show Autonomous System (AS) numbers&lt;br /&gt;
 mtr --aslookup google.com&lt;br /&gt;
 &lt;br /&gt;
 # Set maximum number of hops&lt;br /&gt;
 mtr --max-ttl 20 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Set packet size&lt;br /&gt;
 mtr --psize 1000 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Show both IP and hostname&lt;br /&gt;
 mtr --show-ips google.com&lt;br /&gt;
 &lt;br /&gt;
 # Specify source address (useful with multiple network interfaces)&lt;br /&gt;
 mtr --address 192.168.1.100 google.com&lt;br /&gt;
 &lt;br /&gt;
 # IPv4 only&lt;br /&gt;
 mtr -4 google.com&lt;br /&gt;
 &lt;br /&gt;
 # IPv6 only&lt;br /&gt;
 mtr -6 google.com&lt;br /&gt;
&lt;br /&gt;
=== Interactive Mode Commands ===&lt;br /&gt;
When running MTR in interactive mode (mtr hostname), the following keys are available:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;h&#039;&#039;&#039; — Display help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d&#039;&#039;&#039; — Toggle display mode, cycling through different views.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;n&#039;&#039;&#039; — Toggle between hostnames and IP addresses.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;r&#039;&#039;&#039; — Reset all statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;p&#039;&#039;&#039; — Pause/unpause the display.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;q&#039;&#039;&#039; — Quit MTR.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;u&#039;&#039;&#039; — Switch between ICMP, UDP, and TCP modes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;y&#039;&#039;&#039; — Switch between IPv4 and IPv6.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;o&#039;&#039;&#039; — Toggle field display options.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;j&#039;&#039;&#039; — Toggle latency display.&lt;br /&gt;
&lt;br /&gt;
=== Practical Troubleshooting Scenarios ===&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1: Diagnosing a Slow Website ====&lt;br /&gt;
 mtr --report-cycles 100 --no-dns example.com&lt;br /&gt;
Look for high average latency at specific hops, packet loss at the destination, and high StDev values indicating jitter.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2: Testing if a Firewall Blocks SSH ====&lt;br /&gt;
 sudo mtr --tcp --port 22 --report-cycles 50 remote-server.com&lt;br /&gt;
If the last hop shows 100% loss but earlier hops are fine, port 22 may be filtered. Run a standard ICMP test for comparison.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3: ISP Performance Issues ====&lt;br /&gt;
 mtr --report-cycles 100 8.8.8.8&lt;br /&gt;
 mtr --report-cycles 100 1.1.1.1&lt;br /&gt;
If issues appear in the first three or four hops, the problem is likely within your ISP’s network. If issues appear later, the problem lies beyond your ISP.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4: VPN Troubleshooting ====&lt;br /&gt;
 # Test before connecting to VPN&lt;br /&gt;
 mtr --report-cycles 50 --no-dns google.com &amp;gt; before-vpn.txt&lt;br /&gt;
 &lt;br /&gt;
 # Test after connecting to VPN&lt;br /&gt;
 mtr --report-cycles 50 --no-dns google.com &amp;gt; after-vpn.txt&lt;br /&gt;
 &lt;br /&gt;
 # Compare the two&lt;br /&gt;
 diff before-vpn.txt after-vpn.txt&lt;br /&gt;
&lt;br /&gt;
==== Scenario 5: Gaming/Streaming Performance ====&lt;br /&gt;
 mtr --report-cycles 200 game-server.com&lt;br /&gt;
For real-time applications, look for low average latency (under 50ms for gaming), low StDev (under 5ms preferred), and zero packet loss.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 6: Intermittent Connectivity ====&lt;br /&gt;
 # Long-running test to catch intermittent issues&lt;br /&gt;
 mtr --report-cycles 500 --interval 1 target.com &amp;gt; long-test.txt&lt;br /&gt;
 &lt;br /&gt;
 # Or monitor in real-time for several minutes&lt;br /&gt;
 mtr target.com&lt;br /&gt;
&lt;br /&gt;
=== Continuous Monitoring ===&lt;br /&gt;
&lt;br /&gt;
==== Log Network Performance Over Time ====&lt;br /&gt;
 while true; do&lt;br /&gt;
     timestamp=$(date +%Y%m%d-%H%M%S)&lt;br /&gt;
     mtr --report --report-cycles 50 google.com &amp;gt; &amp;quot;mtr-$timestamp.txt&amp;quot;&lt;br /&gt;
     sleep 3600&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Monitor Multiple Destinations ====&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 echo &amp;quot;=== MTR Report $(date) ===&amp;quot; &amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Google DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 8.8.8.8 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Cloudflare DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 1.1.1.1 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Your Server:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 your-server.com &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
&lt;br /&gt;
=== Useful Aliases for .bashrc ===&lt;br /&gt;
 # Quick network path analysis&lt;br /&gt;
 alias mtrreport=&#039;mtr --report --report-cycles 50 --no-dns&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Monitor connection to Google DNS&lt;br /&gt;
 alias netcheck=&#039;mtr --report-cycles 20 8.8.8.8&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Extended network test&lt;br /&gt;
 alias mtrlong=&#039;mtr --report-cycles 100&#039;&lt;br /&gt;
 &lt;br /&gt;
 # TCP port 443 test (HTTPS)&lt;br /&gt;
 alias mtrhttps=&#039;sudo mtr --tcp --port 443 --report-cycles 30&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Quick comparison of major DNS providers&lt;br /&gt;
 alias dnstest=&#039;echo &amp;quot;Google:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 8.8.8.8 &amp;amp;&amp;amp; echo -e &amp;quot;\nCloudflare:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 1.1.1.1&#039;&lt;br /&gt;
After adding to ~/.bashrc, reload with:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting Tips ===&lt;br /&gt;
&#039;&#039;&#039;Permission issues with TCP mode:&#039;&#039;&#039;&lt;br /&gt;
 # Use sudo for TCP on privileged ports&lt;br /&gt;
 sudo mtr --tcp --port 443 example.com&lt;br /&gt;
 &lt;br /&gt;
 # Or set capabilities (one-time setup)&lt;br /&gt;
 sudo setcap cap_net_raw+ep /usr/bin/mtr-packet&lt;br /&gt;
&#039;&#039;&#039;False positives:&#039;&#039;&#039; Packet loss at an intermediate hop but not at the destination is almost always ICMP rate limiting at that router, not a real problem. Example:&lt;br /&gt;
 3.|-- router.isp.net            20.0%    50   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
 4.|-- next-hop.net               0.0%    50   18.5  19.2  17.8  22.1   1.3&lt;br /&gt;
 5.|-- destination.com            0.0%    50   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
Hop 3 shows 20% loss, but hops 4 and 5 show 0%. Traffic is flowing normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DNS resolution delays:&#039;&#039;&#039; If MTR is slow to start, skip DNS resolution with mtr --no-dns target.com and resolve addresses afterward with host 203.0.113.1 if needed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Comparing results:&#039;&#039;&#039;&lt;br /&gt;
 mtr --report --report-cycles 50 example.com &amp;gt; test1.txt&lt;br /&gt;
 sleep 60&lt;br /&gt;
 mtr --report --report-cycles 50 example.com &amp;gt; test2.txt&lt;br /&gt;
 diff test1.txt test2.txt&lt;br /&gt;
&lt;br /&gt;
=== When to Use MTR vs Other Tools ===&lt;br /&gt;
&#039;&#039;&#039;MTR&#039;&#039;&#039; — Best for continuous monitoring, identifying problem hops, and gathering detailed statistics. Requires installation via apt.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ping&#039;&#039;&#039; — Best for a quick connectivity test or simple latency check. Only tests the endpoint, not the path.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;traceroute&#039;&#039;&#039; — Best for one-time path discovery. Provides no continuous monitoring.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ss / netstat&#039;&#039;&#039; — Best for checking local connection status. Doesn’t test remote paths.&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
Run at least 50–100 cycles for accurate statistics. Use --no-dns for faster results and to avoid DNS resolution issues during testing. Test at different times of day, since network conditions vary. If one protocol shows issues, compare ICMP, UDP, and TCP modes. Save reports with timestamps for trend analysis. Use 8.8.8.8 or 1.1.1.1 as known-good hosts to verify your local network first. Let MTR run for at least 30–60 seconds before drawing conclusions.&lt;br /&gt;
&lt;br /&gt;
=== Reading Between the Lines ===&lt;br /&gt;
&#039;&#039;&#039;Good network health:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.1   1.2   0.9   2.1   0.2&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    50    8.2   8.5   7.5  10.2   0.5&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    50   15.1  15.5  14.0  18.3   0.8&lt;br /&gt;
   4.|-- google.com                 0.0%    50   24.8  25.2  23.5  28.1   1.1&lt;br /&gt;
No packet loss, consistent latency, low jitter throughout.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problematic network:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.2   1.5   1.0   2.3   0.3&lt;br /&gt;
   2.|-- 10.0.0.1                   5.0%    50   45.3  52.8  8.1  245.2  45.7&lt;br /&gt;
   3.|-- ???                       100.0%   50    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   4.|-- destination.com           15.0%    50   95.4 125.8  48.2 385.5  78.2&lt;br /&gt;
Packet loss at hop 2 and the destination, high jitter, and a very high worst-case latency all point to a genuine problem at or near hop 2.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
MTR is your Swiss Army knife for network diagnostics. Use --report-cycles 50 or higher for reliable data. Watch for packet loss at the destination—intermediate losses may be false positives. High StDev indicates an unstable connection. High average latency points to slow links. Use --no-dns for faster results. Compare ICMP, UDP, and TCP modes if issues appear. Test at different times of day for a complete picture.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 5. Package Management Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Fix Broken Packages ===&lt;br /&gt;
 # Update package lists&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 &lt;br /&gt;
 # Fix broken dependencies&lt;br /&gt;
 sudo apt --fix-broken install&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure packages&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
 # No output means there is nothing to reconfigure&lt;br /&gt;
 &lt;br /&gt;
 # Clean package cache&lt;br /&gt;
 sudo apt clean&lt;br /&gt;
 sudo apt autoclean&lt;br /&gt;
 &lt;br /&gt;
 # Remove unused packages&lt;br /&gt;
 sudo apt autoremove&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 # If apt is locked, find the process holding the lock&lt;br /&gt;
 sudo lsof /var/lib/dpkg/lock-frontend&lt;br /&gt;
 &lt;br /&gt;
 # Remove the lock (use with caution—only if no package manager is running)&lt;br /&gt;
 sudo rm /var/lib/dpkg/lock-frontend&lt;br /&gt;
 sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure dpkg&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
Disk &amp;amp; Filesystem Issues&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 # Check disk space&lt;br /&gt;
 df -h&lt;br /&gt;
 &lt;br /&gt;
 # Check inode usage&lt;br /&gt;
 df -i&lt;br /&gt;
 &lt;br /&gt;
 # View disk I/O statistics&lt;br /&gt;
 # iostat is part of the sysstat package, which also includes:&lt;br /&gt;
 # mpstat (CPU statistics), sar (system activity reporter),&lt;br /&gt;
 # pidstat (process statistics), and cifsiostat (CIFS statistics)&lt;br /&gt;
 sudo apt install sysstat&lt;br /&gt;
 &lt;br /&gt;
 iostat -x 1&lt;br /&gt;
 &lt;br /&gt;
 # Show stats in MB instead of KB&lt;br /&gt;
 iostat -xm 2&lt;br /&gt;
 &lt;br /&gt;
 # Monitor a specific device&lt;br /&gt;
 iostat -x sda 1&lt;br /&gt;
 &lt;br /&gt;
 # Check for disk errors in dmesg&lt;br /&gt;
 sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # SMART disk health (requires smartmontools)&lt;br /&gt;
 sudo apt install smartmontools&lt;br /&gt;
 sudo smartctl -a /dev/sda&lt;br /&gt;
&lt;br /&gt;
=== Repair Filesystem ===&lt;br /&gt;
 # Unmount the partition first&lt;br /&gt;
 sudo umount /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Run filesystem check&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # For ext4 specifically&lt;br /&gt;
 sudo e2fsck -f /dev/sdXN&lt;br /&gt;
Performance Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Resource Hogs ===&lt;br /&gt;
 # CPU usage by process&lt;br /&gt;
 top -o %CPU&lt;br /&gt;
 &lt;br /&gt;
 # Memory usage by process&lt;br /&gt;
 top -o %MEM&lt;br /&gt;
 &lt;br /&gt;
 # Disk usage by directory&lt;br /&gt;
 du -sh /* | sort -h&lt;br /&gt;
 &lt;br /&gt;
 # Find large files&lt;br /&gt;
 find / -type f -size +100M 2&amp;gt;/dev/null&lt;br /&gt;
 &lt;br /&gt;
 # Check running processes sorted by memory use&lt;br /&gt;
 ps aux --sort=-%mem | head -20&lt;br /&gt;
&lt;br /&gt;
=== System Temperature Monitoring ===&lt;br /&gt;
 # Install lm-sensors if not already present&lt;br /&gt;
 sudo apt install lm-sensors&lt;br /&gt;
 sudo sensors-detect&lt;br /&gt;
 &lt;br /&gt;
 # View temperatures&lt;br /&gt;
 sensors&lt;br /&gt;
 &lt;br /&gt;
 # Real-time temperature monitoring&lt;br /&gt;
 watch -n 2 sensors&lt;br /&gt;
See section 12 for a shell alias that makes temperature monitoring more convenient.&lt;br /&gt;
&lt;br /&gt;
Service &amp;amp; Application Errors&lt;br /&gt;
&lt;br /&gt;
=== Debug Service Problems ===&lt;br /&gt;
 # Check service status&lt;br /&gt;
 sudo systemctl status service-name&lt;br /&gt;
 &lt;br /&gt;
 # View service logs&lt;br /&gt;
 sudo journalctl -u service-name&lt;br /&gt;
 &lt;br /&gt;
 # Restart a service&lt;br /&gt;
 sudo systemctl restart service-name&lt;br /&gt;
 &lt;br /&gt;
 # Enable service at boot&lt;br /&gt;
 sudo systemctl enable service-name&lt;br /&gt;
 &lt;br /&gt;
 # View recent service failures&lt;br /&gt;
 journalctl -p err -b&lt;br /&gt;
&lt;br /&gt;
=== Application Crash Investigation ===&lt;br /&gt;
 # Check for core dumps&lt;br /&gt;
 ls -lh /var/crash/&lt;br /&gt;
 &lt;br /&gt;
 # View available application logs&lt;br /&gt;
 ls /var/log/&lt;br /&gt;
 &lt;br /&gt;
 # Follow syslog for application errors in real-time&lt;br /&gt;
 sudo tail -f /var/log/syslog&lt;br /&gt;
Permission &amp;amp; Access Issues&lt;br /&gt;
&lt;br /&gt;
=== Fix Common Permission Problems ===&lt;br /&gt;
 # Check file ownership&lt;br /&gt;
 ls -l /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change ownership (user:group)&lt;br /&gt;
 sudo chown user:group /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change permissions&lt;br /&gt;
 sudo chmod 644 /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Recursively fix permissions on a directory&lt;br /&gt;
 sudo chown -R user:group /path/to/directory&lt;br /&gt;
&lt;br /&gt;
=== User &amp;amp; Authentication Issues ===&lt;br /&gt;
 # Check user information&lt;br /&gt;
 id username&lt;br /&gt;
 &lt;br /&gt;
 # View user login history&lt;br /&gt;
 last -a&lt;br /&gt;
 &lt;br /&gt;
 # Check failed login attempts&lt;br /&gt;
 sudo journalctl | grep &amp;quot;authentication failure&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Reset user password&lt;br /&gt;
 sudo passwd username&lt;br /&gt;
Hardware Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Hardware ===&lt;br /&gt;
 # List all hardware (install if needed: sudo apt install lshw)&lt;br /&gt;
 sudo lshw -short&lt;br /&gt;
 &lt;br /&gt;
 # PCI devices&lt;br /&gt;
 lspci -v&lt;br /&gt;
 &lt;br /&gt;
 # USB devices&lt;br /&gt;
 lsusb -v&lt;br /&gt;
 &lt;br /&gt;
 # CPU information&lt;br /&gt;
 lscpu&lt;br /&gt;
 &lt;br /&gt;
 # Memory information&lt;br /&gt;
 sudo dmidecode --type memory&lt;br /&gt;
&lt;br /&gt;
=== Check Hardware Errors ===&lt;br /&gt;
 # Kernel ring buffer (hardware messages)&lt;br /&gt;
 dmesg | less&lt;br /&gt;
 # Press q to quit&lt;br /&gt;
 &lt;br /&gt;
 # Search for specific hardware issues&lt;br /&gt;
 dmesg | grep -i &amp;quot;error\|fail\|warn&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Check for USB issues&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
Quick Diagnostic Commands&lt;br /&gt;
&lt;br /&gt;
=== System Information at a Glance ===&lt;br /&gt;
 # Uptime and load average&lt;br /&gt;
 uptime&lt;br /&gt;
 &lt;br /&gt;
 # Kernel version&lt;br /&gt;
 uname -r&lt;br /&gt;
 &lt;br /&gt;
 # Debian version&lt;br /&gt;
 cat /etc/debian_version&lt;br /&gt;
 &lt;br /&gt;
 # Full system summary (install if needed: sudo apt install inxi)&lt;br /&gt;
 sudo inxi -Fxz&lt;br /&gt;
&lt;br /&gt;
=== Emergency Toolkit ===&lt;br /&gt;
 # Create a consolidated diagnostic report&lt;br /&gt;
 sudo journalctl -b &amp;gt; ~/system-report.txt&lt;br /&gt;
 dmesg &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 systemctl --failed &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 df -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 free -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 &lt;br /&gt;
 # Watch logs in real-time&lt;br /&gt;
 sudo journalctl -f&lt;br /&gt;
 &lt;br /&gt;
 # Monitor system resources continuously&lt;br /&gt;
 watch -n 1 &#039;free -h &amp;amp;&amp;amp; df -h&#039;&lt;br /&gt;
Useful Aliases &amp;amp; Shortcuts&lt;br /&gt;
Add these to your ~/.bashrc for quick access to common troubleshooting commands:&lt;br /&gt;
 # Monitor system temperatures in real-time&lt;br /&gt;
 alias temps=&amp;quot;watch -n 2 &#039;for i in /sys/class/hwmon/hwmon*/; do echo -n \&amp;quot;\$(cat \${i}name): \&amp;quot;; cat \${i}temp*_input 2&amp;gt;/dev/null | while read temp; do echo \&amp;quot;scale=1; \$temp/1000\&amp;quot; | bc; done | tr \&amp;quot;\n\&amp;quot; \&amp;quot; \&amp;quot;; echo \&amp;quot;°C\&amp;quot;; done&#039;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Quick system status&lt;br /&gt;
 alias sysstat=&#039;echo &amp;quot;=== CPU ===&amp;quot; &amp;amp;&amp;amp; uptime &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Memory ===&amp;quot; &amp;amp;&amp;amp; free -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Disk ===&amp;quot; &amp;amp;&amp;amp; df -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Top Processes ===&amp;quot; &amp;amp;&amp;amp; ps aux --sort=-%mem | head -10&#039;&lt;br /&gt;
 &lt;br /&gt;
 # View last boot logs&lt;br /&gt;
 alias lastboot=&#039;journalctl -b -1&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Check failed services&lt;br /&gt;
 alias failedservices=&#039;systemctl --failed&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Monitor logs in real-time&lt;br /&gt;
 alias watchlog=&#039;sudo journalctl -f&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Quick network status&lt;br /&gt;
 alias netstatus=&#039;ip addr show &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Routes ===&amp;quot; &amp;amp;&amp;amp; ip route show&#039;&lt;br /&gt;
After adding these, reload your shell configuration:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
Tips for Effective Troubleshooting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check logs first.&#039;&#039;&#039; journalctl and dmesg are your best starting point for almost any problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Change one thing at a time.&#039;&#039;&#039; It’s tempting to make several changes at once, but doing so makes it impossible to know what actually fixed—or broke—the problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Document your changes.&#039;&#039;&#039; Keep notes on what you’ve tried and what the results were. You’ll thank yourself later.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use exact error messages.&#039;&#039;&#039; Copy error messages verbatim and search for them alongside “Debian” and the version number—for example, “Debian 13” or “Debian 13.1” for point releases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check what changed recently.&#039;&#039;&#039; Did you install something, update packages, or change the kernel before the problem appeared? Start there.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Back up before making major changes.&#039;&#039;&#039; This goes without saying, but it’s easy to skip when you’re in a hurry.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use verbose mode.&#039;&#039;&#039; Adding -v or -vv flags to commands often reveals what would otherwise be silent failures.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the community.&#039;&#039;&#039; The Debian forums, Reddit, Stack Exchange, and the Debian mailing lists are all active and well-indexed. Someone has usually seen your problem before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by &amp;lt;dfn&amp;gt;distro-nix&amp;lt;/dfn&amp;gt; to the Debian User Forums on 2025-10-27.&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=265</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=265"/>
		<updated>2026-05-14T20:13:18Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: Pasting preformatted code blocks&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Author:&#039;&#039;&#039; distro-nix &#039;&#039;&#039;Forum Profile:&#039;&#039;&#039; &amp;lt;dfn&amp;gt;&amp;lt;nowiki&amp;gt;https://forums.debian.net/memberlist.php?mode=viewprofile&amp;amp;u=239099&amp;lt;/nowiki&amp;gt;&amp;lt;/dfn&amp;gt; &#039;&#039;&#039;Debian Version:&#039;&#039;&#039; Debian 13 (Trixie) &#039;&#039;&#039;Kernel Versions Tested:&#039;&#039;&#039; 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64 (x86_64) &#039;&#039;&#039;Created:&#039;&#039;&#039; 2025-10-27 &#039;&#039;&#039;Last Updated:&#039;&#039;&#039; 2026-03-11 &#039;&#039;&#039;ID:&#039;&#039;&#039; 544000.5 &#039;&#039;&#039;License:&#039;&#039;&#039; CC BY-SA 4.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This guide is preserved in its original form. Questions and feedback welcome via the author’s &amp;lt;dfn&amp;gt;Debian Forums profile&amp;lt;/dfn&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The Debian First Aid Kit is a practical reference for diagnosing and resolving common system problems on Debian GNU/Linux. It covers commonly occuring categories of failure: system freezes and crashes, boot problems, network issues, package management, disk and filesystem errors, performance degradation, service and application failures, permission and access problems, hardware identification and errors, and quick diagnostics. Each section gives the relevant commands so you can understand what they do and why, rather than a bare list to copy and paste blindly. A dedicated section covers MTR (Matt’s Traceroute) in depth, including output interpretation, practical troubleshooting, and how to monitor continuously. The guide also includes a set of shell aliases for faster access to common diagnostic tasks. All commands are verified on Debian 13 (Trixie) running kernel 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64. This document is intended for users with basic command-line familiarity who need a reliable, consolidated reference when something goes wrong.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Keywords:&#039;&#039;&#039; Debian, troubleshooting, system administration, MTR, network diagnostics, package management, journalctl, filesystem repair&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tested Commands Disclaimer ==&lt;br /&gt;
All commands in this document have been verified on Debian 13 (Trixie) with the kernel versions listed above. Results may vary on other releases or hardware configurations. Always test in a safe environment before applying any procedure to a production system.&lt;br /&gt;
&lt;br /&gt;
== Conventions Used in This Document ==&lt;br /&gt;
Command examples throughout this guide follow standard Unix prompt conventions. A $ prefix indicates a command run as a regular user. Where elevated privileges are required, sudo is shown explicitly and # with a brief explanation if needed:&lt;br /&gt;
 $ journalctl -b -1          # regular user&lt;br /&gt;
 $ sudo apt install mtr      # requires elevation via sudo&lt;br /&gt;
In recovery shell contexts, where you are operating directly as root, the prompt is #.&lt;br /&gt;
&lt;br /&gt;
== System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics:&#039;&#039;&#039; Search for “kernel panic” or “Oops”&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM):&#039;&#039;&#039; Search for “Out of memory” or “oom-killer”&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors:&#039;&#039;&#039; Look for “MCE” (Machine Check Exception) or “hardware error”&lt;br /&gt;
* &#039;&#039;&#039;Driver issues:&#039;&#039;&#039; Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating:&#039;&#039;&#039; Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 $ free -h                      # memory usage&lt;br /&gt;
&lt;br /&gt;
 $ df -h                        # disk space&lt;br /&gt;
&lt;br /&gt;
 $ htop                         # interactive resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ top                          # alternative resource monitor&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt install btop        # btop is a more detailed alternative&lt;br /&gt;
&lt;br /&gt;
 $ sudo dmesg | grep -i error   # check for disk errors&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 $ sudo fsck /dev/sdXN         # repair filesystem — identify device with lsblk first&lt;br /&gt;
&lt;br /&gt;
 $ sudo grub-install /dev/sdX  # reinstall GRUB bootloader&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-grub            # regenerate GRUB configuration&lt;br /&gt;
&lt;br /&gt;
 $ cat /etc/fstab              # check fstab for mount errors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The following are permanent errors caused by incomplete or buggy ACPI tables in the BIOS. They are harmless and can be safely ignored if they appear on your system: ===&lt;br /&gt;
 [0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&lt;br /&gt;
 [0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&lt;br /&gt;
 [0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&lt;br /&gt;
&lt;br /&gt;
== Boot Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Check Boot Process ===&lt;br /&gt;
 $ systemd-analyze blame                        # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemd-analyze blame                        # boot time by unit&lt;br /&gt;
&lt;br /&gt;
 $ systemctl --failed                           # units that failed during boot&lt;br /&gt;
&lt;br /&gt;
 $ systemctl status &amp;lt;service-name&amp;gt;              # e.g. systemctl status NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 Repair filesystem errors — first identify the device with lsblk&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Reinstall GRUB bootloader&lt;br /&gt;
 sudo grub-install /dev/sdX&lt;br /&gt;
 sudo update-grub&lt;br /&gt;
 &lt;br /&gt;
 # Check fstab for mount errors&lt;br /&gt;
 cat /etc/fstab&lt;br /&gt;
&lt;br /&gt;
== Network Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose Network Connection ===&lt;br /&gt;
 # Check network interfaces&lt;br /&gt;
 ip addr show&lt;br /&gt;
 &lt;br /&gt;
 # Test IPv4 connectivity&lt;br /&gt;
 ping -c 4 8.8.8.8&lt;br /&gt;
 &lt;br /&gt;
 # Test IPv6 connectivity&lt;br /&gt;
 ping -c 6 2a00:1450:4007:809::200e&lt;br /&gt;
 &lt;br /&gt;
 # Check DNS resolution&lt;br /&gt;
 nslookup google.com&lt;br /&gt;
 &lt;br /&gt;
 # View routing table&lt;br /&gt;
 ip route show&lt;br /&gt;
 &lt;br /&gt;
 # Check active connections&lt;br /&gt;
 ss -tuln&lt;br /&gt;
&lt;br /&gt;
=== Restart Network Service ===&lt;br /&gt;
 # For systems with NetworkManager&lt;br /&gt;
 sudo systemctl restart NetworkManager&lt;br /&gt;
 &lt;br /&gt;
 # For systems with networking service&lt;br /&gt;
 sudo systemctl restart networking&lt;br /&gt;
 &lt;br /&gt;
 # Bring interface down and up&lt;br /&gt;
 sudo ip link set eth0 down&lt;br /&gt;
 sudo ip link set eth0 up&lt;br /&gt;
&lt;br /&gt;
== MTR (Matt’s Traceroute) ==&lt;br /&gt;
MTR combines the functionality of ping and traceroute into a single real-time network diagnostic tool. It continuously monitors the path between your system and a destination, providing detailed statistics about latency and packet loss at each hop. When you need to demonstrate a network problem that is outside your control—to your hosting provider, for example—MTR gives you the evidence to do so.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
 sudo apt install mtr&lt;br /&gt;
&lt;br /&gt;
=== Basic Usage ===&lt;br /&gt;
 # Basic MTR (interactive mode)&lt;br /&gt;
 mtr google.com&lt;br /&gt;
 &lt;br /&gt;
 # Report mode (run 10 cycles and exit)&lt;br /&gt;
 mtr --report google.com&lt;br /&gt;
 &lt;br /&gt;
 # Specify number of pings&lt;br /&gt;
 mtr --report-cycles 50 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use TCP instead of ICMP&lt;br /&gt;
 mtr --tcp google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use UDP&lt;br /&gt;
 mtr --udp google.com&lt;br /&gt;
 &lt;br /&gt;
 # No DNS resolution (faster, shows IPs only)&lt;br /&gt;
 mtr --no-dns google.com&lt;br /&gt;
 &lt;br /&gt;
 # Show both hostnames and IPs&lt;br /&gt;
 mtr --show-ips google.com&lt;br /&gt;
&lt;br /&gt;
== Understanding MTR Output ==&lt;br /&gt;
&lt;br /&gt;
==== Sample Output ====&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    10   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
   4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   5.|-- google.com                 0.0%    10   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
&lt;br /&gt;
=== Column Meanings ===&lt;br /&gt;
&#039;&#039;&#039;HOST&#039;&#039;&#039; — Hostname or IP address of each hop in the route.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loss%&#039;&#039;&#039; — Percentage of packets lost at this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Snt&#039;&#039;&#039; — Number of packets sent to this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last&#039;&#039;&#039; — Latency of the most recent packet, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Avg&#039;&#039;&#039; — Average latency across all packets sent, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best&#039;&#039;&#039; — Lowest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wrst&#039;&#039;&#039; — Highest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StDev&#039;&#039;&#039; — Standard deviation of latency measurements—lower values indicate a more stable connection.&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Results ===&lt;br /&gt;
A healthy network shows 0% loss on all hops, stable latency with low StDev values, a gradual latency increase as hop count increases, and consistent response times.&lt;br /&gt;
&lt;br /&gt;
==== Problem Indicators ====&lt;br /&gt;
&#039;&#039;&#039;1. High Packet Loss at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 5.|-- problem-router.net        25.0%    10   45.3  48.2  42.1  65.8  8.4&lt;br /&gt;
If loss continues to the destination, there is a real problem at that router. If loss appears only at that hop but not beyond, the router is likely rate-limiting ICMP responses—a false positive, not a real problem. The rule of thumb: if packet loss appears at hop N but hops N+1, N+2, and beyond show 0% loss, it’s almost certainly ICMP rate limiting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. High Latency at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 3.|-- slow-link.net              0.0%    10  150.3 155.2 148.1 165.8  5.4&lt;br /&gt;
This indicates a network bottleneck, a congested link, geographical distance (intercontinental hops), or slow routing equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. No Response (???)&#039;&#039;&#039;&lt;br /&gt;
 4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
The router at this hop is configured not to respond to ICMP or traceroute packets, or a firewall is blocking diagnostic packets. This is not necessarily a problem if later hops respond normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. High Jitter (StDev)&#039;&#039;&#039;&lt;br /&gt;
 6.|-- unstable.net               0.0%    10   35.3  52.8  28.1  95.2  24.7&lt;br /&gt;
A high StDev (24.7ms in this example) indicates inconsistent latency caused by network congestion or instability. This is particularly noticeable in real-time applications such as VoIP, gaming, and video calls.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Sudden Latency Spike&#039;&#039;&#039;&lt;br /&gt;
 1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
 2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
 3.|-- problematic-hop.net        0.0%    10  180.5 185.2 178.1 195.8  6.4&lt;br /&gt;
 4.|-- next-hop.net               0.0%    10  182.3 187.8 180.5 198.2  6.8&lt;br /&gt;
Hop 3 introduces approximately 170ms of additional latency (jumping from 9ms to 180ms). Everything from hop 3 onward carries that penalty.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Report Mode with Different Output Formats ====&lt;br /&gt;
 # CSV format for logging and analysis&lt;br /&gt;
 mtr --report --csv google.com &amp;gt; network-report.csv&lt;br /&gt;
 &lt;br /&gt;
 # JSON output for parsing&lt;br /&gt;
 mtr --report --json google.com&lt;br /&gt;
 &lt;br /&gt;
 # XML format&lt;br /&gt;
 mtr --report --xml google.com&lt;br /&gt;
 &lt;br /&gt;
 # Wide report (no abbreviations)&lt;br /&gt;
 mtr --report-wide google.com&lt;br /&gt;
&lt;br /&gt;
==== Protocol Selection ====&lt;br /&gt;
 # Use ICMP (default)&lt;br /&gt;
 mtr google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use UDP&lt;br /&gt;
 mtr --udp google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use TCP&lt;br /&gt;
 mtr --tcp google.com&lt;br /&gt;
 &lt;br /&gt;
 # Test a specific TCP port&lt;br /&gt;
 sudo mtr --tcp --port 443 google.com&lt;br /&gt;
 sudo mtr --tcp --port 22 remote-server.com&lt;br /&gt;
&lt;br /&gt;
==== Timing and Duration ====&lt;br /&gt;
 # Specify interval between pings (default 1 second)&lt;br /&gt;
 mtr --interval 0.5 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Extended test with 100 cycles&lt;br /&gt;
 mtr --report-cycles 100 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Continuous monitoring (Ctrl+C to stop)&lt;br /&gt;
 mtr google.com&lt;br /&gt;
 &lt;br /&gt;
 # Quick 10-cycle report&lt;br /&gt;
 mtr --report-cycles 10 google.com&lt;br /&gt;
&lt;br /&gt;
==== Advanced Options ====&lt;br /&gt;
 # Show Autonomous System (AS) numbers&lt;br /&gt;
 mtr --aslookup google.com&lt;br /&gt;
 &lt;br /&gt;
 # Set maximum number of hops&lt;br /&gt;
 mtr --max-ttl 20 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Set packet size&lt;br /&gt;
 mtr --psize 1000 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Show both IP and hostname&lt;br /&gt;
 mtr --show-ips google.com&lt;br /&gt;
 &lt;br /&gt;
 # Specify source address (useful with multiple network interfaces)&lt;br /&gt;
 mtr --address 192.168.1.100 google.com&lt;br /&gt;
 &lt;br /&gt;
 # IPv4 only&lt;br /&gt;
 mtr -4 google.com&lt;br /&gt;
 &lt;br /&gt;
 # IPv6 only&lt;br /&gt;
 mtr -6 google.com&lt;br /&gt;
&lt;br /&gt;
=== Interactive Mode Commands ===&lt;br /&gt;
When running MTR in interactive mode (mtr hostname), the following keys are available:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;h&#039;&#039;&#039; — Display help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;d&#039;&#039;&#039; — Toggle display mode, cycling through different views.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;n&#039;&#039;&#039; — Toggle between hostnames and IP addresses.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;r&#039;&#039;&#039; — Reset all statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;p&#039;&#039;&#039; — Pause/unpause the display.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;q&#039;&#039;&#039; — Quit MTR.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;u&#039;&#039;&#039; — Switch between ICMP, UDP, and TCP modes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;y&#039;&#039;&#039; — Switch between IPv4 and IPv6.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;o&#039;&#039;&#039; — Toggle field display options.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;j&#039;&#039;&#039; — Toggle latency display.&lt;br /&gt;
&lt;br /&gt;
=== Practical Troubleshooting Scenarios ===&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1: Diagnosing a Slow Website ====&lt;br /&gt;
 mtr --report-cycles 100 --no-dns example.com&lt;br /&gt;
Look for high average latency at specific hops, packet loss at the destination, and high StDev values indicating jitter.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2: Testing if a Firewall Blocks SSH ====&lt;br /&gt;
 sudo mtr --tcp --port 22 --report-cycles 50 remote-server.com&lt;br /&gt;
If the last hop shows 100% loss but earlier hops are fine, port 22 may be filtered. Run a standard ICMP test for comparison.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3: ISP Performance Issues ====&lt;br /&gt;
 mtr --report-cycles 100 8.8.8.8&lt;br /&gt;
 mtr --report-cycles 100 1.1.1.1&lt;br /&gt;
If issues appear in the first three or four hops, the problem is likely within your ISP’s network. If issues appear later, the problem lies beyond your ISP.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4: VPN Troubleshooting ====&lt;br /&gt;
 # Test before connecting to VPN&lt;br /&gt;
 mtr --report-cycles 50 --no-dns google.com &amp;gt; before-vpn.txt&lt;br /&gt;
 &lt;br /&gt;
 # Test after connecting to VPN&lt;br /&gt;
 mtr --report-cycles 50 --no-dns google.com &amp;gt; after-vpn.txt&lt;br /&gt;
 &lt;br /&gt;
 # Compare the two&lt;br /&gt;
 diff before-vpn.txt after-vpn.txt&lt;br /&gt;
&lt;br /&gt;
==== Scenario 5: Gaming/Streaming Performance ====&lt;br /&gt;
 mtr --report-cycles 200 game-server.com&lt;br /&gt;
For real-time applications, look for low average latency (under 50ms for gaming), low StDev (under 5ms preferred), and zero packet loss.&lt;br /&gt;
&lt;br /&gt;
==== Scenario 6: Intermittent Connectivity ====&lt;br /&gt;
 # Long-running test to catch intermittent issues&lt;br /&gt;
 mtr --report-cycles 500 --interval 1 target.com &amp;gt; long-test.txt&lt;br /&gt;
 &lt;br /&gt;
 # Or monitor in real-time for several minutes&lt;br /&gt;
 mtr target.com&lt;br /&gt;
&lt;br /&gt;
=== Continuous Monitoring ===&lt;br /&gt;
&lt;br /&gt;
==== Log Network Performance Over Time ====&lt;br /&gt;
 while true; do&lt;br /&gt;
     timestamp=$(date +%Y%m%d-%H%M%S)&lt;br /&gt;
     mtr --report --report-cycles 50 google.com &amp;gt; &amp;quot;mtr-$timestamp.txt&amp;quot;&lt;br /&gt;
     sleep 3600&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
==== Monitor Multiple Destinations ====&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 echo &amp;quot;=== MTR Report $(date) ===&amp;quot; &amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Google DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 8.8.8.8 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Cloudflare DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 --no-dns 1.1.1.1 &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Your Server:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
 mtr --report --report-cycles 50 your-server.com &amp;gt;&amp;gt; daily-network-report.txt&lt;br /&gt;
&lt;br /&gt;
=== Useful Aliases for .bashrc ===&lt;br /&gt;
 # Quick network path analysis&lt;br /&gt;
 alias mtrreport=&#039;mtr --report --report-cycles 50 --no-dns&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Monitor connection to Google DNS&lt;br /&gt;
 alias netcheck=&#039;mtr --report-cycles 20 8.8.8.8&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Extended network test&lt;br /&gt;
 alias mtrlong=&#039;mtr --report-cycles 100&#039;&lt;br /&gt;
 &lt;br /&gt;
 # TCP port 443 test (HTTPS)&lt;br /&gt;
 alias mtrhttps=&#039;sudo mtr --tcp --port 443 --report-cycles 30&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Quick comparison of major DNS providers&lt;br /&gt;
 alias dnstest=&#039;echo &amp;quot;Google:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 8.8.8.8 &amp;amp;&amp;amp; echo -e &amp;quot;\nCloudflare:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 1.1.1.1&#039;&lt;br /&gt;
After adding to ~/.bashrc, reload with:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting Tips ===&lt;br /&gt;
&#039;&#039;&#039;Permission issues with TCP mode:&#039;&#039;&#039;&lt;br /&gt;
 # Use sudo for TCP on privileged ports&lt;br /&gt;
 sudo mtr --tcp --port 443 example.com&lt;br /&gt;
 &lt;br /&gt;
 # Or set capabilities (one-time setup)&lt;br /&gt;
 sudo setcap cap_net_raw+ep /usr/bin/mtr-packet&lt;br /&gt;
&#039;&#039;&#039;False positives:&#039;&#039;&#039; Packet loss at an intermediate hop but not at the destination is almost always ICMP rate limiting at that router, not a real problem. Example:&lt;br /&gt;
 3.|-- router.isp.net            20.0%    50   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
 4.|-- next-hop.net               0.0%    50   18.5  19.2  17.8  22.1   1.3&lt;br /&gt;
 5.|-- destination.com            0.0%    50   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
Hop 3 shows 20% loss, but hops 4 and 5 show 0%. Traffic is flowing normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DNS resolution delays:&#039;&#039;&#039; If MTR is slow to start, skip DNS resolution with mtr --no-dns target.com and resolve addresses afterward with host 203.0.113.1 if needed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Comparing results:&#039;&#039;&#039;&lt;br /&gt;
 mtr --report --report-cycles 50 example.com &amp;gt; test1.txt&lt;br /&gt;
 sleep 60&lt;br /&gt;
 mtr --report --report-cycles 50 example.com &amp;gt; test2.txt&lt;br /&gt;
 diff test1.txt test2.txt&lt;br /&gt;
&lt;br /&gt;
=== When to Use MTR vs Other Tools ===&lt;br /&gt;
&#039;&#039;&#039;MTR&#039;&#039;&#039; — Best for continuous monitoring, identifying problem hops, and gathering detailed statistics. Requires installation via apt.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ping&#039;&#039;&#039; — Best for a quick connectivity test or simple latency check. Only tests the endpoint, not the path.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;traceroute&#039;&#039;&#039; — Best for one-time path discovery. Provides no continuous monitoring.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ss / netstat&#039;&#039;&#039; — Best for checking local connection status. Doesn’t test remote paths.&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
Run at least 50–100 cycles for accurate statistics. Use --no-dns for faster results and to avoid DNS resolution issues during testing. Test at different times of day, since network conditions vary. If one protocol shows issues, compare ICMP, UDP, and TCP modes. Save reports with timestamps for trend analysis. Use 8.8.8.8 or 1.1.1.1 as known-good hosts to verify your local network first. Let MTR run for at least 30–60 seconds before drawing conclusions.&lt;br /&gt;
&lt;br /&gt;
=== Reading Between the Lines ===&lt;br /&gt;
&#039;&#039;&#039;Good network health:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.1   1.2   0.9   2.1   0.2&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    50    8.2   8.5   7.5  10.2   0.5&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    50   15.1  15.5  14.0  18.3   0.8&lt;br /&gt;
   4.|-- google.com                 0.0%    50   24.8  25.2  23.5  28.1   1.1&lt;br /&gt;
No packet loss, consistent latency, low jitter throughout.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problematic network:&#039;&#039;&#039;&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    50    1.2   1.5   1.0   2.3   0.3&lt;br /&gt;
   2.|-- 10.0.0.1                   5.0%    50   45.3  52.8  8.1  245.2  45.7&lt;br /&gt;
   3.|-- ???                       100.0%   50    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   4.|-- destination.com           15.0%    50   95.4 125.8  48.2 385.5  78.2&lt;br /&gt;
Packet loss at hop 2 and the destination, high jitter, and a very high worst-case latency all point to a genuine problem at or near hop 2.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
MTR is your Swiss Army knife for network diagnostics. Use --report-cycles 50 or higher for reliable data. Watch for packet loss at the destination—intermediate losses may be false positives. High StDev indicates an unstable connection. High average latency points to slow links. Use --no-dns for faster results. Compare ICMP, UDP, and TCP modes if issues appear. Test at different times of day for a complete picture.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 5. Package Management Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Fix Broken Packages ===&lt;br /&gt;
 # Update package lists&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 &lt;br /&gt;
 # Fix broken dependencies&lt;br /&gt;
 sudo apt --fix-broken install&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure packages&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
 # No output means there is nothing to reconfigure&lt;br /&gt;
 &lt;br /&gt;
 # Clean package cache&lt;br /&gt;
 sudo apt clean&lt;br /&gt;
 sudo apt autoclean&lt;br /&gt;
 &lt;br /&gt;
 # Remove unused packages&lt;br /&gt;
 sudo apt autoremove&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 # If apt is locked, find the process holding the lock&lt;br /&gt;
 sudo lsof /var/lib/dpkg/lock-frontend&lt;br /&gt;
 &lt;br /&gt;
 # Remove the lock (use with caution—only if no package manager is running)&lt;br /&gt;
 sudo rm /var/lib/dpkg/lock-frontend&lt;br /&gt;
 sudo rm /var/lib/apt/lists/lock&lt;br /&gt;
 &lt;br /&gt;
 # Reconfigure dpkg&lt;br /&gt;
 sudo dpkg --configure -a&lt;br /&gt;
Disk &amp;amp; Filesystem Issues&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 # Check disk space&lt;br /&gt;
 df -h&lt;br /&gt;
 &lt;br /&gt;
 # Check inode usage&lt;br /&gt;
 df -i&lt;br /&gt;
 &lt;br /&gt;
 # View disk I/O statistics&lt;br /&gt;
 # iostat is part of the sysstat package, which also includes:&lt;br /&gt;
 # mpstat (CPU statistics), sar (system activity reporter),&lt;br /&gt;
 # pidstat (process statistics), and cifsiostat (CIFS statistics)&lt;br /&gt;
 sudo apt install sysstat&lt;br /&gt;
 &lt;br /&gt;
 iostat -x 1&lt;br /&gt;
 &lt;br /&gt;
 # Show stats in MB instead of KB&lt;br /&gt;
 iostat -xm 2&lt;br /&gt;
 &lt;br /&gt;
 # Monitor a specific device&lt;br /&gt;
 iostat -x sda 1&lt;br /&gt;
 &lt;br /&gt;
 # Check for disk errors in dmesg&lt;br /&gt;
 sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # SMART disk health (requires smartmontools)&lt;br /&gt;
 sudo apt install smartmontools&lt;br /&gt;
 sudo smartctl -a /dev/sda&lt;br /&gt;
&lt;br /&gt;
=== Repair Filesystem ===&lt;br /&gt;
 # Unmount the partition first&lt;br /&gt;
 sudo umount /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Run filesystem check&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # For ext4 specifically&lt;br /&gt;
 sudo e2fsck -f /dev/sdXN&lt;br /&gt;
Performance Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Resource Hogs ===&lt;br /&gt;
 # CPU usage by process&lt;br /&gt;
 top -o %CPU&lt;br /&gt;
 &lt;br /&gt;
 # Memory usage by process&lt;br /&gt;
 top -o %MEM&lt;br /&gt;
 &lt;br /&gt;
 # Disk usage by directory&lt;br /&gt;
 du -sh /* | sort -h&lt;br /&gt;
 &lt;br /&gt;
 # Find large files&lt;br /&gt;
 find / -type f -size +100M 2&amp;gt;/dev/null&lt;br /&gt;
 &lt;br /&gt;
 # Check running processes sorted by memory use&lt;br /&gt;
 ps aux --sort=-%mem | head -20&lt;br /&gt;
&lt;br /&gt;
=== System Temperature Monitoring ===&lt;br /&gt;
 # Install lm-sensors if not already present&lt;br /&gt;
 sudo apt install lm-sensors&lt;br /&gt;
 sudo sensors-detect&lt;br /&gt;
 &lt;br /&gt;
 # View temperatures&lt;br /&gt;
 sensors&lt;br /&gt;
 &lt;br /&gt;
 # Real-time temperature monitoring&lt;br /&gt;
 watch -n 2 sensors&lt;br /&gt;
See section 12 for a shell alias that makes temperature monitoring more convenient.&lt;br /&gt;
&lt;br /&gt;
Service &amp;amp; Application Errors&lt;br /&gt;
&lt;br /&gt;
=== Debug Service Problems ===&lt;br /&gt;
 # Check service status&lt;br /&gt;
 sudo systemctl status service-name&lt;br /&gt;
 &lt;br /&gt;
 # View service logs&lt;br /&gt;
 sudo journalctl -u service-name&lt;br /&gt;
 &lt;br /&gt;
 # Restart a service&lt;br /&gt;
 sudo systemctl restart service-name&lt;br /&gt;
 &lt;br /&gt;
 # Enable service at boot&lt;br /&gt;
 sudo systemctl enable service-name&lt;br /&gt;
 &lt;br /&gt;
 # View recent service failures&lt;br /&gt;
 journalctl -p err -b&lt;br /&gt;
&lt;br /&gt;
=== Application Crash Investigation ===&lt;br /&gt;
 # Check for core dumps&lt;br /&gt;
 ls -lh /var/crash/&lt;br /&gt;
 &lt;br /&gt;
 # View available application logs&lt;br /&gt;
 ls /var/log/&lt;br /&gt;
 &lt;br /&gt;
 # Follow syslog for application errors in real-time&lt;br /&gt;
 sudo tail -f /var/log/syslog&lt;br /&gt;
Permission &amp;amp; Access Issues&lt;br /&gt;
&lt;br /&gt;
=== Fix Common Permission Problems ===&lt;br /&gt;
 # Check file ownership&lt;br /&gt;
 ls -l /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change ownership (user:group)&lt;br /&gt;
 sudo chown user:group /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Change permissions&lt;br /&gt;
 sudo chmod 644 /path/to/file&lt;br /&gt;
 &lt;br /&gt;
 # Recursively fix permissions on a directory&lt;br /&gt;
 sudo chown -R user:group /path/to/directory&lt;br /&gt;
&lt;br /&gt;
=== User &amp;amp; Authentication Issues ===&lt;br /&gt;
 # Check user information&lt;br /&gt;
 id username&lt;br /&gt;
 &lt;br /&gt;
 # View user login history&lt;br /&gt;
 last -a&lt;br /&gt;
 &lt;br /&gt;
 # Check failed login attempts&lt;br /&gt;
 sudo journalctl | grep &amp;quot;authentication failure&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Reset user password&lt;br /&gt;
 sudo passwd username&lt;br /&gt;
Hardware Issues&lt;br /&gt;
&lt;br /&gt;
=== Identify Hardware ===&lt;br /&gt;
 # List all hardware (install if needed: sudo apt install lshw)&lt;br /&gt;
 sudo lshw -short&lt;br /&gt;
 &lt;br /&gt;
 # PCI devices&lt;br /&gt;
 lspci -v&lt;br /&gt;
 &lt;br /&gt;
 # USB devices&lt;br /&gt;
 lsusb -v&lt;br /&gt;
 &lt;br /&gt;
 # CPU information&lt;br /&gt;
 lscpu&lt;br /&gt;
 &lt;br /&gt;
 # Memory information&lt;br /&gt;
 sudo dmidecode --type memory&lt;br /&gt;
&lt;br /&gt;
=== Check Hardware Errors ===&lt;br /&gt;
 # Kernel ring buffer (hardware messages)&lt;br /&gt;
 dmesg | less&lt;br /&gt;
 # Press q to quit&lt;br /&gt;
 &lt;br /&gt;
 # Search for specific hardware issues&lt;br /&gt;
 dmesg | grep -i &amp;quot;error\|fail\|warn&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Check for USB issues&lt;br /&gt;
 dmesg | grep -i usb&lt;br /&gt;
Quick Diagnostic Commands&lt;br /&gt;
&lt;br /&gt;
=== System Information at a Glance ===&lt;br /&gt;
 # Uptime and load average&lt;br /&gt;
 uptime&lt;br /&gt;
 &lt;br /&gt;
 # Kernel version&lt;br /&gt;
 uname -r&lt;br /&gt;
 &lt;br /&gt;
 # Debian version&lt;br /&gt;
 cat /etc/debian_version&lt;br /&gt;
 &lt;br /&gt;
 # Full system summary (install if needed: sudo apt install inxi)&lt;br /&gt;
 sudo inxi -Fxz&lt;br /&gt;
&lt;br /&gt;
=== Emergency Toolkit ===&lt;br /&gt;
 # Create a consolidated diagnostic report&lt;br /&gt;
 sudo journalctl -b &amp;gt; ~/system-report.txt&lt;br /&gt;
 dmesg &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 systemctl --failed &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 df -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 free -h &amp;gt;&amp;gt; ~/system-report.txt&lt;br /&gt;
 &lt;br /&gt;
 # Watch logs in real-time&lt;br /&gt;
 sudo journalctl -f&lt;br /&gt;
 &lt;br /&gt;
 # Monitor system resources continuously&lt;br /&gt;
 watch -n 1 &#039;free -h &amp;amp;&amp;amp; df -h&#039;&lt;br /&gt;
Useful Aliases &amp;amp; Shortcuts&lt;br /&gt;
Add these to your ~/.bashrc for quick access to common troubleshooting commands:&lt;br /&gt;
 # Monitor system temperatures in real-time&lt;br /&gt;
 alias temps=&amp;quot;watch -n 2 &#039;for i in /sys/class/hwmon/hwmon*/; do echo -n \&amp;quot;\$(cat \${i}name): \&amp;quot;; cat \${i}temp*_input 2&amp;gt;/dev/null | while read temp; do echo \&amp;quot;scale=1; \$temp/1000\&amp;quot; | bc; done | tr \&amp;quot;\n\&amp;quot; \&amp;quot; \&amp;quot;; echo \&amp;quot;°C\&amp;quot;; done&#039;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Quick system status&lt;br /&gt;
 alias sysstat=&#039;echo &amp;quot;=== CPU ===&amp;quot; &amp;amp;&amp;amp; uptime &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Memory ===&amp;quot; &amp;amp;&amp;amp; free -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Disk ===&amp;quot; &amp;amp;&amp;amp; df -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Top Processes ===&amp;quot; &amp;amp;&amp;amp; ps aux --sort=-%mem | head -10&#039;&lt;br /&gt;
 &lt;br /&gt;
 # View last boot logs&lt;br /&gt;
 alias lastboot=&#039;journalctl -b -1&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Check failed services&lt;br /&gt;
 alias failedservices=&#039;systemctl --failed&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Monitor logs in real-time&lt;br /&gt;
 alias watchlog=&#039;sudo journalctl -f&#039;&lt;br /&gt;
 &lt;br /&gt;
 # Quick network status&lt;br /&gt;
 alias netstatus=&#039;ip addr show &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Routes ===&amp;quot; &amp;amp;&amp;amp; ip route show&#039;&lt;br /&gt;
After adding these, reload your shell configuration:&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
Tips for Effective Troubleshooting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check logs first.&#039;&#039;&#039; journalctl and dmesg are your best starting point for almost any problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Change one thing at a time.&#039;&#039;&#039; It’s tempting to make several changes at once, but doing so makes it impossible to know what actually fixed—or broke—the problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Document your changes.&#039;&#039;&#039; Keep notes on what you’ve tried and what the results were. You’ll thank yourself later.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use exact error messages.&#039;&#039;&#039; Copy error messages verbatim and search for them alongside “Debian” and the version number—for example, “Debian 13” or “Debian 13.1” for point releases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Check what changed recently.&#039;&#039;&#039; Did you install something, update packages, or change the kernel before the problem appeared? Start there.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Back up before making major changes.&#039;&#039;&#039; This goes without saying, but it’s easy to skip when you’re in a hurry.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use verbose mode.&#039;&#039;&#039; Adding -v or -vv flags to commands often reveals what would otherwise be silent failures.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the community.&#039;&#039;&#039; The Debian forums, Reddit, Stack Exchange, and the Debian mailing lists are all active and well-indexed. Someone has usually seen your problem before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by &amp;lt;dfn&amp;gt;distro-nix&amp;lt;/dfn&amp;gt; to the Debian User Forums on 2025-10-27.&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=264</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=264"/>
		<updated>2026-05-14T19:02:31Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: Pasting updated sections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Author:&#039;&#039;&#039; distro-nix &#039;&#039;&#039;Forum Profile:&#039;&#039;&#039; &amp;lt;dfn&amp;gt;&amp;lt;nowiki&amp;gt;https://forums.debian.net/memberlist.php?mode=viewprofile&amp;amp;u=239099&amp;lt;/nowiki&amp;gt;&amp;lt;/dfn&amp;gt; &#039;&#039;&#039;Debian Version:&#039;&#039;&#039; Debian 13 (Trixie) &#039;&#039;&#039;Kernel Versions Tested:&#039;&#039;&#039; 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64 (x86_64) &#039;&#039;&#039;Created:&#039;&#039;&#039; 2025-10-27 &#039;&#039;&#039;Last Updated:&#039;&#039;&#039; 2026-03-11 &#039;&#039;&#039;ID:&#039;&#039;&#039; 544000.5 &#039;&#039;&#039;License:&#039;&#039;&#039; CC BY-SA 4.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This guide is preserved in its original form. Questions and feedback welcome via the author’s &amp;lt;dfn&amp;gt;Debian Forums profile&amp;lt;/dfn&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The Debian First Aid Kit is a practical reference for diagnosing and resolving common system problems on Debian GNU/Linux. It covers ten categories of failure: system freezes and crashes, boot problems, network issues, package management, disk and filesystem errors, performance degradation, service and application failures, permission and access problems, hardware identification and errors, and quick diagnostics. Each section gives the relevant commands so you can understand what they do and why, rather than a bare list to copy and paste blindly. A dedicated section covers MTR (Matt’s Traceroute) in depth, including output interpretation, practical troubleshooting, and how to monitor continuously. The guide also includes a set of shell aliases for faster access to common diagnostic tasks. All commands are verified on Debian 13 (Trixie) running kernel 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64. This document is intended for users with basic command-line familiarity who need a reliable, consolidated reference when something goes wrong.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Keywords:&#039;&#039;&#039; Debian, troubleshooting, system administration, MTR, network diagnostics, package management, journalctl, filesystem repair&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tested Commands Disclaimer ==&lt;br /&gt;
All commands in this document have been verified on Debian 13 (Trixie) with the kernel versions listed above. Results may vary on other releases or hardware configurations. Always test in a safe environment before applying any procedure to a production system.&lt;br /&gt;
&lt;br /&gt;
== System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
 # View logs from previous boot (after freeze/crash)&lt;br /&gt;
 journalctl -b -1&lt;br /&gt;
 &lt;br /&gt;
 # List all available boots&lt;br /&gt;
 journalctl --list-boots&lt;br /&gt;
 &lt;br /&gt;
 # Show only kernel messages from previous boot&lt;br /&gt;
 journalctl -b -1 -k&lt;br /&gt;
 &lt;br /&gt;
 # Show errors and critical messages only&lt;br /&gt;
 journalctl -b -1 -p err&lt;br /&gt;
 &lt;br /&gt;
 # Save logs to file for analysis&lt;br /&gt;
 journalctl -b -1 &amp;gt; ~/crash-log.txt&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics:&#039;&#039;&#039; Search for “kernel panic” or “Oops”&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM):&#039;&#039;&#039; Search for “Out of memory” or “oom-killer”&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors:&#039;&#039;&#039; Look for “MCE” (Machine Check Exception) or “hardware error”&lt;br /&gt;
* &#039;&#039;&#039;Driver issues:&#039;&#039;&#039; Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating:&#039;&#039;&#039; Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 # View memory usage&lt;br /&gt;
 free -h&lt;br /&gt;
 &lt;br /&gt;
 # Check disk space&lt;br /&gt;
 df -h&lt;br /&gt;
 &lt;br /&gt;
 # Monitor system resources in real-time&lt;br /&gt;
 htop&lt;br /&gt;
 # or&lt;br /&gt;
 top&lt;br /&gt;
 &lt;br /&gt;
 # btop provides a more detailed visual interface and can be installed via:&lt;br /&gt;
 sudo apt install btop&lt;br /&gt;
 &lt;br /&gt;
 # Check for disk errors&lt;br /&gt;
 sudo dmesg | grep -i error&lt;br /&gt;
The following are permanent errors caused by incomplete or buggy ACPI tables in the BIOS. They are harmless and can be safely ignored if they appear on your system:&lt;br /&gt;
 [0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&lt;br /&gt;
 [0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&lt;br /&gt;
 [0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&lt;br /&gt;
&lt;br /&gt;
== Boot Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Check Boot Process ===&lt;br /&gt;
 # View systemd boot analysis&lt;br /&gt;
 systemd-analyze blame&lt;br /&gt;
 &lt;br /&gt;
 # See what failed during boot&lt;br /&gt;
 systemctl --failed&lt;br /&gt;
 &lt;br /&gt;
 # Check specific service status&lt;br /&gt;
 systemctl status &amp;lt;service-name&amp;gt;&lt;br /&gt;
 # e.g. systemctl status NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 # Repair filesystem errors — first identify the device with lsblk&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Reinstall GRUB bootloader&lt;br /&gt;
 sudo grub-install /dev/sdX&lt;br /&gt;
 sudo update-grub&lt;br /&gt;
 &lt;br /&gt;
 # Check fstab for mount errors&lt;br /&gt;
 cat /etc/fstab&lt;br /&gt;
&lt;br /&gt;
== Network Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose Network Connection ===&lt;br /&gt;
 # Check network interfaces&lt;br /&gt;
 ip addr show&lt;br /&gt;
 &lt;br /&gt;
 # Test IPv4 connectivity&lt;br /&gt;
 ping -c 4 8.8.8.8&lt;br /&gt;
 &lt;br /&gt;
 # Test IPv6 connectivity&lt;br /&gt;
 ping -c 6 2a00:1450:4007:809::200e&lt;br /&gt;
 &lt;br /&gt;
 # Check DNS resolution&lt;br /&gt;
 nslookup google.com&lt;br /&gt;
 &lt;br /&gt;
 # View routing table&lt;br /&gt;
 ip route show&lt;br /&gt;
 &lt;br /&gt;
 # Check active connections&lt;br /&gt;
 ss -tuln&lt;br /&gt;
&lt;br /&gt;
=== Restart Network Service ===&lt;br /&gt;
 # For systems with NetworkManager&lt;br /&gt;
 sudo systemctl restart NetworkManager&lt;br /&gt;
 &lt;br /&gt;
 # For systems with networking service&lt;br /&gt;
 sudo systemctl restart networking&lt;br /&gt;
 &lt;br /&gt;
 # Bring interface down and up&lt;br /&gt;
 sudo ip link set eth0 down&lt;br /&gt;
 sudo ip link set eth0 up&lt;br /&gt;
&lt;br /&gt;
== MTR (Matt’s Traceroute) ==&lt;br /&gt;
MTR combines the functionality of ping and traceroute into a single real-time network diagnostic tool. It continuously monitors the path between your system and a destination, providing detailed statistics about latency and packet loss at each hop. When you need to demonstrate a network problem that is outside your control—to your hosting provider, for example—MTR gives you the evidence to do so.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
 sudo apt install mtr&lt;br /&gt;
&lt;br /&gt;
=== Basic Usage ===&lt;br /&gt;
 # Basic MTR (interactive mode)&lt;br /&gt;
 mtr google.com&lt;br /&gt;
 &lt;br /&gt;
 # Report mode (run 10 cycles and exit)&lt;br /&gt;
 mtr --report google.com&lt;br /&gt;
 &lt;br /&gt;
 # Specify number of pings&lt;br /&gt;
 mtr --report-cycles 50 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use TCP instead of ICMP&lt;br /&gt;
 mtr --tcp google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use UDP&lt;br /&gt;
 mtr --udp google.com&lt;br /&gt;
 &lt;br /&gt;
 # No DNS resolution (faster, shows IPs only)&lt;br /&gt;
 mtr --no-dns google.com&lt;br /&gt;
 &lt;br /&gt;
 # Show both hostnames and IPs&lt;br /&gt;
 mtr --show-ips google.com&lt;br /&gt;
&lt;br /&gt;
== Understanding MTR Output ==&lt;br /&gt;
&lt;br /&gt;
==== Sample Output ====&lt;br /&gt;
 HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
   1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
   2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
   3.|-- isp-gateway.net            0.0%    10   15.3  16.1  14.2  19.8   1.8&lt;br /&gt;
   4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
   5.|-- google.com                 0.0%    10   25.4  26.8  24.1  32.5   2.4&lt;br /&gt;
&lt;br /&gt;
=== Column Meanings ===&lt;br /&gt;
&#039;&#039;&#039;HOST&#039;&#039;&#039; — Hostname or IP address of each hop in the route.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loss%&#039;&#039;&#039; — Percentage of packets lost at this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Snt&#039;&#039;&#039; — Number of packets sent to this hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last&#039;&#039;&#039; — Latency of the most recent packet, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Avg&#039;&#039;&#039; — Average latency across all packets sent, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best&#039;&#039;&#039; — Lowest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wrst&#039;&#039;&#039; — Highest latency recorded, in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StDev&#039;&#039;&#039; — Standard deviation of latency measurements—lower values indicate a more stable connection.&lt;br /&gt;
&lt;br /&gt;
=== Interpreting Results ===&lt;br /&gt;
A healthy network shows 0% loss on all hops, stable latency with low StDev values, a gradual latency increase as hop count increases, and consistent response times.&lt;br /&gt;
&lt;br /&gt;
==== Problem Indicators ====&lt;br /&gt;
&#039;&#039;&#039;1. High Packet Loss at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 5.|-- problem-router.net        25.0%    10   45.3  48.2  42.1  65.8  8.4&lt;br /&gt;
If loss continues to the destination, there is a real problem at that router. If loss appears only at that hop but not beyond, the router is likely rate-limiting ICMP responses—a false positive, not a real problem. The rule of thumb: if packet loss appears at hop N but hops N+1, N+2, and beyond show 0% loss, it’s almost certainly ICMP rate limiting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. High Latency at a Specific Hop&#039;&#039;&#039;&lt;br /&gt;
 3.|-- slow-link.net              0.0%    10  150.3 155.2 148.1 165.8  5.4&lt;br /&gt;
This indicates a network bottleneck, a congested link, geographical distance (intercontinental hops), or slow routing equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. No Response (???)&#039;&#039;&#039;&lt;br /&gt;
 4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&lt;br /&gt;
The router at this hop is configured not to respond to ICMP or traceroute packets, or a firewall is blocking diagnostic packets. This is not necessarily a problem if later hops respond normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. High Jitter (StDev)&#039;&#039;&#039;&lt;br /&gt;
 6.|-- unstable.net               0.0%    10   35.3  52.8  28.1  95.2  24.7&lt;br /&gt;
A high StDev (24.7ms in this example) indicates inconsistent latency caused by network congestion or instability. This is particularly noticeable in real-time applications such as VoIP, gaming, and video calls.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Sudden Latency Spike&#039;&#039;&#039;&lt;br /&gt;
 1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&lt;br /&gt;
 2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&lt;br /&gt;
 3.|-- problematic-hop.net        0.0%    10  180.5 185.2 178.1 195.8  6.4&lt;br /&gt;
 4.|-- next-hop.net               0.0%    10  182.3 187.8 180.5 198.2  6.8&lt;br /&gt;
Hop 3 introduces approximately 170ms of additional latency (jumping from 9ms to 180ms). Everything from hop 3 onward carries that penalty.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Report Mode with Different Output Formats ====&lt;br /&gt;
 # CSV format for logging and analysis&lt;br /&gt;
 mtr --report --csv google.com &amp;gt; network-report.csv&lt;br /&gt;
 &lt;br /&gt;
 # JSON output for parsing&lt;br /&gt;
 mtr --report --json google.com&lt;br /&gt;
 &lt;br /&gt;
 # XML format&lt;br /&gt;
 mtr --report --xml google.com&lt;br /&gt;
 &lt;br /&gt;
 # Wide report (no abbreviations)&lt;br /&gt;
 mtr --report-wide google.com&lt;br /&gt;
&lt;br /&gt;
==== Protocol Selection ====&lt;br /&gt;
 # Use ICMP (default)&lt;br /&gt;
 mtr google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use UDP&lt;br /&gt;
 mtr --udp google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use TCP&lt;br /&gt;
 mtr --tcp google.com&lt;br /&gt;
 &lt;br /&gt;
 # Test a specific TCP port&lt;br /&gt;
 sudo mtr --tcp --port 443 google.com&lt;br /&gt;
 sudo mtr --tcp --port 22 remote-server.com&lt;br /&gt;
&lt;br /&gt;
==== Timing and Duration ====&lt;br /&gt;
 # Specify interval between pings (default 1 second)&lt;br /&gt;
 mtr --interval 0.5 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Extended test with 100 cycles&lt;br /&gt;
 mtr --report-cycles 100 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Continuous monitoring (Ctrl+C to stop)&lt;br /&gt;
 mtr google.com&lt;br /&gt;
 &lt;br /&gt;
 # Quick 10-cycle report&lt;br /&gt;
 mtr --report-cycles 10 google.com&lt;br /&gt;
&lt;br /&gt;
==== Advanced Options ====&lt;br /&gt;
 # Show Autonomous System (AS) numbers&lt;br /&gt;
 mtr --aslookup google.com&lt;br /&gt;
 &lt;br /&gt;
 # Set maximum number of hops&lt;br /&gt;
 mtr --max-ttl 20 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Set packet size&lt;br /&gt;
 mtr --psize 1000 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Show both IP and hostname&lt;br /&gt;
 mtr --show-ips google.com&lt;br /&gt;
 &lt;br /&gt;
 # Specify source address (useful with multiple network interfaces)&lt;br /&gt;
 mtr --address 192.168.1.100 google.com&lt;br /&gt;
 &lt;br /&gt;
 # IPv4 only&lt;br /&gt;
 mtr -4 google.com&lt;br /&gt;
 &lt;br /&gt;
 # IPv6 only&lt;br /&gt;
 mtr -6 google.com&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=263</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=263"/>
		<updated>2026-05-14T18:22:23Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: Repasting new sections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Author:&#039;&#039;&#039; distro-nix &#039;&#039;&#039;Forum Profile:&#039;&#039;&#039; &amp;lt;dfn&amp;gt;&amp;lt;nowiki&amp;gt;https://forums.debian.net/memberlist.php?mode=viewprofile&amp;amp;u=239099&amp;lt;/nowiki&amp;gt;&amp;lt;/dfn&amp;gt; &#039;&#039;&#039;Debian Version:&#039;&#039;&#039; Debian 13 (Trixie) &#039;&#039;&#039;Kernel Versions Tested:&#039;&#039;&#039; 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64 (x86_64) &#039;&#039;&#039;Created:&#039;&#039;&#039; 2025-10-27 &#039;&#039;&#039;Last Updated:&#039;&#039;&#039; 2026-03-11 &#039;&#039;&#039;ID:&#039;&#039;&#039; 544000.5 &#039;&#039;&#039;License:&#039;&#039;&#039; CC BY-SA 4.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This guide is preserved in its original form. Questions and feedback welcome via the author’s &amp;lt;dfn&amp;gt;Debian Forums profile&amp;lt;/dfn&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The Debian First Aid Kit is a practical reference for diagnosing and resolving common system problems on Debian GNU/Linux. It covers ten categories of failure: system freezes and crashes, boot problems, network issues, package management, disk and filesystem errors, performance degradation, service and application failures, permission and access problems, hardware identification and errors, and quick diagnostics. Each section gives the relevant commands so you can understand what they do and why, rather than a bare list to copy and paste blindly. A dedicated section covers MTR (Matt’s Traceroute) in depth, including output interpretation, practical troubleshooting, and how to monitor continuously. The guide also includes a set of shell aliases for faster access to common diagnostic tasks. All commands are verified on Debian 13 (Trixie) running kernel 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64. This document is intended for users with basic command-line familiarity who need a reliable, consolidated reference when something goes wrong.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Keywords:&#039;&#039;&#039; Debian, troubleshooting, system administration, MTR, network diagnostics, package management, journalctl, filesystem repair&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tested Commands Disclaimer ==&lt;br /&gt;
All commands in this document have been verified on Debian 13 (Trixie) with the kernel versions listed above. Results may vary on other releases or hardware configurations. Always test in a safe environment before applying any procedure to a production system.&lt;br /&gt;
&lt;br /&gt;
== System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
 # View logs from previous boot (after freeze/crash)&lt;br /&gt;
 journalctl -b -1&lt;br /&gt;
 &lt;br /&gt;
 # List all available boots&lt;br /&gt;
 journalctl --list-boots&lt;br /&gt;
 &lt;br /&gt;
 # Show only kernel messages from previous boot&lt;br /&gt;
 journalctl -b -1 -k&lt;br /&gt;
 &lt;br /&gt;
 # Show errors and critical messages only&lt;br /&gt;
 journalctl -b -1 -p err&lt;br /&gt;
 &lt;br /&gt;
 # Save logs to file for analysis&lt;br /&gt;
 journalctl -b -1 &amp;gt; ~/crash-log.txt&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics:&#039;&#039;&#039; Search for “kernel panic” or “Oops”&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM):&#039;&#039;&#039; Search for “Out of memory” or “oom-killer”&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors:&#039;&#039;&#039; Look for “MCE” (Machine Check Exception) or “hardware error”&lt;br /&gt;
* &#039;&#039;&#039;Driver issues:&#039;&#039;&#039; Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating:&#039;&#039;&#039; Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 # View memory usage&lt;br /&gt;
 free -h&lt;br /&gt;
 &lt;br /&gt;
 # Check disk space&lt;br /&gt;
 df -h&lt;br /&gt;
 &lt;br /&gt;
 # Monitor system resources in real-time&lt;br /&gt;
 htop&lt;br /&gt;
 # or&lt;br /&gt;
 top&lt;br /&gt;
 &lt;br /&gt;
 # btop provides a more detailed visual interface and can be installed via:&lt;br /&gt;
 sudo apt install btop&lt;br /&gt;
 &lt;br /&gt;
 # Check for disk errors&lt;br /&gt;
 sudo dmesg | grep -i error&lt;br /&gt;
The following are permanent errors caused by incomplete or buggy ACPI tables in the BIOS. They are harmless and can be safely ignored if they appear on your system:&lt;br /&gt;
 [0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&lt;br /&gt;
 [0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&lt;br /&gt;
 [0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&lt;br /&gt;
&lt;br /&gt;
== Boot Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Check Boot Process ===&lt;br /&gt;
 # View systemd boot analysis&lt;br /&gt;
 systemd-analyze blame&lt;br /&gt;
 &lt;br /&gt;
 # See what failed during boot&lt;br /&gt;
 systemctl --failed&lt;br /&gt;
 &lt;br /&gt;
 # Check specific service status&lt;br /&gt;
 systemctl status &amp;lt;service-name&amp;gt;&lt;br /&gt;
 # e.g. systemctl status NetworkManager.service&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
Reboot and hold Shift to access the GRUB menu (timing depends on your GRUB configuration). Select “Advanced options”, then choose recovery mode. From the recovery menu, select “root” for a root shell.&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 # Repair filesystem errors — first identify the device with lsblk&lt;br /&gt;
 sudo fsck /dev/sdXN&lt;br /&gt;
 &lt;br /&gt;
 # Reinstall GRUB bootloader&lt;br /&gt;
 sudo grub-install /dev/sdX&lt;br /&gt;
 sudo update-grub&lt;br /&gt;
 &lt;br /&gt;
 # Check fstab for mount errors&lt;br /&gt;
 cat /etc/fstab&lt;br /&gt;
&lt;br /&gt;
== Network Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose Network Connection ===&lt;br /&gt;
 # Check network interfaces&lt;br /&gt;
 ip addr show&lt;br /&gt;
 &lt;br /&gt;
 # Test IPv4 connectivity&lt;br /&gt;
 ping -c 4 8.8.8.8&lt;br /&gt;
 &lt;br /&gt;
 # Test IPv6 connectivity&lt;br /&gt;
 ping -c 6 2a00:1450:4007:809::200e&lt;br /&gt;
 &lt;br /&gt;
 # Check DNS resolution&lt;br /&gt;
 nslookup google.com&lt;br /&gt;
 &lt;br /&gt;
 # View routing table&lt;br /&gt;
 ip route show&lt;br /&gt;
 &lt;br /&gt;
 # Check active connections&lt;br /&gt;
 ss -tuln&lt;br /&gt;
&lt;br /&gt;
=== Restart Network Service ===&lt;br /&gt;
 # For systems with NetworkManager&lt;br /&gt;
 sudo systemctl restart NetworkManager&lt;br /&gt;
 &lt;br /&gt;
 # For systems with networking service&lt;br /&gt;
 sudo systemctl restart networking&lt;br /&gt;
 &lt;br /&gt;
 # Bring interface down and up&lt;br /&gt;
 sudo ip link set eth0 down&lt;br /&gt;
 sudo ip link set eth0 up&lt;br /&gt;
&lt;br /&gt;
== MTR (Matt’s Traceroute) ==&lt;br /&gt;
MTR combines the functionality of ping and traceroute into a single real-time network diagnostic tool. It continuously monitors the path between your system and a destination, providing detailed statistics about latency and packet loss at each hop. When you need to demonstrate a network problem that is outside your control—to your hosting provider, for example—MTR gives you the evidence to do so.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
 sudo apt install mtr&lt;br /&gt;
&lt;br /&gt;
=== Basic Usage ===&lt;br /&gt;
 # Basic MTR (interactive mode)&lt;br /&gt;
 mtr google.com&lt;br /&gt;
 &lt;br /&gt;
 # Report mode (run 10 cycles and exit)&lt;br /&gt;
 mtr --report google.com&lt;br /&gt;
 &lt;br /&gt;
 # Specify number of pings&lt;br /&gt;
 mtr --report-cycles 50 google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use TCP instead of ICMP&lt;br /&gt;
 mtr --tcp google.com&lt;br /&gt;
 &lt;br /&gt;
 # Use UDP&lt;br /&gt;
 mtr --udp google.com&lt;br /&gt;
 &lt;br /&gt;
 # No DNS resolution (faster, shows IPs only)&lt;br /&gt;
 mtr --no-dns google.com&lt;br /&gt;
 &lt;br /&gt;
 # Show both hostnames and IPs&lt;br /&gt;
 mtr --show-ips google.com&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=262</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=262"/>
		<updated>2026-05-14T17:05:04Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: /* Debian First Aid Kit */ Meeting new submission standards&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Author:&#039;&#039;&#039; distro-nix &#039;&#039;&#039;Forum Profile:&#039;&#039;&#039; &amp;lt;dfn&amp;gt;&amp;lt;nowiki&amp;gt;https://forums.debian.net/memberlist.php?mode=viewprofile&amp;amp;u=239099&amp;lt;/nowiki&amp;gt;&amp;lt;/dfn&amp;gt; &#039;&#039;&#039;Debian Version:&#039;&#039;&#039; Debian 13 (Trixie) &#039;&#039;&#039;Kernel Versions Tested:&#039;&#039;&#039; 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64 (x86_64) &#039;&#039;&#039;Created:&#039;&#039;&#039; 2025-10-27 &#039;&#039;&#039;Last Updated:&#039;&#039;&#039; 2026-03-11 &#039;&#039;&#039;ID:&#039;&#039;&#039; 544000.5 &#039;&#039;&#039;License:&#039;&#039;&#039; CC BY-SA 4.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This guide is preserved in its original form. Questions and feedback welcome via the author’s &amp;lt;dfn&amp;gt;Debian Forums profile&amp;lt;/dfn&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The Debian First Aid Kit is a practical reference for diagnosing and resolving common system problems on Debian GNU/Linux. It covers ten categories of failure: system freezes and crashes, boot problems, network issues, package management, disk and filesystem errors, performance degradation, service and application failures, permission and access problems, hardware identification and errors, and quick diagnostics. Each section gives the relevant commands so you can understand what they do and why, rather than a bare list to copy and paste blindly. A dedicated section covers MTR (Matt’s Traceroute) in depth, including output interpretation, practical troubleshooting, and how to monitor continuously. The guide also includes a set of shell aliases for faster access to common diagnostic tasks. All commands are verified on Debian 13 (Trixie) running kernel 6.12.73+deb13-amd64 and 6.16.3+deb13-amd64. This document is intended for users with basic command-line familiarity who need a reliable, consolidated reference when something goes wrong.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Keywords:&#039;&#039;&#039; Debian, troubleshooting, system administration, MTR, network diagnostics, package management, journalctl, filesystem repair&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tested Commands Disclaimer ==&lt;br /&gt;
All commands in this document have been verified on Debian 13 (Trixie) with the kernel versions listed above. Results may vary on other releases or hardware configurations. Always test in a safe environment before applying any procedure to a production system.&lt;br /&gt;
&lt;br /&gt;
== System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
 # View logs from previous boot (after freeze/crash)&lt;br /&gt;
 journalctl -b -1&lt;br /&gt;
 &lt;br /&gt;
 # List all available boots&lt;br /&gt;
 journalctl --list-boots&lt;br /&gt;
 &lt;br /&gt;
 # Show only kernel messages from previous boot&lt;br /&gt;
 journalctl -b -1 -k&lt;br /&gt;
 &lt;br /&gt;
 # Show errors and critical messages only&lt;br /&gt;
 journalctl -b -1 -p err&lt;br /&gt;
 &lt;br /&gt;
 # Save logs to file for analysis&lt;br /&gt;
 journalctl -b -1 &amp;gt; ~/crash-log.txt&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics:&#039;&#039;&#039; Search for “kernel panic” or “Oops”&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM):&#039;&#039;&#039; Search for “Out of memory” or “oom-killer”&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors:&#039;&#039;&#039; Look for “MCE” (Machine Check Exception) or “hardware error”&lt;br /&gt;
* &#039;&#039;&#039;Driver issues:&#039;&#039;&#039; Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating:&#039;&#039;&#039; Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 # View memory usage&lt;br /&gt;
 free -h&lt;br /&gt;
 &lt;br /&gt;
 # Check disk space&lt;br /&gt;
 df -h&lt;br /&gt;
 &lt;br /&gt;
 # Monitor system resources in real-time&lt;br /&gt;
 htop&lt;br /&gt;
 # or&lt;br /&gt;
 top&lt;br /&gt;
 &lt;br /&gt;
 # btop provides a more detailed visual interface and can be installed via:&lt;br /&gt;
 sudo apt install btop&lt;br /&gt;
 &lt;br /&gt;
 # Check for disk errors&lt;br /&gt;
 sudo dmesg | grep -i error&lt;br /&gt;
The following are permanent errors caused by incomplete or buggy ACPI tables in the BIOS. They are harmless and can be safely ignored if they appear on your system:&lt;br /&gt;
 [0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&lt;br /&gt;
 [0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&lt;br /&gt;
 [0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Forums_Cache:About&amp;diff=261</id>
		<title>Debian Forums Cache:About</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Forums_Cache:About&amp;diff=261"/>
		<updated>2026-05-14T14:40:18Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: /* About Debian Forums Cache: */  Added note on accuracy&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== About Debian Forums Cache: ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;About Debian Forums Cache&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Debian Forums Cache exists because good technical work deserves a permanent home.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The Debian forums hold a lot of useful knowledge—tested procedures, hard-won solutions, and practical guides built from real experience. The Archives allows the authors to have cited works and permanent links to their works, something the forums cannot offer.&lt;br /&gt;
&lt;br /&gt;
Forum threads age, and when the forums are down or gone, that knowledge is gone with them.&lt;br /&gt;
&lt;br /&gt;
This cache means content is attributed, versioned, and stable—available whether the forums are there or not. If you wrote something worth keeping, it gets a permanent link. If you are looking for something or sharing something, even in your own writing, you can cite what you find in a readable and professional format.&lt;br /&gt;
&lt;br /&gt;
We&#039;re not an open wiki. Submissions go through a review process, which keeps the quality high and the spam out. That accountability runs both ways: authors stand behind what they publish, and readers can trust that what they&#039;re reading has been verified by their peers, and is known to work with their version.&lt;br /&gt;
&lt;br /&gt;
With that being said, please enjoy the best work of the Debian User Forum community.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A note on accuracy&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Technical content ages. Debian moves forward, and a procedure that worked on Trixie may need adjustment by the time Forky is stable. Every entry in the Cache carries a publication date and the Debian version it was tested against—use those as your guide. If something doesn&#039;t work as described, check the version, check the date, and if you&#039;ve found a genuine error, the CacheHandlers want to know.&lt;br /&gt;
&lt;br /&gt;
The Cache is maintained by community volunteers. Content is peer-reviewed but not formally audited. Use your judgment, test in a safe environment before applying anything critical to production, and as always—have a backup.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=241</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=241"/>
		<updated>2026-04-10T03:21:00Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: /* Citations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created: 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Updated: 2026-04-09 - added references and restructured heading order;&lt;br /&gt;
&lt;br /&gt;
ID: 005146.11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A Debian Live USB with persistence boots a full Debian environment from a USB drive while retaining changes across sessions. Files you create, settings you change, and packages you install survive reboot—stored on a dedicated partition rather than the volatile live environment. Nothing is written to the host machine’s internal disk.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A standard live USB is stateless: each boot starts from the same ISO image. The persistence partition changes that. From a single drive you get your shell configuration, documents, utilities, browser profile, and scripts, available on any machine you boot it from.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== What You’ll Need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum is 4 GB, but that leaves little room for persistence. A 32 GB drive is a practical working size. Download the Debian Live ISO from the official Debian website: &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tools required—dd, fdisk, and mkfs.ext4—are standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Install them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These packages are available from the live session’s apt cache without adding sources. They don’t persist to the USB unless persistence is already active.&lt;br /&gt;
&lt;br /&gt;
== Identifying Your USB Device ==&lt;br /&gt;
Plug in the USB drive and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your USB device will appear as /dev/sdb, /dev/sdc, or similar, depending on what else is attached. Confirm it by cross-referencing the reported size with the known capacity of the drive.&lt;br /&gt;
&lt;br /&gt;
Two placeholders are used throughout this document. /dev/sdX refers to the device itself—substitute your actual device identifier everywhere it appears. /dev/sdXN refers to the persistence partition—N is the partition number you’ll confirm from lsblk output after you&#039;ve created it.&lt;br /&gt;
&lt;br /&gt;
Use the device path, not a partition path: /dev/sdb is correct; /dev/sdb1 is not.&lt;br /&gt;
&lt;br /&gt;
== Boot Entry Selection ==&lt;br /&gt;
The firmware boot menu on many systems presents two entries for a USB device: one labeled with the device name alone, and one prefixed with UEFI:. On the hardware used for this document, selecting the UEFI:-prefixed entry after adding a persistence partition consistently produced a bare grub&amp;gt; prompt rather than the Debian live menu. Selecting the plain device entry booted correctly every time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Throughout this procedure, select the plain device entry—not the one prefixed with UEFI&#039;&#039;&#039;:.&lt;br /&gt;
&lt;br /&gt;
This behavior was observed on specific hardware. Whether it reproduces on all firmware is not established here. The mechanism and a possible explanation are in &amp;lt;ref&amp;gt;https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&amp;lt;/ref&amp;gt; If your firmware presents only a UEFI boot path, recovery from within a booted live session may be possible by correcting the GRUB prefix, but that procedure is outside the scope of this document.&lt;br /&gt;
&lt;br /&gt;
= Procedure =&lt;br /&gt;
&lt;br /&gt;
=== Clean the Drive ===&lt;br /&gt;
If the USB has been used before, you may have residual partition signatures or bootloader data in the early sectors, and they can interfere with the ISO write or the subsequent boot. Clear them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
wipefs removes filesystem and partition table signatures. The dd command zeros the first 200 MB, covering the MBR, GPT header, and any EFI data in the early sectors.&lt;br /&gt;
&lt;br /&gt;
=== Write the ISO ===&lt;br /&gt;
Before running dd, confirm that sync resolves to the system binary and not a shell alias:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should be sync is /usr/bin/sync. If it returns an alias definition instead, unalias it with unalias sync, or substitute /usr/bin/sync explicitly at the end of the dd command.&lt;br /&gt;
&lt;br /&gt;
Write the ISO:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
status=progress shows the running transfer rate. sync flushes the write cache on completion—don’t remove the drive before it returns. The write will take a few minutes depending on the drive’s speed.&lt;br /&gt;
&lt;br /&gt;
=== Verify the Base Boot ===&lt;br /&gt;
Before adding the persistence partition, confirm the ISO write produced a bootable drive. Boot from the USB, selecting the plain &#039;&#039;&#039;(non-UEFI:) device entry.&#039;&#039;&#039; If it reaches the Debian live menu and boots cleanly, you have a confirmed working baseline. If it doesn’t boot at this stage, don’t continue—go back to [[Debian Live USB with Persistence#Procedure|4.1 Clean the Drive]] and continue from there.&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. The persistence partition goes there. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table that supports both BIOS and UEFI boot paths. Adding a partition requires an explicit start sector; without it, fdisk’s default placement can conflict with the hybrid structure in ways that affect the boot. The failure modes of parted and gdisk with this layout are documented in &amp;lt;ref&amp;gt;https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Print the current partition table:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two partitions will be present: the main ISO partition (type 0 or Empty—this is expected for an isohybrid layout) and a small EFI partition of approximately 3.2 MB. The p output shows the end sector of the last partition in the End column. The persistence partition must start at the next sector—that value plus one. On the test hardware with a Debian 13.4 live ISO written to the drive, the last partition ended at sector 8175999 and the persistence partition started at sector 8176000. This figure will vary with the ISO version and release; read your own p output and don’t use the test value without verifying it matches.&lt;br /&gt;
&lt;br /&gt;
Create the new partition:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When fdisk prompts for the first sector, enter the start sector you identified from the p output—do not accept the default. Accept the default for the last sector to use the remaining space on the drive.&lt;br /&gt;
&lt;br /&gt;
If fdisk asks whether to remove an existing ext4 signature, answer &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;. This clears a remnant from a previous attempt.&lt;br /&gt;
&lt;br /&gt;
Write the changes and exit:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After fdisk writes the new partition table, the running kernel may not immediately recognize the change. partprobe signals the kernel to re-read the partition table on the device without requiring a reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it completes, confirm the new partition is visible:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your new partition will appear beneath the device in the output. Note its full identifier—for example, sdb3 or sdc4—as you’ll need it in the next two steps. If it doesn’t appear immediately, wait a moment and run lsblk again before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Format the Partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence. The Debian live system identifies the persistence partition by this label at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Configuration ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdXN /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The / union directive instructs the live system to mount the entire filesystem as a union overlay. Changes made during a session are written to the persistence partition rather than discarded on shutdown.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with Persistence ==&lt;br /&gt;
Boot from the USB, selecting the plain (non-UEFI:) device entry in the firmware boot menu. At the Debian live GRUB menu, press Tab to edit the selected boot entry. On the line beginning with linux, append persistence after boot=live components. Press Enter to boot.&lt;br /&gt;
&lt;br /&gt;
The first boot with persistence active will be slower than a standard live session—the system is running entirely from the USB drive, and the persistence overlay adds a layer of I/O. This is normal.&lt;br /&gt;
&lt;br /&gt;
== Verify Persistence ==&lt;br /&gt;
After booting, confirm the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should show sdXN mounted at /run/live/persistence/sdXN.&lt;br /&gt;
&lt;br /&gt;
Create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot with persistence enabled. If the file is present after reboot, persistence is working.&lt;br /&gt;
&lt;br /&gt;
== What Didn’t Work, and Why ==&lt;br /&gt;
&lt;br /&gt;
=== parted ===&lt;br /&gt;
parted misreported the capacity of the test USB drive: a 32 GB device was reported as approximately 125 GB. Determining where the free space began or how large to make the persistence partition was not possible from that output. parted was not used further. The broader behavior—libparted-based tools handling the isohybrid format unreliably—is documented on the Debian User mailing list [9].&lt;br /&gt;
&lt;br /&gt;
=== gdisk / sgdisk ===&lt;br /&gt;
gdisk and sgdisk are GPT-aware tools and would seem the logical choice for a drive with a hybrid partition table. On the test USB, sgdisk produced:&amp;lt;blockquote&amp;gt;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&lt;br /&gt;
&lt;br /&gt;
Warning! Secondary partition table overlaps the last partition by 33 blocks!&lt;br /&gt;
&lt;br /&gt;
Could not create partition 3 from 14580 to 8177663&lt;br /&gt;
&lt;br /&gt;
Non-GPT disk; not saving changes. Use -g to override.&lt;br /&gt;
&lt;br /&gt;
Error encountered; not saving changes.&amp;lt;/blockquote&amp;gt;The isohybrid layout places the secondary GPT header in a location that overlaps the last partition. sgdisk identifies this as invalid and refuses to proceed. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk can’t be used here.&lt;br /&gt;
&lt;br /&gt;
cp was also tested as an alternative to dd for writing the ISO, on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout. It’s not an alternative—it’s a slower write with the same result.&lt;br /&gt;
&lt;br /&gt;
== The UEFI grub&amp;gt; Prompt ==&lt;br /&gt;
On the test hardware, adding a persistence partition and then selecting the UEFI:-prefixed boot entry consistently dropped to a bare grub&amp;gt; prompt. Running ls from that prompt showed the internal drive’s partitions; the USB’s live partition was unreachable from there.&lt;br /&gt;
&lt;br /&gt;
What was observed: the USB’s own GRUB appeared briefly—visible as a rapid flash on screen with a “no such…” error—then failed, after which the firmware handed control to the internal drive’s GRUB, which presented its own grub&amp;gt; prompt.&lt;br /&gt;
&lt;br /&gt;
The UEFI specification states that firmware may remove boot options it considers invalid [7]; the ArchWiki documents firmware removing entries for drives it detects as changed as a known occurrence [8]. After adding the persistence partition, the USB’s EFI entry—pointing to EFI/boot/bootx64.efi—may no longer have been treated as valid by the firmware, causing it to fall through to the next available bootloader on the internal drive. Whether modifying the partition table on a removable device is sufficient to trigger this behavior, and under what firmware conditions, wasn’t reproducible in a controlled way during testing.&lt;br /&gt;
&lt;br /&gt;
Selecting the plain (non-UEFI:) device entry uses the legacy MBR boot path, which loads the USB’s own GRUB directly and has no dependency on the UEFI NVRAM or EFI boot entries. On the test hardware, this path was unaffected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
== Anonymity ==&lt;br /&gt;
A Debian Live USB with persistence, used correctly, writes nothing to the host machine’s internal disk. It doesn’t modify the installed OS, create logs on the host filesystem, or leave traces in the usual locations.&lt;br /&gt;
&lt;br /&gt;
It doesn’t provide anonymity. Boot events may be logged by firmware or enterprise management systems. Network activity is visible to routers, ISPs, and network administrators regardless of which OS is running. Mounting the internal disk during a live session makes its contents accessible to the live environment, and any writes to it are permanent. A live USB is a portable, self-contained Debian environment—it isn’t a privacy tool by design.&lt;br /&gt;
&lt;br /&gt;
== A Note on Carrying Data ==&lt;br /&gt;
The persistence partition is a practical place to keep working data alongside the system state—documents, scripts, configuration files, anything you’d normally keep in ~/Documents or ~/bin. It travels with the drive.&lt;br /&gt;
&lt;br /&gt;
Installed packages persist across sessions but may have hardware-specific dependencies. For general desktop use this isn’t usually an issue, but it’s worth keeping in mind if you’re installing drivers or kernel modules that assume specific hardware.&lt;br /&gt;
&lt;br /&gt;
== Citations ==&lt;br /&gt;
Syslinux Project. “Isohybrid.” Syslinux Wiki.&lt;br /&gt;
&lt;br /&gt;
[2] Linux Command Library. “isohybrid(1) man page.” https://linuxcommandlibrary.com/man/isohybrid&lt;br /&gt;
&lt;br /&gt;
[3] Smith, Roderick W. “Hybrid MBRs.” GPT fdisk documentation. https://www.rodsbooks.com/gdisk/hybrid.html&lt;br /&gt;
&lt;br /&gt;
[4] Debian Manpages. “persistence.conf(5).” live-boot-doc, Trixie. https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&lt;br /&gt;
&lt;br /&gt;
[5] Debian Live Team. “Customizing Run-Time Behaviours.” Debian Live Manual. https://live-team.pages.debian.net/live-manual/html/live-manual/customizing-run-time-behaviours.en.html&lt;br /&gt;
&lt;br /&gt;
[6] Debian Manpages. “live-boot(7).” live-boot-doc. https://manpages.debian.org/unstable/live-boot-doc/live-boot.7.en.html&lt;br /&gt;
&lt;br /&gt;
[7] UEFI Forum. “Boot Manager.” UEFI Specification 2.10, §3. https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&lt;br /&gt;
&lt;br /&gt;
[8] ArchWiki. “Unified Extensible Firmware Interface.” https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface&lt;br /&gt;
&lt;br /&gt;
[9] Debian User Mailing List. “Error message from GParted, means what?” November 2016. https://lists.debian.org/debian-user/2016/11/msg01017.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Contributed by [https://forums.debian.net/search.php?keywords=distro-nix distro-nix] on Debian User Forums on 2026-04-06.&#039;&#039; Comments, corrections, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=240</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=240"/>
		<updated>2026-04-10T03:20:32Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: /* Citations */  Added blank line above footer for separation.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created: 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Updated: 2026-04-09 - added references and restructured heading order;&lt;br /&gt;
&lt;br /&gt;
ID: 005146.11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A Debian Live USB with persistence boots a full Debian environment from a USB drive while retaining changes across sessions. Files you create, settings you change, and packages you install survive reboot—stored on a dedicated partition rather than the volatile live environment. Nothing is written to the host machine’s internal disk.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A standard live USB is stateless: each boot starts from the same ISO image. The persistence partition changes that. From a single drive you get your shell configuration, documents, utilities, browser profile, and scripts, available on any machine you boot it from.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== What You’ll Need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum is 4 GB, but that leaves little room for persistence. A 32 GB drive is a practical working size. Download the Debian Live ISO from the official Debian website: &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tools required—dd, fdisk, and mkfs.ext4—are standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Install them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These packages are available from the live session’s apt cache without adding sources. They don’t persist to the USB unless persistence is already active.&lt;br /&gt;
&lt;br /&gt;
== Identifying Your USB Device ==&lt;br /&gt;
Plug in the USB drive and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your USB device will appear as /dev/sdb, /dev/sdc, or similar, depending on what else is attached. Confirm it by cross-referencing the reported size with the known capacity of the drive.&lt;br /&gt;
&lt;br /&gt;
Two placeholders are used throughout this document. /dev/sdX refers to the device itself—substitute your actual device identifier everywhere it appears. /dev/sdXN refers to the persistence partition—N is the partition number you’ll confirm from lsblk output after you&#039;ve created it.&lt;br /&gt;
&lt;br /&gt;
Use the device path, not a partition path: /dev/sdb is correct; /dev/sdb1 is not.&lt;br /&gt;
&lt;br /&gt;
== Boot Entry Selection ==&lt;br /&gt;
The firmware boot menu on many systems presents two entries for a USB device: one labeled with the device name alone, and one prefixed with UEFI:. On the hardware used for this document, selecting the UEFI:-prefixed entry after adding a persistence partition consistently produced a bare grub&amp;gt; prompt rather than the Debian live menu. Selecting the plain device entry booted correctly every time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Throughout this procedure, select the plain device entry—not the one prefixed with UEFI&#039;&#039;&#039;:.&lt;br /&gt;
&lt;br /&gt;
This behavior was observed on specific hardware. Whether it reproduces on all firmware is not established here. The mechanism and a possible explanation are in &amp;lt;ref&amp;gt;https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&amp;lt;/ref&amp;gt; If your firmware presents only a UEFI boot path, recovery from within a booted live session may be possible by correcting the GRUB prefix, but that procedure is outside the scope of this document.&lt;br /&gt;
&lt;br /&gt;
= Procedure =&lt;br /&gt;
&lt;br /&gt;
=== Clean the Drive ===&lt;br /&gt;
If the USB has been used before, you may have residual partition signatures or bootloader data in the early sectors, and they can interfere with the ISO write or the subsequent boot. Clear them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
wipefs removes filesystem and partition table signatures. The dd command zeros the first 200 MB, covering the MBR, GPT header, and any EFI data in the early sectors.&lt;br /&gt;
&lt;br /&gt;
=== Write the ISO ===&lt;br /&gt;
Before running dd, confirm that sync resolves to the system binary and not a shell alias:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should be sync is /usr/bin/sync. If it returns an alias definition instead, unalias it with unalias sync, or substitute /usr/bin/sync explicitly at the end of the dd command.&lt;br /&gt;
&lt;br /&gt;
Write the ISO:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
status=progress shows the running transfer rate. sync flushes the write cache on completion—don’t remove the drive before it returns. The write will take a few minutes depending on the drive’s speed.&lt;br /&gt;
&lt;br /&gt;
=== Verify the Base Boot ===&lt;br /&gt;
Before adding the persistence partition, confirm the ISO write produced a bootable drive. Boot from the USB, selecting the plain &#039;&#039;&#039;(non-UEFI:) device entry.&#039;&#039;&#039; If it reaches the Debian live menu and boots cleanly, you have a confirmed working baseline. If it doesn’t boot at this stage, don’t continue—go back to [[Debian Live USB with Persistence#Procedure|4.1 Clean the Drive]] and continue from there.&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. The persistence partition goes there. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table that supports both BIOS and UEFI boot paths. Adding a partition requires an explicit start sector; without it, fdisk’s default placement can conflict with the hybrid structure in ways that affect the boot. The failure modes of parted and gdisk with this layout are documented in &amp;lt;ref&amp;gt;https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Print the current partition table:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two partitions will be present: the main ISO partition (type 0 or Empty—this is expected for an isohybrid layout) and a small EFI partition of approximately 3.2 MB. The p output shows the end sector of the last partition in the End column. The persistence partition must start at the next sector—that value plus one. On the test hardware with a Debian 13.4 live ISO written to the drive, the last partition ended at sector 8175999 and the persistence partition started at sector 8176000. This figure will vary with the ISO version and release; read your own p output and don’t use the test value without verifying it matches.&lt;br /&gt;
&lt;br /&gt;
Create the new partition:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When fdisk prompts for the first sector, enter the start sector you identified from the p output—do not accept the default. Accept the default for the last sector to use the remaining space on the drive.&lt;br /&gt;
&lt;br /&gt;
If fdisk asks whether to remove an existing ext4 signature, answer &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;. This clears a remnant from a previous attempt.&lt;br /&gt;
&lt;br /&gt;
Write the changes and exit:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After fdisk writes the new partition table, the running kernel may not immediately recognize the change. partprobe signals the kernel to re-read the partition table on the device without requiring a reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it completes, confirm the new partition is visible:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your new partition will appear beneath the device in the output. Note its full identifier—for example, sdb3 or sdc4—as you’ll need it in the next two steps. If it doesn’t appear immediately, wait a moment and run lsblk again before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Format the Partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence. The Debian live system identifies the persistence partition by this label at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Configuration ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdXN /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The / union directive instructs the live system to mount the entire filesystem as a union overlay. Changes made during a session are written to the persistence partition rather than discarded on shutdown.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with Persistence ==&lt;br /&gt;
Boot from the USB, selecting the plain (non-UEFI:) device entry in the firmware boot menu. At the Debian live GRUB menu, press Tab to edit the selected boot entry. On the line beginning with linux, append persistence after boot=live components. Press Enter to boot.&lt;br /&gt;
&lt;br /&gt;
The first boot with persistence active will be slower than a standard live session—the system is running entirely from the USB drive, and the persistence overlay adds a layer of I/O. This is normal.&lt;br /&gt;
&lt;br /&gt;
== Verify Persistence ==&lt;br /&gt;
After booting, confirm the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should show sdXN mounted at /run/live/persistence/sdXN.&lt;br /&gt;
&lt;br /&gt;
Create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot with persistence enabled. If the file is present after reboot, persistence is working.&lt;br /&gt;
&lt;br /&gt;
== What Didn’t Work, and Why ==&lt;br /&gt;
&lt;br /&gt;
=== parted ===&lt;br /&gt;
parted misreported the capacity of the test USB drive: a 32 GB device was reported as approximately 125 GB. Determining where the free space began or how large to make the persistence partition was not possible from that output. parted was not used further. The broader behavior—libparted-based tools handling the isohybrid format unreliably—is documented on the Debian User mailing list [9].&lt;br /&gt;
&lt;br /&gt;
=== gdisk / sgdisk ===&lt;br /&gt;
gdisk and sgdisk are GPT-aware tools and would seem the logical choice for a drive with a hybrid partition table. On the test USB, sgdisk produced:&amp;lt;blockquote&amp;gt;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&lt;br /&gt;
&lt;br /&gt;
Warning! Secondary partition table overlaps the last partition by 33 blocks!&lt;br /&gt;
&lt;br /&gt;
Could not create partition 3 from 14580 to 8177663&lt;br /&gt;
&lt;br /&gt;
Non-GPT disk; not saving changes. Use -g to override.&lt;br /&gt;
&lt;br /&gt;
Error encountered; not saving changes.&amp;lt;/blockquote&amp;gt;The isohybrid layout places the secondary GPT header in a location that overlaps the last partition. sgdisk identifies this as invalid and refuses to proceed. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk can’t be used here.&lt;br /&gt;
&lt;br /&gt;
cp was also tested as an alternative to dd for writing the ISO, on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout. It’s not an alternative—it’s a slower write with the same result.&lt;br /&gt;
&lt;br /&gt;
== The UEFI grub&amp;gt; Prompt ==&lt;br /&gt;
On the test hardware, adding a persistence partition and then selecting the UEFI:-prefixed boot entry consistently dropped to a bare grub&amp;gt; prompt. Running ls from that prompt showed the internal drive’s partitions; the USB’s live partition was unreachable from there.&lt;br /&gt;
&lt;br /&gt;
What was observed: the USB’s own GRUB appeared briefly—visible as a rapid flash on screen with a “no such…” error—then failed, after which the firmware handed control to the internal drive’s GRUB, which presented its own grub&amp;gt; prompt.&lt;br /&gt;
&lt;br /&gt;
The UEFI specification states that firmware may remove boot options it considers invalid [7]; the ArchWiki documents firmware removing entries for drives it detects as changed as a known occurrence [8]. After adding the persistence partition, the USB’s EFI entry—pointing to EFI/boot/bootx64.efi—may no longer have been treated as valid by the firmware, causing it to fall through to the next available bootloader on the internal drive. Whether modifying the partition table on a removable device is sufficient to trigger this behavior, and under what firmware conditions, wasn’t reproducible in a controlled way during testing.&lt;br /&gt;
&lt;br /&gt;
Selecting the plain (non-UEFI:) device entry uses the legacy MBR boot path, which loads the USB’s own GRUB directly and has no dependency on the UEFI NVRAM or EFI boot entries. On the test hardware, this path was unaffected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
== Anonymity ==&lt;br /&gt;
A Debian Live USB with persistence, used correctly, writes nothing to the host machine’s internal disk. It doesn’t modify the installed OS, create logs on the host filesystem, or leave traces in the usual locations.&lt;br /&gt;
&lt;br /&gt;
It doesn’t provide anonymity. Boot events may be logged by firmware or enterprise management systems. Network activity is visible to routers, ISPs, and network administrators regardless of which OS is running. Mounting the internal disk during a live session makes its contents accessible to the live environment, and any writes to it are permanent. A live USB is a portable, self-contained Debian environment—it isn’t a privacy tool by design.&lt;br /&gt;
&lt;br /&gt;
== A Note on Carrying Data ==&lt;br /&gt;
The persistence partition is a practical place to keep working data alongside the system state—documents, scripts, configuration files, anything you’d normally keep in ~/Documents or ~/bin. It travels with the drive.&lt;br /&gt;
&lt;br /&gt;
Installed packages persist across sessions but may have hardware-specific dependencies. For general desktop use this isn’t usually an issue, but it’s worth keeping in mind if you’re installing drivers or kernel modules that assume specific hardware.&lt;br /&gt;
&lt;br /&gt;
== Citations ==&lt;br /&gt;
Syslinux Project. “Isohybrid.” Syslinux Wiki.&lt;br /&gt;
&lt;br /&gt;
[2] Linux Command Library. “isohybrid(1) man page.” https://linuxcommandlibrary.com/man/isohybrid&lt;br /&gt;
&lt;br /&gt;
[3] Smith, Roderick W. “Hybrid MBRs.” GPT fdisk documentation. https://www.rodsbooks.com/gdisk/hybrid.html&lt;br /&gt;
&lt;br /&gt;
[4] Debian Manpages. “persistence.conf(5).” live-boot-doc, Trixie. https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&lt;br /&gt;
&lt;br /&gt;
[5] Debian Live Team. “Customizing Run-Time Behaviours.” Debian Live Manual. https://live-team.pages.debian.net/live-manual/html/live-manual/customizing-run-time-behaviours.en.html&lt;br /&gt;
&lt;br /&gt;
[6] Debian Manpages. “live-boot(7).” live-boot-doc. https://manpages.debian.org/unstable/live-boot-doc/live-boot.7.en.html&lt;br /&gt;
&lt;br /&gt;
[7] UEFI Forum. “Boot Manager.” UEFI Specification 2.10, §3. https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&lt;br /&gt;
&lt;br /&gt;
[8] ArchWiki. “Unified Extensible Firmware Interface.” https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface&lt;br /&gt;
&lt;br /&gt;
[9] Debian User Mailing List. “Error message from GParted, means what?” November 2016. https://lists.debian.org/debian-user/2016/11/msg01017.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&#039;&#039;Contributed by [https://forums.debian.net/search.php?keywords=distro-nix distro-nix] on Debian User Forums on 2026-04-06.&#039;&#039; Comments, corrections, suggestions or resources are welcome.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Contributed by [https://forums.debian.net/search.php?keywords=distro-nix distro-nix] on Debian User Forums on 2026-04-06.&#039;&#039; Comments, corrections, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=239</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=239"/>
		<updated>2026-04-10T03:15:27Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: /* Verify the Base Boot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created: 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Updated: 2026-04-09 - added references and restructured heading order;&lt;br /&gt;
&lt;br /&gt;
ID: 005146.11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A Debian Live USB with persistence boots a full Debian environment from a USB drive while retaining changes across sessions. Files you create, settings you change, and packages you install survive reboot—stored on a dedicated partition rather than the volatile live environment. Nothing is written to the host machine’s internal disk.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A standard live USB is stateless: each boot starts from the same ISO image. The persistence partition changes that. From a single drive you get your shell configuration, documents, utilities, browser profile, and scripts, available on any machine you boot it from.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== What You’ll Need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum is 4 GB, but that leaves little room for persistence. A 32 GB drive is a practical working size. Download the Debian Live ISO from the official Debian website: &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tools required—dd, fdisk, and mkfs.ext4—are standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Install them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These packages are available from the live session’s apt cache without adding sources. They don’t persist to the USB unless persistence is already active.&lt;br /&gt;
&lt;br /&gt;
== Identifying Your USB Device ==&lt;br /&gt;
Plug in the USB drive and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your USB device will appear as /dev/sdb, /dev/sdc, or similar, depending on what else is attached. Confirm it by cross-referencing the reported size with the known capacity of the drive.&lt;br /&gt;
&lt;br /&gt;
Two placeholders are used throughout this document. /dev/sdX refers to the device itself—substitute your actual device identifier everywhere it appears. /dev/sdXN refers to the persistence partition—N is the partition number you’ll confirm from lsblk output after you&#039;ve created it.&lt;br /&gt;
&lt;br /&gt;
Use the device path, not a partition path: /dev/sdb is correct; /dev/sdb1 is not.&lt;br /&gt;
&lt;br /&gt;
== Boot Entry Selection ==&lt;br /&gt;
The firmware boot menu on many systems presents two entries for a USB device: one labeled with the device name alone, and one prefixed with UEFI:. On the hardware used for this document, selecting the UEFI:-prefixed entry after adding a persistence partition consistently produced a bare grub&amp;gt; prompt rather than the Debian live menu. Selecting the plain device entry booted correctly every time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Throughout this procedure, select the plain device entry—not the one prefixed with UEFI&#039;&#039;&#039;:.&lt;br /&gt;
&lt;br /&gt;
This behavior was observed on specific hardware. Whether it reproduces on all firmware is not established here. The mechanism and a possible explanation are in &amp;lt;ref&amp;gt;https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&amp;lt;/ref&amp;gt; If your firmware presents only a UEFI boot path, recovery from within a booted live session may be possible by correcting the GRUB prefix, but that procedure is outside the scope of this document.&lt;br /&gt;
&lt;br /&gt;
= Procedure =&lt;br /&gt;
&lt;br /&gt;
=== Clean the Drive ===&lt;br /&gt;
If the USB has been used before, you may have residual partition signatures or bootloader data in the early sectors, and they can interfere with the ISO write or the subsequent boot. Clear them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
wipefs removes filesystem and partition table signatures. The dd command zeros the first 200 MB, covering the MBR, GPT header, and any EFI data in the early sectors.&lt;br /&gt;
&lt;br /&gt;
=== Write the ISO ===&lt;br /&gt;
Before running dd, confirm that sync resolves to the system binary and not a shell alias:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should be sync is /usr/bin/sync. If it returns an alias definition instead, unalias it with unalias sync, or substitute /usr/bin/sync explicitly at the end of the dd command.&lt;br /&gt;
&lt;br /&gt;
Write the ISO:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
status=progress shows the running transfer rate. sync flushes the write cache on completion—don’t remove the drive before it returns. The write will take a few minutes depending on the drive’s speed.&lt;br /&gt;
&lt;br /&gt;
=== Verify the Base Boot ===&lt;br /&gt;
Before adding the persistence partition, confirm the ISO write produced a bootable drive. Boot from the USB, selecting the plain &#039;&#039;&#039;(non-UEFI:) device entry.&#039;&#039;&#039; If it reaches the Debian live menu and boots cleanly, you have a confirmed working baseline. If it doesn’t boot at this stage, don’t continue—go back to [[Debian Live USB with Persistence#Procedure|4.1 Clean the Drive]] and continue from there.&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. The persistence partition goes there. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table that supports both BIOS and UEFI boot paths. Adding a partition requires an explicit start sector; without it, fdisk’s default placement can conflict with the hybrid structure in ways that affect the boot. The failure modes of parted and gdisk with this layout are documented in &amp;lt;ref&amp;gt;https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Print the current partition table:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two partitions will be present: the main ISO partition (type 0 or Empty—this is expected for an isohybrid layout) and a small EFI partition of approximately 3.2 MB. The p output shows the end sector of the last partition in the End column. The persistence partition must start at the next sector—that value plus one. On the test hardware with a Debian 13.4 live ISO written to the drive, the last partition ended at sector 8175999 and the persistence partition started at sector 8176000. This figure will vary with the ISO version and release; read your own p output and don’t use the test value without verifying it matches.&lt;br /&gt;
&lt;br /&gt;
Create the new partition:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When fdisk prompts for the first sector, enter the start sector you identified from the p output—do not accept the default. Accept the default for the last sector to use the remaining space on the drive.&lt;br /&gt;
&lt;br /&gt;
If fdisk asks whether to remove an existing ext4 signature, answer &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;. This clears a remnant from a previous attempt.&lt;br /&gt;
&lt;br /&gt;
Write the changes and exit:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After fdisk writes the new partition table, the running kernel may not immediately recognize the change. partprobe signals the kernel to re-read the partition table on the device without requiring a reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it completes, confirm the new partition is visible:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your new partition will appear beneath the device in the output. Note its full identifier—for example, sdb3 or sdc4—as you’ll need it in the next two steps. If it doesn’t appear immediately, wait a moment and run lsblk again before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Format the Partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence. The Debian live system identifies the persistence partition by this label at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Configuration ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdXN /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The / union directive instructs the live system to mount the entire filesystem as a union overlay. Changes made during a session are written to the persistence partition rather than discarded on shutdown.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with Persistence ==&lt;br /&gt;
Boot from the USB, selecting the plain (non-UEFI:) device entry in the firmware boot menu. At the Debian live GRUB menu, press Tab to edit the selected boot entry. On the line beginning with linux, append persistence after boot=live components. Press Enter to boot.&lt;br /&gt;
&lt;br /&gt;
The first boot with persistence active will be slower than a standard live session—the system is running entirely from the USB drive, and the persistence overlay adds a layer of I/O. This is normal.&lt;br /&gt;
&lt;br /&gt;
== Verify Persistence ==&lt;br /&gt;
After booting, confirm the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should show sdXN mounted at /run/live/persistence/sdXN.&lt;br /&gt;
&lt;br /&gt;
Create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot with persistence enabled. If the file is present after reboot, persistence is working.&lt;br /&gt;
&lt;br /&gt;
== What Didn’t Work, and Why ==&lt;br /&gt;
&lt;br /&gt;
=== parted ===&lt;br /&gt;
parted misreported the capacity of the test USB drive: a 32 GB device was reported as approximately 125 GB. Determining where the free space began or how large to make the persistence partition was not possible from that output. parted was not used further. The broader behavior—libparted-based tools handling the isohybrid format unreliably—is documented on the Debian User mailing list [9].&lt;br /&gt;
&lt;br /&gt;
=== gdisk / sgdisk ===&lt;br /&gt;
gdisk and sgdisk are GPT-aware tools and would seem the logical choice for a drive with a hybrid partition table. On the test USB, sgdisk produced:&amp;lt;blockquote&amp;gt;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&lt;br /&gt;
&lt;br /&gt;
Warning! Secondary partition table overlaps the last partition by 33 blocks!&lt;br /&gt;
&lt;br /&gt;
Could not create partition 3 from 14580 to 8177663&lt;br /&gt;
&lt;br /&gt;
Non-GPT disk; not saving changes. Use -g to override.&lt;br /&gt;
&lt;br /&gt;
Error encountered; not saving changes.&amp;lt;/blockquote&amp;gt;The isohybrid layout places the secondary GPT header in a location that overlaps the last partition. sgdisk identifies this as invalid and refuses to proceed. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk can’t be used here.&lt;br /&gt;
&lt;br /&gt;
cp was also tested as an alternative to dd for writing the ISO, on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout. It’s not an alternative—it’s a slower write with the same result.&lt;br /&gt;
&lt;br /&gt;
== The UEFI grub&amp;gt; Prompt ==&lt;br /&gt;
On the test hardware, adding a persistence partition and then selecting the UEFI:-prefixed boot entry consistently dropped to a bare grub&amp;gt; prompt. Running ls from that prompt showed the internal drive’s partitions; the USB’s live partition was unreachable from there.&lt;br /&gt;
&lt;br /&gt;
What was observed: the USB’s own GRUB appeared briefly—visible as a rapid flash on screen with a “no such…” error—then failed, after which the firmware handed control to the internal drive’s GRUB, which presented its own grub&amp;gt; prompt.&lt;br /&gt;
&lt;br /&gt;
The UEFI specification states that firmware may remove boot options it considers invalid [7]; the ArchWiki documents firmware removing entries for drives it detects as changed as a known occurrence [8]. After adding the persistence partition, the USB’s EFI entry—pointing to EFI/boot/bootx64.efi—may no longer have been treated as valid by the firmware, causing it to fall through to the next available bootloader on the internal drive. Whether modifying the partition table on a removable device is sufficient to trigger this behavior, and under what firmware conditions, wasn’t reproducible in a controlled way during testing.&lt;br /&gt;
&lt;br /&gt;
Selecting the plain (non-UEFI:) device entry uses the legacy MBR boot path, which loads the USB’s own GRUB directly and has no dependency on the UEFI NVRAM or EFI boot entries. On the test hardware, this path was unaffected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
== Anonymity ==&lt;br /&gt;
A Debian Live USB with persistence, used correctly, writes nothing to the host machine’s internal disk. It doesn’t modify the installed OS, create logs on the host filesystem, or leave traces in the usual locations.&lt;br /&gt;
&lt;br /&gt;
It doesn’t provide anonymity. Boot events may be logged by firmware or enterprise management systems. Network activity is visible to routers, ISPs, and network administrators regardless of which OS is running. Mounting the internal disk during a live session makes its contents accessible to the live environment, and any writes to it are permanent. A live USB is a portable, self-contained Debian environment—it isn’t a privacy tool by design.&lt;br /&gt;
&lt;br /&gt;
== A Note on Carrying Data ==&lt;br /&gt;
The persistence partition is a practical place to keep working data alongside the system state—documents, scripts, configuration files, anything you’d normally keep in ~/Documents or ~/bin. It travels with the drive.&lt;br /&gt;
&lt;br /&gt;
Installed packages persist across sessions but may have hardware-specific dependencies. For general desktop use this isn’t usually an issue, but it’s worth keeping in mind if you’re installing drivers or kernel modules that assume specific hardware.&lt;br /&gt;
&lt;br /&gt;
== Citations ==&lt;br /&gt;
Syslinux Project. “Isohybrid.” Syslinux Wiki.&lt;br /&gt;
&lt;br /&gt;
[2] Linux Command Library. “isohybrid(1) man page.” https://linuxcommandlibrary.com/man/isohybrid&lt;br /&gt;
&lt;br /&gt;
[3] Smith, Roderick W. “Hybrid MBRs.” GPT fdisk documentation. https://www.rodsbooks.com/gdisk/hybrid.html&lt;br /&gt;
&lt;br /&gt;
[4] Debian Manpages. “persistence.conf(5).” live-boot-doc, Trixie. https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&lt;br /&gt;
&lt;br /&gt;
[5] Debian Live Team. “Customizing Run-Time Behaviours.” Debian Live Manual. https://live-team.pages.debian.net/live-manual/html/live-manual/customizing-run-time-behaviours.en.html&lt;br /&gt;
&lt;br /&gt;
[6] Debian Manpages. “live-boot(7).” live-boot-doc. https://manpages.debian.org/unstable/live-boot-doc/live-boot.7.en.html&lt;br /&gt;
&lt;br /&gt;
[7] UEFI Forum. “Boot Manager.” UEFI Specification 2.10, §3. https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&lt;br /&gt;
&lt;br /&gt;
[8] ArchWiki. “Unified Extensible Firmware Interface.” https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface&lt;br /&gt;
&lt;br /&gt;
[9] Debian User Mailing List. “Error message from GParted, means what?” November 2016. https://lists.debian.org/debian-user/2016/11/msg01017.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&#039;&#039;Contributed by [https://forums.debian.net/search.php?keywords=distro-nix distro-nix] on Debian User Forums on 2026-04-06.&#039;&#039; Comments, corrections, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=238</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=238"/>
		<updated>2026-04-10T03:13:07Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: /* Identifying Your USB Device */ 4.1 Clean the Drive&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created: 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Updated: 2026-04-09 - added references and restructured heading order;&lt;br /&gt;
&lt;br /&gt;
ID: 005146.11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A Debian Live USB with persistence boots a full Debian environment from a USB drive while retaining changes across sessions. Files you create, settings you change, and packages you install survive reboot—stored on a dedicated partition rather than the volatile live environment. Nothing is written to the host machine’s internal disk.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A standard live USB is stateless: each boot starts from the same ISO image. The persistence partition changes that. From a single drive you get your shell configuration, documents, utilities, browser profile, and scripts, available on any machine you boot it from.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== What You’ll Need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum is 4 GB, but that leaves little room for persistence. A 32 GB drive is a practical working size. Download the Debian Live ISO from the official Debian website: &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tools required—dd, fdisk, and mkfs.ext4—are standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Install them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These packages are available from the live session’s apt cache without adding sources. They don’t persist to the USB unless persistence is already active.&lt;br /&gt;
&lt;br /&gt;
== Identifying Your USB Device ==&lt;br /&gt;
Plug in the USB drive and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your USB device will appear as /dev/sdb, /dev/sdc, or similar, depending on what else is attached. Confirm it by cross-referencing the reported size with the known capacity of the drive.&lt;br /&gt;
&lt;br /&gt;
Two placeholders are used throughout this document. /dev/sdX refers to the device itself—substitute your actual device identifier everywhere it appears. /dev/sdXN refers to the persistence partition—N is the partition number you’ll confirm from lsblk output after you&#039;ve created it.&lt;br /&gt;
&lt;br /&gt;
Use the device path, not a partition path: /dev/sdb is correct; /dev/sdb1 is not.&lt;br /&gt;
&lt;br /&gt;
== Boot Entry Selection ==&lt;br /&gt;
The firmware boot menu on many systems presents two entries for a USB device: one labeled with the device name alone, and one prefixed with UEFI:. On the hardware used for this document, selecting the UEFI:-prefixed entry after adding a persistence partition consistently produced a bare grub&amp;gt; prompt rather than the Debian live menu. Selecting the plain device entry booted correctly every time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Throughout this procedure, select the plain device entry—not the one prefixed with UEFI&#039;&#039;&#039;:.&lt;br /&gt;
&lt;br /&gt;
This behavior was observed on specific hardware. Whether it reproduces on all firmware is not established here. The mechanism and a possible explanation are in &amp;lt;ref&amp;gt;https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&amp;lt;/ref&amp;gt; If your firmware presents only a UEFI boot path, recovery from within a booted live session may be possible by correcting the GRUB prefix, but that procedure is outside the scope of this document.&lt;br /&gt;
&lt;br /&gt;
= Procedure =&lt;br /&gt;
&lt;br /&gt;
=== Clean the Drive ===&lt;br /&gt;
If the USB has been used before, you may have residual partition signatures or bootloader data in the early sectors, and they can interfere with the ISO write or the subsequent boot. Clear them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
wipefs removes filesystem and partition table signatures. The dd command zeros the first 200 MB, covering the MBR, GPT header, and any EFI data in the early sectors.&lt;br /&gt;
&lt;br /&gt;
=== Write the ISO ===&lt;br /&gt;
Before running dd, confirm that sync resolves to the system binary and not a shell alias:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should be sync is /usr/bin/sync. If it returns an alias definition instead, unalias it with unalias sync, or substitute /usr/bin/sync explicitly at the end of the dd command.&lt;br /&gt;
&lt;br /&gt;
Write the ISO:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
status=progress shows the running transfer rate. sync flushes the write cache on completion—don’t remove the drive before it returns. The write will take a few minutes depending on the drive’s speed.&lt;br /&gt;
&lt;br /&gt;
=== Verify the Base Boot ===&lt;br /&gt;
Before adding the persistence partition, confirm the ISO write produced a bootable drive. Boot from the USB, selecting the plain &#039;&#039;&#039;(non-UEFI:) device entry.&#039;&#039;&#039; If it reaches the Debian live menu and boots cleanly, you have a confirmed working baseline. If it doesn’t boot at this stage, don’t continue—return to [[Debian Live USB with Persistence#Procedure|4.1 Clean the Drive]]&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. The persistence partition goes there. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table that supports both BIOS and UEFI boot paths. Adding a partition requires an explicit start sector; without it, fdisk’s default placement can conflict with the hybrid structure in ways that affect the boot. The failure modes of parted and gdisk with this layout are documented in &amp;lt;ref&amp;gt;https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Print the current partition table:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two partitions will be present: the main ISO partition (type 0 or Empty—this is expected for an isohybrid layout) and a small EFI partition of approximately 3.2 MB. The p output shows the end sector of the last partition in the End column. The persistence partition must start at the next sector—that value plus one. On the test hardware with a Debian 13.4 live ISO written to the drive, the last partition ended at sector 8175999 and the persistence partition started at sector 8176000. This figure will vary with the ISO version and release; read your own p output and don’t use the test value without verifying it matches.&lt;br /&gt;
&lt;br /&gt;
Create the new partition:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When fdisk prompts for the first sector, enter the start sector you identified from the p output—do not accept the default. Accept the default for the last sector to use the remaining space on the drive.&lt;br /&gt;
&lt;br /&gt;
If fdisk asks whether to remove an existing ext4 signature, answer &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;. This clears a remnant from a previous attempt.&lt;br /&gt;
&lt;br /&gt;
Write the changes and exit:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After fdisk writes the new partition table, the running kernel may not immediately recognize the change. partprobe signals the kernel to re-read the partition table on the device without requiring a reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it completes, confirm the new partition is visible:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your new partition will appear beneath the device in the output. Note its full identifier—for example, sdb3 or sdc4—as you’ll need it in the next two steps. If it doesn’t appear immediately, wait a moment and run lsblk again before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Format the Partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence. The Debian live system identifies the persistence partition by this label at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Configuration ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdXN /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The / union directive instructs the live system to mount the entire filesystem as a union overlay. Changes made during a session are written to the persistence partition rather than discarded on shutdown.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with Persistence ==&lt;br /&gt;
Boot from the USB, selecting the plain (non-UEFI:) device entry in the firmware boot menu. At the Debian live GRUB menu, press Tab to edit the selected boot entry. On the line beginning with linux, append persistence after boot=live components. Press Enter to boot.&lt;br /&gt;
&lt;br /&gt;
The first boot with persistence active will be slower than a standard live session—the system is running entirely from the USB drive, and the persistence overlay adds a layer of I/O. This is normal.&lt;br /&gt;
&lt;br /&gt;
== Verify Persistence ==&lt;br /&gt;
After booting, confirm the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should show sdXN mounted at /run/live/persistence/sdXN.&lt;br /&gt;
&lt;br /&gt;
Create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot with persistence enabled. If the file is present after reboot, persistence is working.&lt;br /&gt;
&lt;br /&gt;
== What Didn’t Work, and Why ==&lt;br /&gt;
&lt;br /&gt;
=== parted ===&lt;br /&gt;
parted misreported the capacity of the test USB drive: a 32 GB device was reported as approximately 125 GB. Determining where the free space began or how large to make the persistence partition was not possible from that output. parted was not used further. The broader behavior—libparted-based tools handling the isohybrid format unreliably—is documented on the Debian User mailing list [9].&lt;br /&gt;
&lt;br /&gt;
=== gdisk / sgdisk ===&lt;br /&gt;
gdisk and sgdisk are GPT-aware tools and would seem the logical choice for a drive with a hybrid partition table. On the test USB, sgdisk produced:&amp;lt;blockquote&amp;gt;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&lt;br /&gt;
&lt;br /&gt;
Warning! Secondary partition table overlaps the last partition by 33 blocks!&lt;br /&gt;
&lt;br /&gt;
Could not create partition 3 from 14580 to 8177663&lt;br /&gt;
&lt;br /&gt;
Non-GPT disk; not saving changes. Use -g to override.&lt;br /&gt;
&lt;br /&gt;
Error encountered; not saving changes.&amp;lt;/blockquote&amp;gt;The isohybrid layout places the secondary GPT header in a location that overlaps the last partition. sgdisk identifies this as invalid and refuses to proceed. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk can’t be used here.&lt;br /&gt;
&lt;br /&gt;
cp was also tested as an alternative to dd for writing the ISO, on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout. It’s not an alternative—it’s a slower write with the same result.&lt;br /&gt;
&lt;br /&gt;
== The UEFI grub&amp;gt; Prompt ==&lt;br /&gt;
On the test hardware, adding a persistence partition and then selecting the UEFI:-prefixed boot entry consistently dropped to a bare grub&amp;gt; prompt. Running ls from that prompt showed the internal drive’s partitions; the USB’s live partition was unreachable from there.&lt;br /&gt;
&lt;br /&gt;
What was observed: the USB’s own GRUB appeared briefly—visible as a rapid flash on screen with a “no such…” error—then failed, after which the firmware handed control to the internal drive’s GRUB, which presented its own grub&amp;gt; prompt.&lt;br /&gt;
&lt;br /&gt;
The UEFI specification states that firmware may remove boot options it considers invalid [7]; the ArchWiki documents firmware removing entries for drives it detects as changed as a known occurrence [8]. After adding the persistence partition, the USB’s EFI entry—pointing to EFI/boot/bootx64.efi—may no longer have been treated as valid by the firmware, causing it to fall through to the next available bootloader on the internal drive. Whether modifying the partition table on a removable device is sufficient to trigger this behavior, and under what firmware conditions, wasn’t reproducible in a controlled way during testing.&lt;br /&gt;
&lt;br /&gt;
Selecting the plain (non-UEFI:) device entry uses the legacy MBR boot path, which loads the USB’s own GRUB directly and has no dependency on the UEFI NVRAM or EFI boot entries. On the test hardware, this path was unaffected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
== Anonymity ==&lt;br /&gt;
A Debian Live USB with persistence, used correctly, writes nothing to the host machine’s internal disk. It doesn’t modify the installed OS, create logs on the host filesystem, or leave traces in the usual locations.&lt;br /&gt;
&lt;br /&gt;
It doesn’t provide anonymity. Boot events may be logged by firmware or enterprise management systems. Network activity is visible to routers, ISPs, and network administrators regardless of which OS is running. Mounting the internal disk during a live session makes its contents accessible to the live environment, and any writes to it are permanent. A live USB is a portable, self-contained Debian environment—it isn’t a privacy tool by design.&lt;br /&gt;
&lt;br /&gt;
== A Note on Carrying Data ==&lt;br /&gt;
The persistence partition is a practical place to keep working data alongside the system state—documents, scripts, configuration files, anything you’d normally keep in ~/Documents or ~/bin. It travels with the drive.&lt;br /&gt;
&lt;br /&gt;
Installed packages persist across sessions but may have hardware-specific dependencies. For general desktop use this isn’t usually an issue, but it’s worth keeping in mind if you’re installing drivers or kernel modules that assume specific hardware.&lt;br /&gt;
&lt;br /&gt;
== Citations ==&lt;br /&gt;
Syslinux Project. “Isohybrid.” Syslinux Wiki.&lt;br /&gt;
&lt;br /&gt;
[2] Linux Command Library. “isohybrid(1) man page.” https://linuxcommandlibrary.com/man/isohybrid&lt;br /&gt;
&lt;br /&gt;
[3] Smith, Roderick W. “Hybrid MBRs.” GPT fdisk documentation. https://www.rodsbooks.com/gdisk/hybrid.html&lt;br /&gt;
&lt;br /&gt;
[4] Debian Manpages. “persistence.conf(5).” live-boot-doc, Trixie. https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&lt;br /&gt;
&lt;br /&gt;
[5] Debian Live Team. “Customizing Run-Time Behaviours.” Debian Live Manual. https://live-team.pages.debian.net/live-manual/html/live-manual/customizing-run-time-behaviours.en.html&lt;br /&gt;
&lt;br /&gt;
[6] Debian Manpages. “live-boot(7).” live-boot-doc. https://manpages.debian.org/unstable/live-boot-doc/live-boot.7.en.html&lt;br /&gt;
&lt;br /&gt;
[7] UEFI Forum. “Boot Manager.” UEFI Specification 2.10, §3. https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&lt;br /&gt;
&lt;br /&gt;
[8] ArchWiki. “Unified Extensible Firmware Interface.” https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface&lt;br /&gt;
&lt;br /&gt;
[9] Debian User Mailing List. “Error message from GParted, means what?” November 2016. https://lists.debian.org/debian-user/2016/11/msg01017.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&#039;&#039;Contributed by [https://forums.debian.net/search.php?keywords=distro-nix distro-nix] on Debian User Forums on 2026-04-06.&#039;&#039; Comments, corrections, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=237</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=237"/>
		<updated>2026-04-10T02:58:23Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: /* Verify the Base Boot */  Return to 4&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created: 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Updated: 2026-04-09 - added references and restructured heading order;&lt;br /&gt;
&lt;br /&gt;
ID: 005146.11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A Debian Live USB with persistence boots a full Debian environment from a USB drive while retaining changes across sessions. Files you create, settings you change, and packages you install survive reboot—stored on a dedicated partition rather than the volatile live environment. Nothing is written to the host machine’s internal disk.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A standard live USB is stateless: each boot starts from the same ISO image. The persistence partition changes that. From a single drive you get your shell configuration, documents, utilities, browser profile, and scripts, available on any machine you boot it from.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== What You’ll Need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum is 4 GB, but that leaves little room for persistence. A 32 GB drive is a practical working size. Download the Debian Live ISO from the official Debian website: &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tools required—dd, fdisk, and mkfs.ext4—are standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Install them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These packages are available from the live session’s apt cache without adding sources. They don’t persist to the USB unless persistence is already active.&lt;br /&gt;
&lt;br /&gt;
== Identifying Your USB Device ==&lt;br /&gt;
Plug in the USB drive and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your USB device will appear as /dev/sdb, /dev/sdc, or similar, depending on what else is attached. Confirm it by cross-referencing the reported size with the known capacity of the drive.&lt;br /&gt;
&lt;br /&gt;
Two placeholders are used throughout this document. /dev/sdX refers to the device itself—substitute your actual device identifier everywhere it appears. /dev/sdXN refers to the persistence partition—N is the partition number you’ll confirm from lsblk output after you&#039;ve created it.&lt;br /&gt;
&lt;br /&gt;
Use the device path, not a partition path: /dev/sdb is correct; /dev/sdb1 is not.&lt;br /&gt;
&lt;br /&gt;
== Boot Entry Selection ==&lt;br /&gt;
The firmware boot menu on many systems presents two entries for a USB device: one labeled with the device name alone, and one prefixed with UEFI:. On the hardware used for this document, selecting the UEFI:-prefixed entry after adding a persistence partition consistently produced a bare grub&amp;gt; prompt rather than the Debian live menu. Selecting the plain device entry booted correctly every time.&lt;br /&gt;
&lt;br /&gt;
Throughout this procedure, select the plain device entry—not the one prefixed with UEFI:.&lt;br /&gt;
&lt;br /&gt;
This behavior was observed on specific hardware. Whether it reproduces on all firmware is not established here. The mechanism and a possible explanation are in &amp;lt;ref&amp;gt;https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&amp;lt;/ref&amp;gt; If your firmware presents only a UEFI boot path, recovery from within a booted live session may be possible by correcting the GRUB prefix, but that procedure is outside the scope of this document.&lt;br /&gt;
&lt;br /&gt;
= Procedure =&lt;br /&gt;
&lt;br /&gt;
=== Clean the Drive ===&lt;br /&gt;
If the USB has been used before, residual partition signatures or bootloader data in the early sectors can interfere with the ISO write or the subsequent boot. Clear them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
wipefs removes filesystem and partition table signatures. The dd command zeros the first 200 MB, covering the MBR, GPT header, and any EFI data in the early sectors.&lt;br /&gt;
&lt;br /&gt;
=== Write the ISO ===&lt;br /&gt;
Before running dd, confirm that sync resolves to the system binary and not a shell alias:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should be sync is /usr/bin/sync. If it returns an alias definition instead, unalias it with unalias sync, or substitute /usr/bin/sync explicitly at the end of the dd command.&lt;br /&gt;
&lt;br /&gt;
Write the ISO:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
status=progress shows the running transfer rate. sync flushes the write cache on completion—don’t remove the drive before it returns. The write will take a few minutes depending on the drive’s speed.&lt;br /&gt;
&lt;br /&gt;
=== Verify the Base Boot ===&lt;br /&gt;
Before adding the persistence partition, confirm the ISO write produced a bootable drive. Boot from the USB, selecting the plain (non-UEFI:) device entry. If it reaches the Debian live menu and boots cleanly, you have a confirmed working baseline. If it doesn’t boot at this stage, don’t continue—return to [[Debian Live USB with Persistence#Procedure|4]]&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. The persistence partition goes there. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table that supports both BIOS and UEFI boot paths. Adding a partition requires an explicit start sector; without it, fdisk’s default placement can conflict with the hybrid structure in ways that affect the boot. The failure modes of parted and gdisk with this layout are documented in §4.9&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Print the current partition table:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two partitions will be present: the main ISO partition (type 0 or Empty—this is expected for an isohybrid layout) and a small EFI partition of approximately 3.2 MB. The p output shows the end sector of the last partition in the End column. The persistence partition must start at the next sector—that value plus one. On the test hardware with a Debian 13.4 live ISO written to the drive, the last partition ended at sector 8175999 and the persistence partition started at sector 8176000. This figure will vary with the ISO version and release; read your own p output and don’t use the test value without verifying it matches.&lt;br /&gt;
&lt;br /&gt;
Create the new partition:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When fdisk prompts for the first sector, enter the start sector you identified from the p output—do not accept the default. Accept the default for the last sector to use the remaining space on the drive.&lt;br /&gt;
&lt;br /&gt;
If fdisk asks whether to remove an existing ext4 signature, answer &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;. This clears a remnant from a previous attempt.&lt;br /&gt;
&lt;br /&gt;
Write the changes and exit:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After fdisk writes the new partition table, the running kernel may not immediately recognize the change. partprobe signals the kernel to re-read the partition table on the device without requiring a reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it completes, confirm the new partition is visible:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your new partition will appear beneath the device in the output. Note its full identifier—for example, sdb3 or sdc4—as you’ll need it in the next two steps. If it doesn’t appear immediately, wait a moment and run lsblk again before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Format the Partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence. The Debian live system identifies the persistence partition by this label at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Configuration ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdXN /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The / union directive instructs the live system to mount the entire filesystem as a union overlay. Changes made during a session are written to the persistence partition rather than discarded on shutdown.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with Persistence ==&lt;br /&gt;
Boot from the USB, selecting the plain (non-UEFI:) device entry in the firmware boot menu. At the Debian live GRUB menu, press Tab to edit the selected boot entry. On the line beginning with linux, append persistence after boot=live components. Press Enter to boot.&lt;br /&gt;
&lt;br /&gt;
The first boot with persistence active will be slower than a standard live session—the system is running entirely from the USB drive, and the persistence overlay adds a layer of I/O. This is normal.&lt;br /&gt;
&lt;br /&gt;
== Verify Persistence ==&lt;br /&gt;
After booting, confirm the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should show sdXN mounted at /run/live/persistence/sdXN.&lt;br /&gt;
&lt;br /&gt;
Create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot with persistence enabled. If the file is present after reboot, persistence is working.&lt;br /&gt;
&lt;br /&gt;
== What Didn’t Work, and Why ==&lt;br /&gt;
&lt;br /&gt;
=== parted ===&lt;br /&gt;
parted misreported the capacity of the test USB drive: a 32 GB device was reported as approximately 125 GB. Determining where the free space began or how large to make the persistence partition was not possible from that output. parted was not used further. The broader behavior—libparted-based tools handling the isohybrid format unreliably—is documented on the Debian User mailing list [9].&lt;br /&gt;
&lt;br /&gt;
=== gdisk / sgdisk ===&lt;br /&gt;
gdisk and sgdisk are GPT-aware tools and would seem the logical choice for a drive with a hybrid partition table. On the test USB, sgdisk produced:&amp;lt;blockquote&amp;gt;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&lt;br /&gt;
&lt;br /&gt;
Warning! Secondary partition table overlaps the last partition by 33 blocks!&lt;br /&gt;
&lt;br /&gt;
Could not create partition 3 from 14580 to 8177663&lt;br /&gt;
&lt;br /&gt;
Non-GPT disk; not saving changes. Use -g to override.&lt;br /&gt;
&lt;br /&gt;
Error encountered; not saving changes.&amp;lt;/blockquote&amp;gt;The isohybrid layout places the secondary GPT header in a location that overlaps the last partition. sgdisk identifies this as invalid and refuses to proceed. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk can’t be used here.&lt;br /&gt;
&lt;br /&gt;
cp was also tested as an alternative to dd for writing the ISO, on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout. It’s not an alternative—it’s a slower write with the same result.&lt;br /&gt;
&lt;br /&gt;
== The UEFI grub&amp;gt; Prompt ==&lt;br /&gt;
On the test hardware, adding a persistence partition and then selecting the UEFI:-prefixed boot entry consistently dropped to a bare grub&amp;gt; prompt. Running ls from that prompt showed the internal drive’s partitions; the USB’s live partition was unreachable from there.&lt;br /&gt;
&lt;br /&gt;
What was observed: the USB’s own GRUB appeared briefly—visible as a rapid flash on screen with a “no such…” error—then failed, after which the firmware handed control to the internal drive’s GRUB, which presented its own grub&amp;gt; prompt.&lt;br /&gt;
&lt;br /&gt;
The UEFI specification states that firmware may remove boot options it considers invalid [7]; the ArchWiki documents firmware removing entries for drives it detects as changed as a known occurrence [8]. After adding the persistence partition, the USB’s EFI entry—pointing to EFI/boot/bootx64.efi—may no longer have been treated as valid by the firmware, causing it to fall through to the next available bootloader on the internal drive. Whether modifying the partition table on a removable device is sufficient to trigger this behavior, and under what firmware conditions, wasn’t reproducible in a controlled way during testing.&lt;br /&gt;
&lt;br /&gt;
Selecting the plain (non-UEFI:) device entry uses the legacy MBR boot path, which loads the USB’s own GRUB directly and has no dependency on the UEFI NVRAM or EFI boot entries. On the test hardware, this path was unaffected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
== Anonymity ==&lt;br /&gt;
A Debian Live USB with persistence, used correctly, writes nothing to the host machine’s internal disk. It doesn’t modify the installed OS, create logs on the host filesystem, or leave traces in the usual locations.&lt;br /&gt;
&lt;br /&gt;
It doesn’t provide anonymity. Boot events may be logged by firmware or enterprise management systems. Network activity is visible to routers, ISPs, and network administrators regardless of which OS is running. Mounting the internal disk during a live session makes its contents accessible to the live environment, and any writes to it are permanent. A live USB is a portable, self-contained Debian environment—it isn’t a privacy tool by design.&lt;br /&gt;
&lt;br /&gt;
== A Note on Carrying Data ==&lt;br /&gt;
The persistence partition is a practical place to keep working data alongside the system state—documents, scripts, configuration files, anything you’d normally keep in ~/Documents or ~/bin. It travels with the drive.&lt;br /&gt;
&lt;br /&gt;
Installed packages persist across sessions but may have hardware-specific dependencies. For general desktop use this isn’t usually an issue, but it’s worth keeping in mind if you’re installing drivers or kernel modules that assume specific hardware.&lt;br /&gt;
&lt;br /&gt;
== Citations ==&lt;br /&gt;
Syslinux Project. “Isohybrid.” Syslinux Wiki.&lt;br /&gt;
&lt;br /&gt;
[2] Linux Command Library. “isohybrid(1) man page.” https://linuxcommandlibrary.com/man/isohybrid&lt;br /&gt;
&lt;br /&gt;
[3] Smith, Roderick W. “Hybrid MBRs.” GPT fdisk documentation. https://www.rodsbooks.com/gdisk/hybrid.html&lt;br /&gt;
&lt;br /&gt;
[4] Debian Manpages. “persistence.conf(5).” live-boot-doc, Trixie. https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&lt;br /&gt;
&lt;br /&gt;
[5] Debian Live Team. “Customizing Run-Time Behaviours.” Debian Live Manual. https://live-team.pages.debian.net/live-manual/html/live-manual/customizing-run-time-behaviours.en.html&lt;br /&gt;
&lt;br /&gt;
[6] Debian Manpages. “live-boot(7).” live-boot-doc. https://manpages.debian.org/unstable/live-boot-doc/live-boot.7.en.html&lt;br /&gt;
&lt;br /&gt;
[7] UEFI Forum. “Boot Manager.” UEFI Specification 2.10, §3. https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&lt;br /&gt;
&lt;br /&gt;
[8] ArchWiki. “Unified Extensible Firmware Interface.” https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface&lt;br /&gt;
&lt;br /&gt;
[9] Debian User Mailing List. “Error message from GParted, means what?” November 2016. https://lists.debian.org/debian-user/2016/11/msg01017.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&#039;&#039;Contributed by [https://forums.debian.net/search.php?keywords=distro-nix distro-nix] on Debian User Forums on 2026-04-06.&#039;&#039; Comments, corrections, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=236</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=236"/>
		<updated>2026-04-10T02:52:56Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: Moved footer position&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created: 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Updated: 2026-04-09 - added references and restructured heading order;&lt;br /&gt;
&lt;br /&gt;
ID: 005146.11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A Debian Live USB with persistence boots a full Debian environment from a USB drive while retaining changes across sessions. Files you create, settings you change, and packages you install survive reboot—stored on a dedicated partition rather than the volatile live environment. Nothing is written to the host machine’s internal disk.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A standard live USB is stateless: each boot starts from the same ISO image. The persistence partition changes that. From a single drive you get your shell configuration, documents, utilities, browser profile, and scripts, available on any machine you boot it from.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== What You’ll Need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum is 4 GB, but that leaves little room for persistence. A 32 GB drive is a practical working size. Download the Debian Live ISO from the official Debian website: &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tools required—dd, fdisk, and mkfs.ext4—are standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Install them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These packages are available from the live session’s apt cache without adding sources. They don’t persist to the USB unless persistence is already active.&lt;br /&gt;
&lt;br /&gt;
== Identifying Your USB Device ==&lt;br /&gt;
Plug in the USB drive and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your USB device will appear as /dev/sdb, /dev/sdc, or similar, depending on what else is attached. Confirm it by cross-referencing the reported size with the known capacity of the drive.&lt;br /&gt;
&lt;br /&gt;
Two placeholders are used throughout this document. /dev/sdX refers to the device itself—substitute your actual device identifier everywhere it appears. /dev/sdXN refers to the persistence partition—N is the partition number you’ll confirm from lsblk output after you&#039;ve created it.&lt;br /&gt;
&lt;br /&gt;
Use the device path, not a partition path: /dev/sdb is correct; /dev/sdb1 is not.&lt;br /&gt;
&lt;br /&gt;
== Boot Entry Selection ==&lt;br /&gt;
The firmware boot menu on many systems presents two entries for a USB device: one labeled with the device name alone, and one prefixed with UEFI:. On the hardware used for this document, selecting the UEFI:-prefixed entry after adding a persistence partition consistently produced a bare grub&amp;gt; prompt rather than the Debian live menu. Selecting the plain device entry booted correctly every time.&lt;br /&gt;
&lt;br /&gt;
Throughout this procedure, select the plain device entry—not the one prefixed with UEFI:.&lt;br /&gt;
&lt;br /&gt;
This behavior was observed on specific hardware. Whether it reproduces on all firmware is not established here. The mechanism and a possible explanation are in &amp;lt;ref&amp;gt;https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&amp;lt;/ref&amp;gt; If your firmware presents only a UEFI boot path, recovery from within a booted live session may be possible by correcting the GRUB prefix, but that procedure is outside the scope of this document.&lt;br /&gt;
&lt;br /&gt;
= Procedure =&lt;br /&gt;
&lt;br /&gt;
=== Clean the Drive ===&lt;br /&gt;
If the USB has been used before, residual partition signatures or bootloader data in the early sectors can interfere with the ISO write or the subsequent boot. Clear them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
wipefs removes filesystem and partition table signatures. The dd command zeros the first 200 MB, covering the MBR, GPT header, and any EFI data in the early sectors.&lt;br /&gt;
&lt;br /&gt;
=== Write the ISO ===&lt;br /&gt;
Before running dd, confirm that sync resolves to the system binary and not a shell alias:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should be sync is /usr/bin/sync. If it returns an alias definition instead, unalias it with unalias sync, or substitute /usr/bin/sync explicitly at the end of the dd command.&lt;br /&gt;
&lt;br /&gt;
Write the ISO:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
status=progress shows the running transfer rate. sync flushes the write cache on completion—don’t remove the drive before it returns. The write will take a few minutes depending on the drive’s speed.&lt;br /&gt;
&lt;br /&gt;
=== Verify the Base Boot ===&lt;br /&gt;
Before adding the persistence partition, confirm the ISO write produced a bootable drive. Boot from the USB, selecting the plain (non-UEFI:) device entry. If it reaches the Debian live menu and boots cleanly, you have a confirmed working baseline. If it doesn’t boot at this stage, don’t continue—repeat [[Debian Live USB with Persistence#Procedure|4]]&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. The persistence partition goes there. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table that supports both BIOS and UEFI boot paths. Adding a partition requires an explicit start sector; without it, fdisk’s default placement can conflict with the hybrid structure in ways that affect the boot. The failure modes of parted and gdisk with this layout are documented in §4.9&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Print the current partition table:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two partitions will be present: the main ISO partition (type 0 or Empty—this is expected for an isohybrid layout) and a small EFI partition of approximately 3.2 MB. The p output shows the end sector of the last partition in the End column. The persistence partition must start at the next sector—that value plus one. On the test hardware with a Debian 13.4 live ISO written to the drive, the last partition ended at sector 8175999 and the persistence partition started at sector 8176000. This figure will vary with the ISO version and release; read your own p output and don’t use the test value without verifying it matches.&lt;br /&gt;
&lt;br /&gt;
Create the new partition:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When fdisk prompts for the first sector, enter the start sector you identified from the p output—do not accept the default. Accept the default for the last sector to use the remaining space on the drive.&lt;br /&gt;
&lt;br /&gt;
If fdisk asks whether to remove an existing ext4 signature, answer &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;. This clears a remnant from a previous attempt.&lt;br /&gt;
&lt;br /&gt;
Write the changes and exit:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After fdisk writes the new partition table, the running kernel may not immediately recognize the change. partprobe signals the kernel to re-read the partition table on the device without requiring a reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it completes, confirm the new partition is visible:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your new partition will appear beneath the device in the output. Note its full identifier—for example, sdb3 or sdc4—as you’ll need it in the next two steps. If it doesn’t appear immediately, wait a moment and run lsblk again before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Format the Partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence. The Debian live system identifies the persistence partition by this label at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Configuration ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdXN /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The / union directive instructs the live system to mount the entire filesystem as a union overlay. Changes made during a session are written to the persistence partition rather than discarded on shutdown.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with Persistence ==&lt;br /&gt;
Boot from the USB, selecting the plain (non-UEFI:) device entry in the firmware boot menu. At the Debian live GRUB menu, press Tab to edit the selected boot entry. On the line beginning with linux, append persistence after boot=live components. Press Enter to boot.&lt;br /&gt;
&lt;br /&gt;
The first boot with persistence active will be slower than a standard live session—the system is running entirely from the USB drive, and the persistence overlay adds a layer of I/O. This is normal.&lt;br /&gt;
&lt;br /&gt;
== Verify Persistence ==&lt;br /&gt;
After booting, confirm the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should show sdXN mounted at /run/live/persistence/sdXN.&lt;br /&gt;
&lt;br /&gt;
Create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot with persistence enabled. If the file is present after reboot, persistence is working.&lt;br /&gt;
&lt;br /&gt;
== What Didn’t Work, and Why ==&lt;br /&gt;
&lt;br /&gt;
=== parted ===&lt;br /&gt;
parted misreported the capacity of the test USB drive: a 32 GB device was reported as approximately 125 GB. Determining where the free space began or how large to make the persistence partition was not possible from that output. parted was not used further. The broader behavior—libparted-based tools handling the isohybrid format unreliably—is documented on the Debian User mailing list [9].&lt;br /&gt;
&lt;br /&gt;
=== gdisk / sgdisk ===&lt;br /&gt;
gdisk and sgdisk are GPT-aware tools and would seem the logical choice for a drive with a hybrid partition table. On the test USB, sgdisk produced:&amp;lt;blockquote&amp;gt;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&lt;br /&gt;
&lt;br /&gt;
Warning! Secondary partition table overlaps the last partition by 33 blocks!&lt;br /&gt;
&lt;br /&gt;
Could not create partition 3 from 14580 to 8177663&lt;br /&gt;
&lt;br /&gt;
Non-GPT disk; not saving changes. Use -g to override.&lt;br /&gt;
&lt;br /&gt;
Error encountered; not saving changes.&amp;lt;/blockquote&amp;gt;The isohybrid layout places the secondary GPT header in a location that overlaps the last partition. sgdisk identifies this as invalid and refuses to proceed. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk can’t be used here.&lt;br /&gt;
&lt;br /&gt;
cp was also tested as an alternative to dd for writing the ISO, on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout. It’s not an alternative—it’s a slower write with the same result.&lt;br /&gt;
&lt;br /&gt;
== The UEFI grub&amp;gt; Prompt ==&lt;br /&gt;
On the test hardware, adding a persistence partition and then selecting the UEFI:-prefixed boot entry consistently dropped to a bare grub&amp;gt; prompt. Running ls from that prompt showed the internal drive’s partitions; the USB’s live partition was unreachable from there.&lt;br /&gt;
&lt;br /&gt;
What was observed: the USB’s own GRUB appeared briefly—visible as a rapid flash on screen with a “no such…” error—then failed, after which the firmware handed control to the internal drive’s GRUB, which presented its own grub&amp;gt; prompt.&lt;br /&gt;
&lt;br /&gt;
The UEFI specification states that firmware may remove boot options it considers invalid [7]; the ArchWiki documents firmware removing entries for drives it detects as changed as a known occurrence [8]. After adding the persistence partition, the USB’s EFI entry—pointing to EFI/boot/bootx64.efi—may no longer have been treated as valid by the firmware, causing it to fall through to the next available bootloader on the internal drive. Whether modifying the partition table on a removable device is sufficient to trigger this behavior, and under what firmware conditions, wasn’t reproducible in a controlled way during testing.&lt;br /&gt;
&lt;br /&gt;
Selecting the plain (non-UEFI:) device entry uses the legacy MBR boot path, which loads the USB’s own GRUB directly and has no dependency on the UEFI NVRAM or EFI boot entries. On the test hardware, this path was unaffected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
== Anonymity ==&lt;br /&gt;
A Debian Live USB with persistence, used correctly, writes nothing to the host machine’s internal disk. It doesn’t modify the installed OS, create logs on the host filesystem, or leave traces in the usual locations.&lt;br /&gt;
&lt;br /&gt;
It doesn’t provide anonymity. Boot events may be logged by firmware or enterprise management systems. Network activity is visible to routers, ISPs, and network administrators regardless of which OS is running. Mounting the internal disk during a live session makes its contents accessible to the live environment, and any writes to it are permanent. A live USB is a portable, self-contained Debian environment—it isn’t a privacy tool by design.&lt;br /&gt;
&lt;br /&gt;
== A Note on Carrying Data ==&lt;br /&gt;
The persistence partition is a practical place to keep working data alongside the system state—documents, scripts, configuration files, anything you’d normally keep in ~/Documents or ~/bin. It travels with the drive.&lt;br /&gt;
&lt;br /&gt;
Installed packages persist across sessions but may have hardware-specific dependencies. For general desktop use this isn’t usually an issue, but it’s worth keeping in mind if you’re installing drivers or kernel modules that assume specific hardware.&lt;br /&gt;
&lt;br /&gt;
== Citations ==&lt;br /&gt;
Syslinux Project. “Isohybrid.” Syslinux Wiki.&lt;br /&gt;
&lt;br /&gt;
[2] Linux Command Library. “isohybrid(1) man page.” https://linuxcommandlibrary.com/man/isohybrid&lt;br /&gt;
&lt;br /&gt;
[3] Smith, Roderick W. “Hybrid MBRs.” GPT fdisk documentation. https://www.rodsbooks.com/gdisk/hybrid.html&lt;br /&gt;
&lt;br /&gt;
[4] Debian Manpages. “persistence.conf(5).” live-boot-doc, Trixie. https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&lt;br /&gt;
&lt;br /&gt;
[5] Debian Live Team. “Customizing Run-Time Behaviours.” Debian Live Manual. https://live-team.pages.debian.net/live-manual/html/live-manual/customizing-run-time-behaviours.en.html&lt;br /&gt;
&lt;br /&gt;
[6] Debian Manpages. “live-boot(7).” live-boot-doc. https://manpages.debian.org/unstable/live-boot-doc/live-boot.7.en.html&lt;br /&gt;
&lt;br /&gt;
[7] UEFI Forum. “Boot Manager.” UEFI Specification 2.10, §3. https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&lt;br /&gt;
&lt;br /&gt;
[8] ArchWiki. “Unified Extensible Firmware Interface.” https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface&lt;br /&gt;
&lt;br /&gt;
[9] Debian User Mailing List. “Error message from GParted, means what?” November 2016. https://lists.debian.org/debian-user/2016/11/msg01017.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&#039;&#039;Contributed by [https://forums.debian.net/search.php?keywords=distro-nix distro-nix] on Debian User Forums on 2026-04-06.&#039;&#039; Comments, corrections, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=235</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=235"/>
		<updated>2026-04-10T02:48:41Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: /* Verify the Base Boot */  Inserted link to 4&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created: 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Updated: 2026-04-09 - added references and restructured heading order;&lt;br /&gt;
&lt;br /&gt;
ID: 005146.11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A Debian Live USB with persistence boots a full Debian environment from a USB drive while retaining changes across sessions. Files you create, settings you change, and packages you install survive reboot—stored on a dedicated partition rather than the volatile live environment. Nothing is written to the host machine’s internal disk.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A standard live USB is stateless: each boot starts from the same ISO image. The persistence partition changes that. From a single drive you get your shell configuration, documents, utilities, browser profile, and scripts, available on any machine you boot it from.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== What You’ll Need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum is 4 GB, but that leaves little room for persistence. A 32 GB drive is a practical working size. Download the Debian Live ISO from the official Debian website: &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tools required—dd, fdisk, and mkfs.ext4—are standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Install them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These packages are available from the live session’s apt cache without adding sources. They don’t persist to the USB unless persistence is already active.&lt;br /&gt;
&lt;br /&gt;
== Identifying Your USB Device ==&lt;br /&gt;
Plug in the USB drive and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your USB device will appear as /dev/sdb, /dev/sdc, or similar, depending on what else is attached. Confirm it by cross-referencing the reported size with the known capacity of the drive.&lt;br /&gt;
&lt;br /&gt;
Two placeholders are used throughout this document. /dev/sdX refers to the device itself—substitute your actual device identifier everywhere it appears. /dev/sdXN refers to the persistence partition—N is the partition number you’ll confirm from lsblk output after you&#039;ve created it.&lt;br /&gt;
&lt;br /&gt;
Use the device path, not a partition path: /dev/sdb is correct; /dev/sdb1 is not.&lt;br /&gt;
&lt;br /&gt;
== Boot Entry Selection ==&lt;br /&gt;
The firmware boot menu on many systems presents two entries for a USB device: one labeled with the device name alone, and one prefixed with UEFI:. On the hardware used for this document, selecting the UEFI:-prefixed entry after adding a persistence partition consistently produced a bare grub&amp;gt; prompt rather than the Debian live menu. Selecting the plain device entry booted correctly every time.&lt;br /&gt;
&lt;br /&gt;
Throughout this procedure, select the plain device entry—not the one prefixed with UEFI:.&lt;br /&gt;
&lt;br /&gt;
This behavior was observed on specific hardware. Whether it reproduces on all firmware is not established here. The mechanism and a possible explanation are in &amp;lt;ref&amp;gt;https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&amp;lt;/ref&amp;gt; If your firmware presents only a UEFI boot path, recovery from within a booted live session may be possible by correcting the GRUB prefix, but that procedure is outside the scope of this document.&lt;br /&gt;
&lt;br /&gt;
= Procedure =&lt;br /&gt;
&lt;br /&gt;
=== Clean the Drive ===&lt;br /&gt;
If the USB has been used before, residual partition signatures or bootloader data in the early sectors can interfere with the ISO write or the subsequent boot. Clear them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
wipefs removes filesystem and partition table signatures. The dd command zeros the first 200 MB, covering the MBR, GPT header, and any EFI data in the early sectors.&lt;br /&gt;
&lt;br /&gt;
=== Write the ISO ===&lt;br /&gt;
Before running dd, confirm that sync resolves to the system binary and not a shell alias:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should be sync is /usr/bin/sync. If it returns an alias definition instead, unalias it with unalias sync, or substitute /usr/bin/sync explicitly at the end of the dd command.&lt;br /&gt;
&lt;br /&gt;
Write the ISO:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
status=progress shows the running transfer rate. sync flushes the write cache on completion—don’t remove the drive before it returns. The write will take a few minutes depending on the drive’s speed.&lt;br /&gt;
&lt;br /&gt;
=== Verify the Base Boot ===&lt;br /&gt;
Before adding the persistence partition, confirm the ISO write produced a bootable drive. Boot from the USB, selecting the plain (non-UEFI:) device entry. If it reaches the Debian live menu and boots cleanly, you have a confirmed working baseline. If it doesn’t boot at this stage, don’t continue—repeat [[Debian Live USB with Persistence#Procedure|4]]&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. The persistence partition goes there. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table that supports both BIOS and UEFI boot paths. Adding a partition requires an explicit start sector; without it, fdisk’s default placement can conflict with the hybrid structure in ways that affect the boot. The failure modes of parted and gdisk with this layout are documented in §4.9&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Print the current partition table:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two partitions will be present: the main ISO partition (type 0 or Empty—this is expected for an isohybrid layout) and a small EFI partition of approximately 3.2 MB. The p output shows the end sector of the last partition in the End column. The persistence partition must start at the next sector—that value plus one. On the test hardware with a Debian 13.4 live ISO written to the drive, the last partition ended at sector 8175999 and the persistence partition started at sector 8176000. This figure will vary with the ISO version and release; read your own p output and don’t use the test value without verifying it matches.&lt;br /&gt;
&lt;br /&gt;
Create the new partition:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When fdisk prompts for the first sector, enter the start sector you identified from the p output—do not accept the default. Accept the default for the last sector to use the remaining space on the drive.&lt;br /&gt;
&lt;br /&gt;
If fdisk asks whether to remove an existing ext4 signature, answer &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;. This clears a remnant from a previous attempt.&lt;br /&gt;
&lt;br /&gt;
Write the changes and exit:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After fdisk writes the new partition table, the running kernel may not immediately recognize the change. partprobe signals the kernel to re-read the partition table on the device without requiring a reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it completes, confirm the new partition is visible:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your new partition will appear beneath the device in the output. Note its full identifier—for example, sdb3 or sdc4—as you’ll need it in the next two steps. If it doesn’t appear immediately, wait a moment and run lsblk again before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Format the Partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence. The Debian live system identifies the persistence partition by this label at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Configuration ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdXN /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The / union directive instructs the live system to mount the entire filesystem as a union overlay. Changes made during a session are written to the persistence partition rather than discarded on shutdown.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with Persistence ==&lt;br /&gt;
Boot from the USB, selecting the plain (non-UEFI:) device entry in the firmware boot menu. At the Debian live GRUB menu, press Tab to edit the selected boot entry. On the line beginning with linux, append persistence after boot=live components. Press Enter to boot.&lt;br /&gt;
&lt;br /&gt;
The first boot with persistence active will be slower than a standard live session—the system is running entirely from the USB drive, and the persistence overlay adds a layer of I/O. This is normal.&lt;br /&gt;
&lt;br /&gt;
== Verify Persistence ==&lt;br /&gt;
After booting, confirm the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should show sdXN mounted at /run/live/persistence/sdXN.&lt;br /&gt;
&lt;br /&gt;
Create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot with persistence enabled. If the file is present after reboot, persistence is working.&lt;br /&gt;
&lt;br /&gt;
== What Didn’t Work, and Why ==&lt;br /&gt;
&lt;br /&gt;
=== parted ===&lt;br /&gt;
parted misreported the capacity of the test USB drive: a 32 GB device was reported as approximately 125 GB. Determining where the free space began or how large to make the persistence partition was not possible from that output. parted was not used further. The broader behavior—libparted-based tools handling the isohybrid format unreliably—is documented on the Debian User mailing list [9].&lt;br /&gt;
&lt;br /&gt;
=== gdisk / sgdisk ===&lt;br /&gt;
gdisk and sgdisk are GPT-aware tools and would seem the logical choice for a drive with a hybrid partition table. On the test USB, sgdisk produced:&amp;lt;blockquote&amp;gt;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&lt;br /&gt;
&lt;br /&gt;
Warning! Secondary partition table overlaps the last partition by 33 blocks!&lt;br /&gt;
&lt;br /&gt;
Could not create partition 3 from 14580 to 8177663&lt;br /&gt;
&lt;br /&gt;
Non-GPT disk; not saving changes. Use -g to override.&lt;br /&gt;
&lt;br /&gt;
Error encountered; not saving changes.&amp;lt;/blockquote&amp;gt;The isohybrid layout places the secondary GPT header in a location that overlaps the last partition. sgdisk identifies this as invalid and refuses to proceed. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk can’t be used here.&lt;br /&gt;
&lt;br /&gt;
cp was also tested as an alternative to dd for writing the ISO, on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout. It’s not an alternative—it’s a slower write with the same result.&lt;br /&gt;
&lt;br /&gt;
== The UEFI grub&amp;gt; Prompt ==&lt;br /&gt;
On the test hardware, adding a persistence partition and then selecting the UEFI:-prefixed boot entry consistently dropped to a bare grub&amp;gt; prompt. Running ls from that prompt showed the internal drive’s partitions; the USB’s live partition was unreachable from there.&lt;br /&gt;
&lt;br /&gt;
What was observed: the USB’s own GRUB appeared briefly—visible as a rapid flash on screen with a “no such…” error—then failed, after which the firmware handed control to the internal drive’s GRUB, which presented its own grub&amp;gt; prompt.&lt;br /&gt;
&lt;br /&gt;
The UEFI specification states that firmware may remove boot options it considers invalid [7]; the ArchWiki documents firmware removing entries for drives it detects as changed as a known occurrence [8]. After adding the persistence partition, the USB’s EFI entry—pointing to EFI/boot/bootx64.efi—may no longer have been treated as valid by the firmware, causing it to fall through to the next available bootloader on the internal drive. Whether modifying the partition table on a removable device is sufficient to trigger this behavior, and under what firmware conditions, wasn’t reproducible in a controlled way during testing.&lt;br /&gt;
&lt;br /&gt;
Selecting the plain (non-UEFI:) device entry uses the legacy MBR boot path, which loads the USB’s own GRUB directly and has no dependency on the UEFI NVRAM or EFI boot entries. On the test hardware, this path was unaffected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
== Anonymity ==&lt;br /&gt;
A Debian Live USB with persistence, used correctly, writes nothing to the host machine’s internal disk. It doesn’t modify the installed OS, create logs on the host filesystem, or leave traces in the usual locations.&lt;br /&gt;
&lt;br /&gt;
It doesn’t provide anonymity. Boot events may be logged by firmware or enterprise management systems. Network activity is visible to routers, ISPs, and network administrators regardless of which OS is running. Mounting the internal disk during a live session makes its contents accessible to the live environment, and any writes to it are permanent. A live USB is a portable, self-contained Debian environment—it isn’t a privacy tool by design.&lt;br /&gt;
&lt;br /&gt;
== A Note on Carrying Data ==&lt;br /&gt;
The persistence partition is a practical place to keep working data alongside the system state—documents, scripts, configuration files, anything you’d normally keep in ~/Documents or ~/bin. It travels with the drive.&lt;br /&gt;
&lt;br /&gt;
Installed packages persist across sessions but may have hardware-specific dependencies. For general desktop use this isn’t usually an issue, but it’s worth keeping in mind if you’re installing drivers or kernel modules that assume specific hardware.&lt;br /&gt;
&lt;br /&gt;
== Citations ==&lt;br /&gt;
Syslinux Project. “Isohybrid.” Syslinux Wiki.&lt;br /&gt;
&lt;br /&gt;
[2] Linux Command Library. “isohybrid(1) man page.” https://linuxcommandlibrary.com/man/isohybrid&lt;br /&gt;
&lt;br /&gt;
[3] Smith, Roderick W. “Hybrid MBRs.” GPT fdisk documentation. https://www.rodsbooks.com/gdisk/hybrid.html&lt;br /&gt;
&lt;br /&gt;
[4] Debian Manpages. “persistence.conf(5).” live-boot-doc, Trixie. https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&lt;br /&gt;
&lt;br /&gt;
[5] Debian Live Team. “Customizing Run-Time Behaviours.” Debian Live Manual. https://live-team.pages.debian.net/live-manual/html/live-manual/customizing-run-time-behaviours.en.html&lt;br /&gt;
&lt;br /&gt;
[6] Debian Manpages. “live-boot(7).” live-boot-doc. https://manpages.debian.org/unstable/live-boot-doc/live-boot.7.en.html&lt;br /&gt;
&lt;br /&gt;
[7] UEFI Forum. “Boot Manager.” UEFI Specification 2.10, §3. https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&lt;br /&gt;
&lt;br /&gt;
[8] ArchWiki. “Unified Extensible Firmware Interface.” https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface&lt;br /&gt;
&lt;br /&gt;
[9] Debian User Mailing List. “Error message from GParted, means what?” November 2016. https://lists.debian.org/debian-user/2016/11/msg01017.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Contributed by [https://forums.debian.net/search.php?keywords=distro-nix distro-nix] on Debian User Forums on 2026-04-06.&#039;&#039; Comments, corrections, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=234</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=234"/>
		<updated>2026-04-10T02:38:27Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: Added citation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created: 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Updated: 2026-04-09 - added references and restructured heading order;&lt;br /&gt;
&lt;br /&gt;
ID: 005146.11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A Debian Live USB with persistence boots a full Debian environment from a USB drive while retaining changes across sessions. Files you create, settings you change, and packages you install survive reboot—stored on a dedicated partition rather than the volatile live environment. Nothing is written to the host machine’s internal disk.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A standard live USB is stateless: each boot starts from the same ISO image. The persistence partition changes that. From a single drive you get your shell configuration, documents, utilities, browser profile, and scripts, available on any machine you boot it from.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== What You’ll Need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum is 4 GB, but that leaves little room for persistence. A 32 GB drive is a practical working size. Download the Debian Live ISO from the official Debian website: &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tools required—dd, fdisk, and mkfs.ext4—are standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Install them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These packages are available from the live session’s apt cache without adding sources. They don’t persist to the USB unless persistence is already active.&lt;br /&gt;
&lt;br /&gt;
== Identifying Your USB Device ==&lt;br /&gt;
Plug in the USB drive and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your USB device will appear as /dev/sdb, /dev/sdc, or similar, depending on what else is attached. Confirm it by cross-referencing the reported size with the known capacity of the drive.&lt;br /&gt;
&lt;br /&gt;
Two placeholders are used throughout this document. /dev/sdX refers to the device itself—substitute your actual device identifier everywhere it appears. /dev/sdXN refers to the persistence partition—N is the partition number you’ll confirm from lsblk output after you&#039;ve created it.&lt;br /&gt;
&lt;br /&gt;
Use the device path, not a partition path: /dev/sdb is correct; /dev/sdb1 is not.&lt;br /&gt;
&lt;br /&gt;
== Boot Entry Selection ==&lt;br /&gt;
The firmware boot menu on many systems presents two entries for a USB device: one labeled with the device name alone, and one prefixed with UEFI:. On the hardware used for this document, selecting the UEFI:-prefixed entry after adding a persistence partition consistently produced a bare grub&amp;gt; prompt rather than the Debian live menu. Selecting the plain device entry booted correctly every time.&lt;br /&gt;
&lt;br /&gt;
Throughout this procedure, select the plain device entry—not the one prefixed with UEFI:.&lt;br /&gt;
&lt;br /&gt;
This behavior was observed on specific hardware. Whether it reproduces on all firmware is not established here. The mechanism and a possible explanation are in &amp;lt;ref&amp;gt;https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&amp;lt;/ref&amp;gt; If your firmware presents only a UEFI boot path, recovery from within a booted live session may be possible by correcting the GRUB prefix, but that procedure is outside the scope of this document.&lt;br /&gt;
&lt;br /&gt;
= Procedure =&lt;br /&gt;
&lt;br /&gt;
=== Clean the Drive ===&lt;br /&gt;
If the USB has been used before, residual partition signatures or bootloader data in the early sectors can interfere with the ISO write or the subsequent boot. Clear them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
wipefs removes filesystem and partition table signatures. The dd command zeros the first 200 MB, covering the MBR, GPT header, and any EFI data in the early sectors.&lt;br /&gt;
&lt;br /&gt;
=== Write the ISO ===&lt;br /&gt;
Before running dd, confirm that sync resolves to the system binary and not a shell alias:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should be sync is /usr/bin/sync. If it returns an alias definition instead, unalias it with unalias sync, or substitute /usr/bin/sync explicitly at the end of the dd command.&lt;br /&gt;
&lt;br /&gt;
Write the ISO:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
status=progress shows the running transfer rate. sync flushes the write cache on completion—don’t remove the drive before it returns. The write will take a few minutes depending on the drive’s speed.&lt;br /&gt;
&lt;br /&gt;
=== Verify the Base Boot ===&lt;br /&gt;
Before adding the persistence partition, confirm the ISO write produced a bootable drive. Boot from the USB, selecting the plain (non-UEFI:) device entry. If it reaches the Debian live menu and boots cleanly, you have a confirmed working baseline. If it doesn’t boot at this stage, don’t continue—repeat §4.1&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. The persistence partition goes there. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table that supports both BIOS and UEFI boot paths. Adding a partition requires an explicit start sector; without it, fdisk’s default placement can conflict with the hybrid structure in ways that affect the boot. The failure modes of parted and gdisk with this layout are documented in §4.9&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Print the current partition table:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two partitions will be present: the main ISO partition (type 0 or Empty—this is expected for an isohybrid layout) and a small EFI partition of approximately 3.2 MB. The p output shows the end sector of the last partition in the End column. The persistence partition must start at the next sector—that value plus one. On the test hardware with a Debian 13.4 live ISO written to the drive, the last partition ended at sector 8175999 and the persistence partition started at sector 8176000. This figure will vary with the ISO version and release; read your own p output and don’t use the test value without verifying it matches.&lt;br /&gt;
&lt;br /&gt;
Create the new partition:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When fdisk prompts for the first sector, enter the start sector you identified from the p output—do not accept the default. Accept the default for the last sector to use the remaining space on the drive.&lt;br /&gt;
&lt;br /&gt;
If fdisk asks whether to remove an existing ext4 signature, answer &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;. This clears a remnant from a previous attempt.&lt;br /&gt;
&lt;br /&gt;
Write the changes and exit:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After fdisk writes the new partition table, the running kernel may not immediately recognize the change. partprobe signals the kernel to re-read the partition table on the device without requiring a reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it completes, confirm the new partition is visible:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your new partition will appear beneath the device in the output. Note its full identifier—for example, sdb3 or sdc4—as you’ll need it in the next two steps. If it doesn’t appear immediately, wait a moment and run lsblk again before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Format the Partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence. The Debian live system identifies the persistence partition by this label at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Configuration ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdXN /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The / union directive instructs the live system to mount the entire filesystem as a union overlay. Changes made during a session are written to the persistence partition rather than discarded on shutdown.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with Persistence ==&lt;br /&gt;
Boot from the USB, selecting the plain (non-UEFI:) device entry in the firmware boot menu. At the Debian live GRUB menu, press Tab to edit the selected boot entry. On the line beginning with linux, append persistence after boot=live components. Press Enter to boot.&lt;br /&gt;
&lt;br /&gt;
The first boot with persistence active will be slower than a standard live session—the system is running entirely from the USB drive, and the persistence overlay adds a layer of I/O. This is normal.&lt;br /&gt;
&lt;br /&gt;
== Verify Persistence ==&lt;br /&gt;
After booting, confirm the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should show sdXN mounted at /run/live/persistence/sdXN.&lt;br /&gt;
&lt;br /&gt;
Create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot with persistence enabled. If the file is present after reboot, persistence is working.&lt;br /&gt;
&lt;br /&gt;
== What Didn’t Work, and Why ==&lt;br /&gt;
&lt;br /&gt;
=== parted ===&lt;br /&gt;
parted misreported the capacity of the test USB drive: a 32 GB device was reported as approximately 125 GB. Determining where the free space began or how large to make the persistence partition was not possible from that output. parted was not used further. The broader behavior—libparted-based tools handling the isohybrid format unreliably—is documented on the Debian User mailing list [9].&lt;br /&gt;
&lt;br /&gt;
=== gdisk / sgdisk ===&lt;br /&gt;
gdisk and sgdisk are GPT-aware tools and would seem the logical choice for a drive with a hybrid partition table. On the test USB, sgdisk produced:&amp;lt;blockquote&amp;gt;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&lt;br /&gt;
&lt;br /&gt;
Warning! Secondary partition table overlaps the last partition by 33 blocks!&lt;br /&gt;
&lt;br /&gt;
Could not create partition 3 from 14580 to 8177663&lt;br /&gt;
&lt;br /&gt;
Non-GPT disk; not saving changes. Use -g to override.&lt;br /&gt;
&lt;br /&gt;
Error encountered; not saving changes.&amp;lt;/blockquote&amp;gt;The isohybrid layout places the secondary GPT header in a location that overlaps the last partition. sgdisk identifies this as invalid and refuses to proceed. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk can’t be used here.&lt;br /&gt;
&lt;br /&gt;
cp was also tested as an alternative to dd for writing the ISO, on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout. It’s not an alternative—it’s a slower write with the same result.&lt;br /&gt;
&lt;br /&gt;
== The UEFI grub&amp;gt; Prompt ==&lt;br /&gt;
On the test hardware, adding a persistence partition and then selecting the UEFI:-prefixed boot entry consistently dropped to a bare grub&amp;gt; prompt. Running ls from that prompt showed the internal drive’s partitions; the USB’s live partition was unreachable from there.&lt;br /&gt;
&lt;br /&gt;
What was observed: the USB’s own GRUB appeared briefly—visible as a rapid flash on screen with a “no such…” error—then failed, after which the firmware handed control to the internal drive’s GRUB, which presented its own grub&amp;gt; prompt.&lt;br /&gt;
&lt;br /&gt;
The UEFI specification states that firmware may remove boot options it considers invalid [7]; the ArchWiki documents firmware removing entries for drives it detects as changed as a known occurrence [8]. After adding the persistence partition, the USB’s EFI entry—pointing to EFI/boot/bootx64.efi—may no longer have been treated as valid by the firmware, causing it to fall through to the next available bootloader on the internal drive. Whether modifying the partition table on a removable device is sufficient to trigger this behavior, and under what firmware conditions, wasn’t reproducible in a controlled way during testing.&lt;br /&gt;
&lt;br /&gt;
Selecting the plain (non-UEFI:) device entry uses the legacy MBR boot path, which loads the USB’s own GRUB directly and has no dependency on the UEFI NVRAM or EFI boot entries. On the test hardware, this path was unaffected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
== Anonymity ==&lt;br /&gt;
A Debian Live USB with persistence, used correctly, writes nothing to the host machine’s internal disk. It doesn’t modify the installed OS, create logs on the host filesystem, or leave traces in the usual locations.&lt;br /&gt;
&lt;br /&gt;
It doesn’t provide anonymity. Boot events may be logged by firmware or enterprise management systems. Network activity is visible to routers, ISPs, and network administrators regardless of which OS is running. Mounting the internal disk during a live session makes its contents accessible to the live environment, and any writes to it are permanent. A live USB is a portable, self-contained Debian environment—it isn’t a privacy tool by design.&lt;br /&gt;
&lt;br /&gt;
== A Note on Carrying Data ==&lt;br /&gt;
The persistence partition is a practical place to keep working data alongside the system state—documents, scripts, configuration files, anything you’d normally keep in ~/Documents or ~/bin. It travels with the drive.&lt;br /&gt;
&lt;br /&gt;
Installed packages persist across sessions but may have hardware-specific dependencies. For general desktop use this isn’t usually an issue, but it’s worth keeping in mind if you’re installing drivers or kernel modules that assume specific hardware.&lt;br /&gt;
&lt;br /&gt;
== Citations ==&lt;br /&gt;
Syslinux Project. “Isohybrid.” Syslinux Wiki.&lt;br /&gt;
&lt;br /&gt;
[2] Linux Command Library. “isohybrid(1) man page.” https://linuxcommandlibrary.com/man/isohybrid&lt;br /&gt;
&lt;br /&gt;
[3] Smith, Roderick W. “Hybrid MBRs.” GPT fdisk documentation. https://www.rodsbooks.com/gdisk/hybrid.html&lt;br /&gt;
&lt;br /&gt;
[4] Debian Manpages. “persistence.conf(5).” live-boot-doc, Trixie. https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&lt;br /&gt;
&lt;br /&gt;
[5] Debian Live Team. “Customizing Run-Time Behaviours.” Debian Live Manual. https://live-team.pages.debian.net/live-manual/html/live-manual/customizing-run-time-behaviours.en.html&lt;br /&gt;
&lt;br /&gt;
[6] Debian Manpages. “live-boot(7).” live-boot-doc. https://manpages.debian.org/unstable/live-boot-doc/live-boot.7.en.html&lt;br /&gt;
&lt;br /&gt;
[7] UEFI Forum. “Boot Manager.” UEFI Specification 2.10, §3. https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&lt;br /&gt;
&lt;br /&gt;
[8] ArchWiki. “Unified Extensible Firmware Interface.” https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface&lt;br /&gt;
&lt;br /&gt;
[9] Debian User Mailing List. “Error message from GParted, means what?” November 2016. https://lists.debian.org/debian-user/2016/11/msg01017.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Contributed by [https://forums.debian.net/search.php?keywords=distro-nix distro-nix] on Debian User Forums on 2026-04-06.&#039;&#039; Comments, corrections, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=233</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=233"/>
		<updated>2026-04-10T02:30:45Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created: 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Updated: 2026-04-09 - added references and restructured heading order;&lt;br /&gt;
&lt;br /&gt;
ID: 005146.11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A Debian Live USB with persistence boots a full Debian environment from a USB drive while retaining changes across sessions. Files you create, settings you change, and packages you install survive reboot—stored on a dedicated partition rather than the volatile live environment. Nothing is written to the host machine’s internal disk.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A standard live USB is stateless: each boot starts from the same ISO image. The persistence partition changes that. From a single drive you get your shell configuration, documents, utilities, browser profile, and scripts, available on any machine you boot it from.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== What You’ll Need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum is 4 GB, but that leaves little room for persistence. A 32 GB drive is a practical working size. Download the Debian Live ISO from the official Debian website: &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tools required—dd, fdisk, and mkfs.ext4—are standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Install them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These packages are available from the live session’s apt cache without adding sources. They don’t persist to the USB unless persistence is already active.&lt;br /&gt;
&lt;br /&gt;
== Identifying Your USB Device ==&lt;br /&gt;
Plug in the USB drive and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your USB device will appear as /dev/sdb, /dev/sdc, or similar, depending on what else is attached. Confirm it by cross-referencing the reported size with the known capacity of the drive.&lt;br /&gt;
&lt;br /&gt;
Two placeholders are used throughout this document. /dev/sdX refers to the device itself—substitute your actual device identifier everywhere it appears. /dev/sdXN refers to the persistence partition—N is the partition number you’ll confirm from lsblk output after you&#039;ve created it.&lt;br /&gt;
&lt;br /&gt;
Use the device path, not a partition path: /dev/sdb is correct; /dev/sdb1 is not.&lt;br /&gt;
&lt;br /&gt;
== Boot Entry Selection ==&lt;br /&gt;
The firmware boot menu on many systems presents two entries for a USB device: one labeled with the device name alone, and one prefixed with UEFI:. On the hardware used for this document, selecting the UEFI:-prefixed entry after adding a persistence partition consistently produced a bare grub&amp;gt; prompt rather than the Debian live menu. Selecting the plain device entry booted correctly every time.&lt;br /&gt;
&lt;br /&gt;
Throughout this procedure, select the plain device entry—not the one prefixed with UEFI:.&lt;br /&gt;
&lt;br /&gt;
This behavior was observed on specific hardware. Whether it reproduces on all firmware is not established here. The mechanism and a possible explanation are in §5.3. If your firmware presents only a UEFI boot path, recovery from within a booted live session may be possible by correcting the GRUB prefix, but that procedure is outside the scope of this document.&lt;br /&gt;
&lt;br /&gt;
= Procedure =&lt;br /&gt;
&lt;br /&gt;
=== Clean the Drive ===&lt;br /&gt;
If the USB has been used before, residual partition signatures or bootloader data in the early sectors can interfere with the ISO write or the subsequent boot. Clear them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
wipefs removes filesystem and partition table signatures. The dd command zeros the first 200 MB, covering the MBR, GPT header, and any EFI data in the early sectors.&lt;br /&gt;
&lt;br /&gt;
=== Write the ISO ===&lt;br /&gt;
Before running dd, confirm that sync resolves to the system binary and not a shell alias:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should be sync is /usr/bin/sync. If it returns an alias definition instead, unalias it with unalias sync, or substitute /usr/bin/sync explicitly at the end of the dd command.&lt;br /&gt;
&lt;br /&gt;
Write the ISO:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
status=progress shows the running transfer rate. sync flushes the write cache on completion—don’t remove the drive before it returns. The write will take a few minutes depending on the drive’s speed.&lt;br /&gt;
&lt;br /&gt;
=== Verify the Base Boot ===&lt;br /&gt;
Before adding the persistence partition, confirm the ISO write produced a bootable drive. Boot from the USB, selecting the plain (non-UEFI:) device entry. If it reaches the Debian live menu and boots cleanly, you have a confirmed working baseline. If it doesn’t boot at this stage, don’t continue—repeat §4.1&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. The persistence partition goes there. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table that supports both BIOS and UEFI boot paths. Adding a partition requires an explicit start sector; without it, fdisk’s default placement can conflict with the hybrid structure in ways that affect the boot. The failure modes of parted and gdisk with this layout are documented in §4.9&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Print the current partition table:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two partitions will be present: the main ISO partition (type 0 or Empty—this is expected for an isohybrid layout) and a small EFI partition of approximately 3.2 MB. The p output shows the end sector of the last partition in the End column. The persistence partition must start at the next sector—that value plus one. On the test hardware with a Debian 13.4 live ISO written to the drive, the last partition ended at sector 8175999 and the persistence partition started at sector 8176000. This figure will vary with the ISO version and release; read your own p output and don’t use the test value without verifying it matches.&lt;br /&gt;
&lt;br /&gt;
Create the new partition:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When fdisk prompts for the first sector, enter the start sector you identified from the p output—do not accept the default. Accept the default for the last sector to use the remaining space on the drive.&lt;br /&gt;
&lt;br /&gt;
If fdisk asks whether to remove an existing ext4 signature, answer &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;. This clears a remnant from a previous attempt.&lt;br /&gt;
&lt;br /&gt;
Write the changes and exit:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After fdisk writes the new partition table, the running kernel may not immediately recognize the change. partprobe signals the kernel to re-read the partition table on the device without requiring a reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it completes, confirm the new partition is visible:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your new partition will appear beneath the device in the output. Note its full identifier—for example, sdb3 or sdc4—as you’ll need it in the next two steps. If it doesn’t appear immediately, wait a moment and run lsblk again before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Format the Partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence. The Debian live system identifies the persistence partition by this label at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Configuration ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdXN /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The / union directive instructs the live system to mount the entire filesystem as a union overlay. Changes made during a session are written to the persistence partition rather than discarded on shutdown.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with Persistence ==&lt;br /&gt;
Boot from the USB, selecting the plain (non-UEFI:) device entry in the firmware boot menu. At the Debian live GRUB menu, press Tab to edit the selected boot entry. On the line beginning with linux, append persistence after boot=live components. Press Enter to boot.&lt;br /&gt;
&lt;br /&gt;
The first boot with persistence active will be slower than a standard live session—the system is running entirely from the USB drive, and the persistence overlay adds a layer of I/O. This is normal.&lt;br /&gt;
&lt;br /&gt;
== Verify Persistence ==&lt;br /&gt;
After booting, confirm the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should show sdXN mounted at /run/live/persistence/sdXN.&lt;br /&gt;
&lt;br /&gt;
Create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot with persistence enabled. If the file is present after reboot, persistence is working.&lt;br /&gt;
&lt;br /&gt;
== What Didn’t Work, and Why ==&lt;br /&gt;
&lt;br /&gt;
=== parted ===&lt;br /&gt;
parted misreported the capacity of the test USB drive: a 32 GB device was reported as approximately 125 GB. Determining where the free space began or how large to make the persistence partition was not possible from that output. parted was not used further. The broader behavior—libparted-based tools handling the isohybrid format unreliably—is documented on the Debian User mailing list [9].&lt;br /&gt;
&lt;br /&gt;
=== gdisk / sgdisk ===&lt;br /&gt;
gdisk and sgdisk are GPT-aware tools and would seem the logical choice for a drive with a hybrid partition table. On the test USB, sgdisk produced:&amp;lt;blockquote&amp;gt;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&lt;br /&gt;
&lt;br /&gt;
Warning! Secondary partition table overlaps the last partition by 33 blocks!&lt;br /&gt;
&lt;br /&gt;
Could not create partition 3 from 14580 to 8177663&lt;br /&gt;
&lt;br /&gt;
Non-GPT disk; not saving changes. Use -g to override.&lt;br /&gt;
&lt;br /&gt;
Error encountered; not saving changes.&amp;lt;/blockquote&amp;gt;The isohybrid layout places the secondary GPT header in a location that overlaps the last partition. sgdisk identifies this as invalid and refuses to proceed. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk can’t be used here.&lt;br /&gt;
&lt;br /&gt;
cp was also tested as an alternative to dd for writing the ISO, on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout. It’s not an alternative—it’s a slower write with the same result.&lt;br /&gt;
&lt;br /&gt;
== The UEFI grub&amp;gt; Prompt ==&lt;br /&gt;
On the test hardware, adding a persistence partition and then selecting the UEFI:-prefixed boot entry consistently dropped to a bare grub&amp;gt; prompt. Running ls from that prompt showed the internal drive’s partitions; the USB’s live partition was unreachable from there.&lt;br /&gt;
&lt;br /&gt;
What was observed: the USB’s own GRUB appeared briefly—visible as a rapid flash on screen with a “no such…” error—then failed, after which the firmware handed control to the internal drive’s GRUB, which presented its own grub&amp;gt; prompt.&lt;br /&gt;
&lt;br /&gt;
The UEFI specification states that firmware may remove boot options it considers invalid [7]; the ArchWiki documents firmware removing entries for drives it detects as changed as a known occurrence [8]. After adding the persistence partition, the USB’s EFI entry—pointing to EFI/boot/bootx64.efi—may no longer have been treated as valid by the firmware, causing it to fall through to the next available bootloader on the internal drive. Whether modifying the partition table on a removable device is sufficient to trigger this behavior, and under what firmware conditions, wasn’t reproducible in a controlled way during testing.&lt;br /&gt;
&lt;br /&gt;
Selecting the plain (non-UEFI:) device entry uses the legacy MBR boot path, which loads the USB’s own GRUB directly and has no dependency on the UEFI NVRAM or EFI boot entries. On the test hardware, this path was unaffected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
== Anonymity ==&lt;br /&gt;
A Debian Live USB with persistence, used correctly, writes nothing to the host machine’s internal disk. It doesn’t modify the installed OS, create logs on the host filesystem, or leave traces in the usual locations.&lt;br /&gt;
&lt;br /&gt;
It doesn’t provide anonymity. Boot events may be logged by firmware or enterprise management systems. Network activity is visible to routers, ISPs, and network administrators regardless of which OS is running. Mounting the internal disk during a live session makes its contents accessible to the live environment, and any writes to it are permanent. A live USB is a portable, self-contained Debian environment—it isn’t a privacy tool by design.&lt;br /&gt;
&lt;br /&gt;
== A Note on Carrying Data ==&lt;br /&gt;
The persistence partition is a practical place to keep working data alongside the system state—documents, scripts, configuration files, anything you’d normally keep in ~/Documents or ~/bin. It travels with the drive.&lt;br /&gt;
&lt;br /&gt;
Installed packages persist across sessions but may have hardware-specific dependencies. For general desktop use this isn’t usually an issue, but it’s worth keeping in mind if you’re installing drivers or kernel modules that assume specific hardware.&lt;br /&gt;
&lt;br /&gt;
== Citations ==&lt;br /&gt;
Syslinux Project. “Isohybrid.” Syslinux Wiki.&lt;br /&gt;
&lt;br /&gt;
[2] Linux Command Library. “isohybrid(1) man page.” https://linuxcommandlibrary.com/man/isohybrid&lt;br /&gt;
&lt;br /&gt;
[3] Smith, Roderick W. “Hybrid MBRs.” GPT fdisk documentation. https://www.rodsbooks.com/gdisk/hybrid.html&lt;br /&gt;
&lt;br /&gt;
[4] Debian Manpages. “persistence.conf(5).” live-boot-doc, Trixie. https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&lt;br /&gt;
&lt;br /&gt;
[5] Debian Live Team. “Customizing Run-Time Behaviours.” Debian Live Manual. https://live-team.pages.debian.net/live-manual/html/live-manual/customizing-run-time-behaviours.en.html&lt;br /&gt;
&lt;br /&gt;
[6] Debian Manpages. “live-boot(7).” live-boot-doc. https://manpages.debian.org/unstable/live-boot-doc/live-boot.7.en.html&lt;br /&gt;
&lt;br /&gt;
[7] UEFI Forum. “Boot Manager.” UEFI Specification 2.10, §3. https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&lt;br /&gt;
&lt;br /&gt;
[8] ArchWiki. “Unified Extensible Firmware Interface.” https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface&lt;br /&gt;
&lt;br /&gt;
[9] Debian User Mailing List. “Error message from GParted, means what?” November 2016. https://lists.debian.org/debian-user/2016/11/msg01017.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Contributed by [https://forums.debian.net/search.php?keywords=distro-nix distro-nix] on Debian User Forums on 2026-04-06.&#039;&#039; Comments, corrections, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=232</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=232"/>
		<updated>2026-04-10T02:27:16Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: /* Citations */ added new citation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created: 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Updated: 2026-04-09 - added references and restructured heading order;&lt;br /&gt;
&lt;br /&gt;
ID: 005146.11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A Debian Live USB with persistence boots a full Debian environment from a USB drive while retaining changes across sessions. Files you create, settings you change, and packages you install survive reboot—stored on a dedicated partition rather than the volatile live environment. Nothing is written to the host machine’s internal disk.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A standard live USB is stateless: each boot starts from the same ISO image. The persistence partition changes that. From a single drive you get your shell configuration, documents, utilities, browser profile, and scripts, available on any machine you boot it from.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== What You’ll Need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum is 4 GB, but that leaves little room for persistence. A 32 GB drive is a practical working size. Download the Debian Live ISO from the official Debian website: &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tools required—dd, fdisk, and mkfs.ext4—are standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Install them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These packages are available from the live session’s apt cache without adding sources. They don’t persist to the USB unless persistence is already active.&lt;br /&gt;
&lt;br /&gt;
== Identifying Your USB Device ==&lt;br /&gt;
Plug in the USB drive and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your USB device will appear as /dev/sdb, /dev/sdc, or similar, depending on what else is attached. Confirm it by cross-referencing the reported size with the known capacity of the drive.&lt;br /&gt;
&lt;br /&gt;
Two placeholders are used throughout this document. /dev/sdX refers to the device itself—substitute your actual device identifier everywhere it appears. /dev/sdXN refers to the persistence partition—N is the partition number you’ll confirm from lsblk output after you&#039;ve created it.&lt;br /&gt;
&lt;br /&gt;
Use the device path, not a partition path: /dev/sdb is correct; /dev/sdb1 is not.&lt;br /&gt;
&lt;br /&gt;
== Boot Entry Selection ==&lt;br /&gt;
The firmware boot menu on many systems presents two entries for a USB device: one labeled with the device name alone, and one prefixed with UEFI:. On the hardware used for this document, selecting the UEFI:-prefixed entry after adding a persistence partition consistently produced a bare grub&amp;gt; prompt rather than the Debian live menu. Selecting the plain device entry booted correctly every time.&lt;br /&gt;
&lt;br /&gt;
Throughout this procedure, select the plain device entry—not the one prefixed with UEFI:.&lt;br /&gt;
&lt;br /&gt;
This behavior was observed on specific hardware. Whether it reproduces on all firmware is not established here. The mechanism and a possible explanation are in §5.3. If your firmware presents only a UEFI boot path, recovery from within a booted live session may be possible by correcting the GRUB prefix, but that procedure is outside the scope of this document.&lt;br /&gt;
&lt;br /&gt;
= Procedure =&lt;br /&gt;
&lt;br /&gt;
=== Clean the Drive ===&lt;br /&gt;
If the USB has been used before, residual partition signatures or bootloader data in the early sectors can interfere with the ISO write or the subsequent boot. Clear them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
wipefs removes filesystem and partition table signatures. The dd command zeros the first 200 MB, covering the MBR, GPT header, and any EFI data in the early sectors.&lt;br /&gt;
&lt;br /&gt;
=== Write the ISO ===&lt;br /&gt;
Before running dd, confirm that sync resolves to the system binary and not a shell alias:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should be sync is /usr/bin/sync. If it returns an alias definition instead, unalias it with unalias sync, or substitute /usr/bin/sync explicitly at the end of the dd command.&lt;br /&gt;
&lt;br /&gt;
Write the ISO:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
status=progress shows the running transfer rate. sync flushes the write cache on completion—don’t remove the drive before it returns. The write will take a few minutes depending on the drive’s speed.&lt;br /&gt;
&lt;br /&gt;
=== Verify the Base Boot ===&lt;br /&gt;
Before adding the persistence partition, confirm the ISO write produced a bootable drive. Boot from the USB, selecting the plain (non-UEFI:) device entry. If it reaches the Debian live menu and boots cleanly, you have a confirmed working baseline. If it doesn’t boot at this stage, don’t continue—repeat §4.1&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. The persistence partition goes there. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table that supports both BIOS and UEFI boot paths. Adding a partition requires an explicit start sector; without it, fdisk’s default placement can conflict with the hybrid structure in ways that affect the boot. The failure modes of parted and gdisk with this layout are documented in §4.9&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Print the current partition table:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two partitions will be present: the main ISO partition (type 0 or Empty—this is expected for an isohybrid layout) and a small EFI partition of approximately 3.2 MB. The p output shows the end sector of the last partition in the End column. The persistence partition must start at the next sector—that value plus one. On the test hardware with a Debian 13.4 live ISO written to the drive, the last partition ended at sector 8175999 and the persistence partition started at sector 8176000. This figure will vary with the ISO version and release; read your own p output and don’t use the test value without verifying it matches.&lt;br /&gt;
&lt;br /&gt;
Create the new partition:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When fdisk prompts for the first sector, enter the start sector you identified from the p output—do not accept the default. Accept the default for the last sector to use the remaining space on the drive.&lt;br /&gt;
&lt;br /&gt;
If fdisk asks whether to remove an existing ext4 signature, answer &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;. This clears a remnant from a previous attempt.&lt;br /&gt;
&lt;br /&gt;
Write the changes and exit:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After fdisk writes the new partition table, the running kernel may not immediately recognize the change. partprobe signals the kernel to re-read the partition table on the device without requiring a reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it completes, confirm the new partition is visible:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your new partition will appear beneath the device in the output. Note its full identifier—for example, sdb3 or sdc4—as you’ll need it in the next two steps. If it doesn’t appear immediately, wait a moment and run lsblk again before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Format the Partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence. The Debian live system identifies the persistence partition by this label at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Configuration ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdXN /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The / union directive instructs the live system to mount the entire filesystem as a union overlay. Changes made during a session are written to the persistence partition rather than discarded on shutdown.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with Persistence ==&lt;br /&gt;
Boot from the USB, selecting the plain (non-UEFI:) device entry in the firmware boot menu. At the Debian live GRUB menu, press Tab to edit the selected boot entry. On the line beginning with linux, append persistence after boot=live components. Press Enter to boot.&lt;br /&gt;
&lt;br /&gt;
The first boot with persistence active will be slower than a standard live session—the system is running entirely from the USB drive, and the persistence overlay adds a layer of I/O. This is normal.&lt;br /&gt;
&lt;br /&gt;
== Verify Persistence ==&lt;br /&gt;
After booting, confirm the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should show sdXN mounted at /run/live/persistence/sdXN.&lt;br /&gt;
&lt;br /&gt;
Create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot with persistence enabled. If the file is present after reboot, persistence is working.&lt;br /&gt;
&lt;br /&gt;
== What Didn’t Work, and Why ==&lt;br /&gt;
&lt;br /&gt;
=== parted ===&lt;br /&gt;
parted misreported the capacity of the test USB drive: a 32 GB device was reported as approximately 125 GB. Determining where the free space began or how large to make the persistence partition was not possible from that output. parted was not used further. The broader behavior—libparted-based tools handling the isohybrid format unreliably—is documented on the Debian User mailing list [9].&lt;br /&gt;
&lt;br /&gt;
=== gdisk / sgdisk ===&lt;br /&gt;
gdisk and sgdisk are GPT-aware tools and would seem the logical choice for a drive with a hybrid partition table. On the test USB, sgdisk produced:&amp;lt;blockquote&amp;gt;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&lt;br /&gt;
&lt;br /&gt;
Warning! Secondary partition table overlaps the last partition by 33 blocks!&lt;br /&gt;
&lt;br /&gt;
Could not create partition 3 from 14580 to 8177663&lt;br /&gt;
&lt;br /&gt;
Non-GPT disk; not saving changes. Use -g to override.&lt;br /&gt;
&lt;br /&gt;
Error encountered; not saving changes.&amp;lt;/blockquote&amp;gt;The isohybrid layout places the secondary GPT header in a location that overlaps the last partition. sgdisk identifies this as invalid and refuses to proceed. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk can’t be used here.&lt;br /&gt;
&lt;br /&gt;
cp was also tested as an alternative to dd for writing the ISO, on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout. It’s not an alternative—it’s a slower write with the same result.&lt;br /&gt;
&lt;br /&gt;
== The UEFI grub&amp;gt; Prompt ==&lt;br /&gt;
On the test hardware, adding a persistence partition and then selecting the UEFI:-prefixed boot entry consistently dropped to a bare grub&amp;gt; prompt. Running ls from that prompt showed the internal drive’s partitions; the USB’s live partition was unreachable from there.&lt;br /&gt;
&lt;br /&gt;
What was observed: the USB’s own GRUB appeared briefly—visible as a rapid flash on screen with a “no such…” error—then failed, after which the firmware handed control to the internal drive’s GRUB, which presented its own grub&amp;gt; prompt.&lt;br /&gt;
&lt;br /&gt;
The UEFI specification states that firmware may remove boot options it considers invalid [7]; the ArchWiki documents firmware removing entries for drives it detects as changed as a known occurrence [8]. After adding the persistence partition, the USB’s EFI entry—pointing to EFI/boot/bootx64.efi—may no longer have been treated as valid by the firmware, causing it to fall through to the next available bootloader on the internal drive. Whether modifying the partition table on a removable device is sufficient to trigger this behavior, and under what firmware conditions, wasn’t reproducible in a controlled way during testing.&lt;br /&gt;
&lt;br /&gt;
Selecting the plain (non-UEFI:) device entry uses the legacy MBR boot path, which loads the USB’s own GRUB directly and has no dependency on the UEFI NVRAM or EFI boot entries. On the test hardware, this path was unaffected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
== Anonymity ==&lt;br /&gt;
A Debian Live USB with persistence, used correctly, writes nothing to the host machine’s internal disk. It doesn’t modify the installed OS, create logs on the host filesystem, or leave traces in the usual locations.&lt;br /&gt;
&lt;br /&gt;
It doesn’t provide anonymity. Boot events may be logged by firmware or enterprise management systems. Network activity is visible to routers, ISPs, and network administrators regardless of which OS is running. Mounting the internal disk during a live session makes its contents accessible to the live environment, and any writes to it are permanent. A live USB is a portable, self-contained Debian environment—it isn’t a privacy tool by design.&lt;br /&gt;
&lt;br /&gt;
== A Note on Carrying Data ==&lt;br /&gt;
The persistence partition is a practical place to keep working data alongside the system state—documents, scripts, configuration files, anything you’d normally keep in ~/Documents or ~/bin. It travels with the drive.&lt;br /&gt;
&lt;br /&gt;
Installed packages persist across sessions but may have hardware-specific dependencies. For general desktop use this isn’t usually an issue, but it’s worth keeping in mind if you’re installing drivers or kernel modules that assume specific hardware.&lt;br /&gt;
&lt;br /&gt;
== Citations ==&lt;br /&gt;
Syslinux Project. “Isohybrid.” Syslinux Wiki. &amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://wiki.syslinux.org/wiki/index.php?title=Isohybrid&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2] Linux Command Library. “isohybrid(1) man page.” https://linuxcommandlibrary.com/man/isohybrid&lt;br /&gt;
&lt;br /&gt;
[3] Smith, Roderick W. “Hybrid MBRs.” GPT fdisk documentation. https://www.rodsbooks.com/gdisk/hybrid.html&lt;br /&gt;
&lt;br /&gt;
[4] Debian Manpages. “persistence.conf(5).” live-boot-doc, Trixie. https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&lt;br /&gt;
&lt;br /&gt;
[5] Debian Live Team. “Customizing Run-Time Behaviours.” Debian Live Manual. https://live-team.pages.debian.net/live-manual/html/live-manual/customizing-run-time-behaviours.en.html&lt;br /&gt;
&lt;br /&gt;
[6] Debian Manpages. “live-boot(7).” live-boot-doc. https://manpages.debian.org/unstable/live-boot-doc/live-boot.7.en.html&lt;br /&gt;
&lt;br /&gt;
[7] UEFI Forum. “Boot Manager.” UEFI Specification 2.10, §3. https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&lt;br /&gt;
&lt;br /&gt;
[8] ArchWiki. “Unified Extensible Firmware Interface.” https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface&lt;br /&gt;
&lt;br /&gt;
[9] Debian User Mailing List. “Error message from GParted, means what?” November 2016. https://lists.debian.org/debian-user/2016/11/msg01017.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Contributed by [https://forums.debian.net/search.php?keywords=distro-nix distro-nix] on Debian User Forums on 2026-04-06.&#039;&#039; Comments, corrections, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=231</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=231"/>
		<updated>2026-04-10T02:17:39Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: Replaced References heading with Citations&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created: 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Updated: 2026-04-09 - added references and restructured heading order;&lt;br /&gt;
&lt;br /&gt;
ID: 005146.11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A Debian Live USB with persistence boots a full Debian environment from a USB drive while retaining changes across sessions. Files you create, settings you change, and packages you install survive reboot—stored on a dedicated partition rather than the volatile live environment. Nothing is written to the host machine’s internal disk.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A standard live USB is stateless: each boot starts from the same ISO image. The persistence partition changes that. From a single drive you get your shell configuration, documents, utilities, browser profile, and scripts, available on any machine you boot it from.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== What You’ll Need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum is 4 GB, but that leaves little room for persistence. A 32 GB drive is a practical working size. Download the Debian Live ISO from the official Debian website: &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tools required—dd, fdisk, and mkfs.ext4—are standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Install them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These packages are available from the live session’s apt cache without adding sources. They don’t persist to the USB unless persistence is already active.&lt;br /&gt;
&lt;br /&gt;
== Identifying Your USB Device ==&lt;br /&gt;
Plug in the USB drive and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your USB device will appear as /dev/sdb, /dev/sdc, or similar, depending on what else is attached. Confirm it by cross-referencing the reported size with the known capacity of the drive.&lt;br /&gt;
&lt;br /&gt;
Two placeholders are used throughout this document. /dev/sdX refers to the device itself—substitute your actual device identifier everywhere it appears. /dev/sdXN refers to the persistence partition—N is the partition number you’ll confirm from lsblk output after you&#039;ve created it.&lt;br /&gt;
&lt;br /&gt;
Use the device path, not a partition path: /dev/sdb is correct; /dev/sdb1 is not.&lt;br /&gt;
&lt;br /&gt;
== Boot Entry Selection ==&lt;br /&gt;
The firmware boot menu on many systems presents two entries for a USB device: one labeled with the device name alone, and one prefixed with UEFI:. On the hardware used for this document, selecting the UEFI:-prefixed entry after adding a persistence partition consistently produced a bare grub&amp;gt; prompt rather than the Debian live menu. Selecting the plain device entry booted correctly every time.&lt;br /&gt;
&lt;br /&gt;
Throughout this procedure, select the plain device entry—not the one prefixed with UEFI:.&lt;br /&gt;
&lt;br /&gt;
This behavior was observed on specific hardware. Whether it reproduces on all firmware is not established here. The mechanism and a possible explanation are in §5.3. If your firmware presents only a UEFI boot path, recovery from within a booted live session may be possible by correcting the GRUB prefix, but that procedure is outside the scope of this document.&lt;br /&gt;
&lt;br /&gt;
= Procedure =&lt;br /&gt;
&lt;br /&gt;
=== Clean the Drive ===&lt;br /&gt;
If the USB has been used before, residual partition signatures or bootloader data in the early sectors can interfere with the ISO write or the subsequent boot. Clear them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
wipefs removes filesystem and partition table signatures. The dd command zeros the first 200 MB, covering the MBR, GPT header, and any EFI data in the early sectors.&lt;br /&gt;
&lt;br /&gt;
=== Write the ISO ===&lt;br /&gt;
Before running dd, confirm that sync resolves to the system binary and not a shell alias:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should be sync is /usr/bin/sync. If it returns an alias definition instead, unalias it with unalias sync, or substitute /usr/bin/sync explicitly at the end of the dd command.&lt;br /&gt;
&lt;br /&gt;
Write the ISO:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
status=progress shows the running transfer rate. sync flushes the write cache on completion—don’t remove the drive before it returns. The write will take a few minutes depending on the drive’s speed.&lt;br /&gt;
&lt;br /&gt;
=== Verify the Base Boot ===&lt;br /&gt;
Before adding the persistence partition, confirm the ISO write produced a bootable drive. Boot from the USB, selecting the plain (non-UEFI:) device entry. If it reaches the Debian live menu and boots cleanly, you have a confirmed working baseline. If it doesn’t boot at this stage, don’t continue—repeat §4.1&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. The persistence partition goes there. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table that supports both BIOS and UEFI boot paths. Adding a partition requires an explicit start sector; without it, fdisk’s default placement can conflict with the hybrid structure in ways that affect the boot. The failure modes of parted and gdisk with this layout are documented in §4.9&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Print the current partition table:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two partitions will be present: the main ISO partition (type 0 or Empty—this is expected for an isohybrid layout) and a small EFI partition of approximately 3.2 MB. The p output shows the end sector of the last partition in the End column. The persistence partition must start at the next sector—that value plus one. On the test hardware with a Debian 13.4 live ISO written to the drive, the last partition ended at sector 8175999 and the persistence partition started at sector 8176000. This figure will vary with the ISO version and release; read your own p output and don’t use the test value without verifying it matches.&lt;br /&gt;
&lt;br /&gt;
Create the new partition:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When fdisk prompts for the first sector, enter the start sector you identified from the p output—do not accept the default. Accept the default for the last sector to use the remaining space on the drive.&lt;br /&gt;
&lt;br /&gt;
If fdisk asks whether to remove an existing ext4 signature, answer &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;. This clears a remnant from a previous attempt.&lt;br /&gt;
&lt;br /&gt;
Write the changes and exit:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After fdisk writes the new partition table, the running kernel may not immediately recognize the change. partprobe signals the kernel to re-read the partition table on the device without requiring a reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it completes, confirm the new partition is visible:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your new partition will appear beneath the device in the output. Note its full identifier—for example, sdb3 or sdc4—as you’ll need it in the next two steps. If it doesn’t appear immediately, wait a moment and run lsblk again before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Format the Partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence. The Debian live system identifies the persistence partition by this label at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Configuration ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdXN /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The / union directive instructs the live system to mount the entire filesystem as a union overlay. Changes made during a session are written to the persistence partition rather than discarded on shutdown.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with Persistence ==&lt;br /&gt;
Boot from the USB, selecting the plain (non-UEFI:) device entry in the firmware boot menu. At the Debian live GRUB menu, press Tab to edit the selected boot entry. On the line beginning with linux, append persistence after boot=live components. Press Enter to boot.&lt;br /&gt;
&lt;br /&gt;
The first boot with persistence active will be slower than a standard live session—the system is running entirely from the USB drive, and the persistence overlay adds a layer of I/O. This is normal.&lt;br /&gt;
&lt;br /&gt;
== Verify Persistence ==&lt;br /&gt;
After booting, confirm the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should show sdXN mounted at /run/live/persistence/sdXN.&lt;br /&gt;
&lt;br /&gt;
Create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot with persistence enabled. If the file is present after reboot, persistence is working.&lt;br /&gt;
&lt;br /&gt;
== What Didn’t Work, and Why ==&lt;br /&gt;
&lt;br /&gt;
=== parted ===&lt;br /&gt;
parted misreported the capacity of the test USB drive: a 32 GB device was reported as approximately 125 GB. Determining where the free space began or how large to make the persistence partition was not possible from that output. parted was not used further. The broader behavior—libparted-based tools handling the isohybrid format unreliably—is documented on the Debian User mailing list [9].&lt;br /&gt;
&lt;br /&gt;
=== gdisk / sgdisk ===&lt;br /&gt;
gdisk and sgdisk are GPT-aware tools and would seem the logical choice for a drive with a hybrid partition table. On the test USB, sgdisk produced:&amp;lt;blockquote&amp;gt;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&lt;br /&gt;
&lt;br /&gt;
Warning! Secondary partition table overlaps the last partition by 33 blocks!&lt;br /&gt;
&lt;br /&gt;
Could not create partition 3 from 14580 to 8177663&lt;br /&gt;
&lt;br /&gt;
Non-GPT disk; not saving changes. Use -g to override.&lt;br /&gt;
&lt;br /&gt;
Error encountered; not saving changes.&amp;lt;/blockquote&amp;gt;The isohybrid layout places the secondary GPT header in a location that overlaps the last partition. sgdisk identifies this as invalid and refuses to proceed. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk can’t be used here.&lt;br /&gt;
&lt;br /&gt;
cp was also tested as an alternative to dd for writing the ISO, on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout. It’s not an alternative—it’s a slower write with the same result.&lt;br /&gt;
&lt;br /&gt;
== The UEFI grub&amp;gt; Prompt ==&lt;br /&gt;
On the test hardware, adding a persistence partition and then selecting the UEFI:-prefixed boot entry consistently dropped to a bare grub&amp;gt; prompt. Running ls from that prompt showed the internal drive’s partitions; the USB’s live partition was unreachable from there.&lt;br /&gt;
&lt;br /&gt;
What was observed: the USB’s own GRUB appeared briefly—visible as a rapid flash on screen with a “no such…” error—then failed, after which the firmware handed control to the internal drive’s GRUB, which presented its own grub&amp;gt; prompt.&lt;br /&gt;
&lt;br /&gt;
The UEFI specification states that firmware may remove boot options it considers invalid [7]; the ArchWiki documents firmware removing entries for drives it detects as changed as a known occurrence [8]. After adding the persistence partition, the USB’s EFI entry—pointing to EFI/boot/bootx64.efi—may no longer have been treated as valid by the firmware, causing it to fall through to the next available bootloader on the internal drive. Whether modifying the partition table on a removable device is sufficient to trigger this behavior, and under what firmware conditions, wasn’t reproducible in a controlled way during testing.&lt;br /&gt;
&lt;br /&gt;
Selecting the plain (non-UEFI:) device entry uses the legacy MBR boot path, which loads the USB’s own GRUB directly and has no dependency on the UEFI NVRAM or EFI boot entries. On the test hardware, this path was unaffected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
== Anonymity ==&lt;br /&gt;
A Debian Live USB with persistence, used correctly, writes nothing to the host machine’s internal disk. It doesn’t modify the installed OS, create logs on the host filesystem, or leave traces in the usual locations.&lt;br /&gt;
&lt;br /&gt;
It doesn’t provide anonymity. Boot events may be logged by firmware or enterprise management systems. Network activity is visible to routers, ISPs, and network administrators regardless of which OS is running. Mounting the internal disk during a live session makes its contents accessible to the live environment, and any writes to it are permanent. A live USB is a portable, self-contained Debian environment—it isn’t a privacy tool by design.&lt;br /&gt;
&lt;br /&gt;
== A Note on Carrying Data ==&lt;br /&gt;
The persistence partition is a practical place to keep working data alongside the system state—documents, scripts, configuration files, anything you’d normally keep in ~/Documents or ~/bin. It travels with the drive.&lt;br /&gt;
&lt;br /&gt;
Installed packages persist across sessions but may have hardware-specific dependencies. For general desktop use this isn’t usually an issue, but it’s worth keeping in mind if you’re installing drivers or kernel modules that assume specific hardware.&lt;br /&gt;
&lt;br /&gt;
== Citations ==&lt;br /&gt;
[1] Syslinux Project. “Isohybrid.” Syslinux Wiki. https://wiki.syslinux.org/wiki/index.php?title=Isohybrid&lt;br /&gt;
&lt;br /&gt;
[2] Linux Command Library. “isohybrid(1) man page.” https://linuxcommandlibrary.com/man/isohybrid&lt;br /&gt;
&lt;br /&gt;
[3] Smith, Roderick W. “Hybrid MBRs.” GPT fdisk documentation. https://www.rodsbooks.com/gdisk/hybrid.html&lt;br /&gt;
&lt;br /&gt;
[4] Debian Manpages. “persistence.conf(5).” live-boot-doc, Trixie. https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&lt;br /&gt;
&lt;br /&gt;
[5] Debian Live Team. “Customizing Run-Time Behaviours.” Debian Live Manual. https://live-team.pages.debian.net/live-manual/html/live-manual/customizing-run-time-behaviours.en.html&lt;br /&gt;
&lt;br /&gt;
[6] Debian Manpages. “live-boot(7).” live-boot-doc. https://manpages.debian.org/unstable/live-boot-doc/live-boot.7.en.html&lt;br /&gt;
&lt;br /&gt;
[7] UEFI Forum. “Boot Manager.” UEFI Specification 2.10, §3. https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&lt;br /&gt;
&lt;br /&gt;
[8] ArchWiki. “Unified Extensible Firmware Interface.” https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface&lt;br /&gt;
&lt;br /&gt;
[9] Debian User Mailing List. “Error message from GParted, means what?” November 2016. https://lists.debian.org/debian-user/2016/11/msg01017.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Contributed by [https://forums.debian.net/search.php?keywords=distro-nix distro-nix] on Debian User Forums on 2026-04-06.&#039;&#039; Comments, corrections, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=230</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=230"/>
		<updated>2026-04-10T01:18:12Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: references checked&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created: 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Updated: 2026-04-09 - added references and restructured heading order;&lt;br /&gt;
&lt;br /&gt;
ID: 005146.11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A Debian Live USB with persistence boots a full Debian environment from a USB drive while retaining changes across sessions. Files you create, settings you change, and packages you install survive reboot—stored on a dedicated partition rather than the volatile live environment. Nothing is written to the host machine’s internal disk.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A standard live USB is stateless: each boot starts from the same ISO image. The persistence partition changes that. From a single drive you get your shell configuration, documents, utilities, browser profile, and scripts, available on any machine you boot it from.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== What You’ll Need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum is 4 GB, but that leaves little room for persistence. A 32 GB drive is a practical working size. Download the Debian Live ISO from the official Debian website: &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tools required—dd, fdisk, and mkfs.ext4—are standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Install them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These packages are available from the live session’s apt cache without adding sources. They don’t persist to the USB unless persistence is already active.&lt;br /&gt;
&lt;br /&gt;
== Identifying Your USB Device ==&lt;br /&gt;
Plug in the USB drive and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your USB device will appear as /dev/sdb, /dev/sdc, or similar, depending on what else is attached. Confirm it by cross-referencing the reported size with the known capacity of the drive.&lt;br /&gt;
&lt;br /&gt;
Two placeholders are used throughout this document. /dev/sdX refers to the device itself—substitute your actual device identifier everywhere it appears. /dev/sdXN refers to the persistence partition—N is the partition number you’ll confirm from lsblk output after you&#039;ve created it.&lt;br /&gt;
&lt;br /&gt;
Use the device path, not a partition path: /dev/sdb is correct; /dev/sdb1 is not.&lt;br /&gt;
&lt;br /&gt;
== Boot Entry Selection ==&lt;br /&gt;
The firmware boot menu on many systems presents two entries for a USB device: one labeled with the device name alone, and one prefixed with UEFI:. On the hardware used for this document, selecting the UEFI:-prefixed entry after adding a persistence partition consistently produced a bare grub&amp;gt; prompt rather than the Debian live menu. Selecting the plain device entry booted correctly every time.&lt;br /&gt;
&lt;br /&gt;
Throughout this procedure, select the plain device entry—not the one prefixed with UEFI:.&lt;br /&gt;
&lt;br /&gt;
This behavior was observed on specific hardware. Whether it reproduces on all firmware is not established here. The mechanism and a possible explanation are in §5.3. If your firmware presents only a UEFI boot path, recovery from within a booted live session may be possible by correcting the GRUB prefix, but that procedure is outside the scope of this document.&lt;br /&gt;
&lt;br /&gt;
= Procedure =&lt;br /&gt;
&lt;br /&gt;
=== Clean the Drive ===&lt;br /&gt;
If the USB has been used before, residual partition signatures or bootloader data in the early sectors can interfere with the ISO write or the subsequent boot. Clear them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
wipefs removes filesystem and partition table signatures. The dd command zeros the first 200 MB, covering the MBR, GPT header, and any EFI data in the early sectors.&lt;br /&gt;
&lt;br /&gt;
=== Write the ISO ===&lt;br /&gt;
Before running dd, confirm that sync resolves to the system binary and not a shell alias:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should be sync is /usr/bin/sync. If it returns an alias definition instead, unalias it with unalias sync, or substitute /usr/bin/sync explicitly at the end of the dd command.&lt;br /&gt;
&lt;br /&gt;
Write the ISO:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
status=progress shows the running transfer rate. sync flushes the write cache on completion—don’t remove the drive before it returns. The write will take a few minutes depending on the drive’s speed.&lt;br /&gt;
&lt;br /&gt;
=== Verify the Base Boot ===&lt;br /&gt;
Before adding the persistence partition, confirm the ISO write produced a bootable drive. Boot from the USB, selecting the plain (non-UEFI:) device entry. If it reaches the Debian live menu and boots cleanly, you have a confirmed working baseline. If it doesn’t boot at this stage, don’t continue—repeat §4.1&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. The persistence partition goes there. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table that supports both BIOS and UEFI boot paths. Adding a partition requires an explicit start sector; without it, fdisk’s default placement can conflict with the hybrid structure in ways that affect the boot. The failure modes of parted and gdisk with this layout are documented in §4.9&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Print the current partition table:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two partitions will be present: the main ISO partition (type 0 or Empty—this is expected for an isohybrid layout) and a small EFI partition of approximately 3.2 MB. The p output shows the end sector of the last partition in the End column. The persistence partition must start at the next sector—that value plus one. On the test hardware with a Debian 13.4 live ISO written to the drive, the last partition ended at sector 8175999 and the persistence partition started at sector 8176000. This figure will vary with the ISO version and release; read your own p output and don’t use the test value without verifying it matches.&lt;br /&gt;
&lt;br /&gt;
Create the new partition:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When fdisk prompts for the first sector, enter the start sector you identified from the p output—do not accept the default. Accept the default for the last sector to use the remaining space on the drive.&lt;br /&gt;
&lt;br /&gt;
If fdisk asks whether to remove an existing ext4 signature, answer &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;. This clears a remnant from a previous attempt.&lt;br /&gt;
&lt;br /&gt;
Write the changes and exit:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After fdisk writes the new partition table, the running kernel may not immediately recognize the change. partprobe signals the kernel to re-read the partition table on the device without requiring a reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it completes, confirm the new partition is visible:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your new partition will appear beneath the device in the output. Note its full identifier—for example, sdb3 or sdc4—as you’ll need it in the next two steps. If it doesn’t appear immediately, wait a moment and run lsblk again before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Format the Partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence. The Debian live system identifies the persistence partition by this label at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Configuration ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdXN /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The / union directive instructs the live system to mount the entire filesystem as a union overlay. Changes made during a session are written to the persistence partition rather than discarded on shutdown.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with Persistence ==&lt;br /&gt;
Boot from the USB, selecting the plain (non-UEFI:) device entry in the firmware boot menu. At the Debian live GRUB menu, press Tab to edit the selected boot entry. On the line beginning with linux, append persistence after boot=live components. Press Enter to boot.&lt;br /&gt;
&lt;br /&gt;
The first boot with persistence active will be slower than a standard live session—the system is running entirely from the USB drive, and the persistence overlay adds a layer of I/O. This is normal.&lt;br /&gt;
&lt;br /&gt;
== Verify Persistence ==&lt;br /&gt;
After booting, confirm the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should show sdXN mounted at /run/live/persistence/sdXN.&lt;br /&gt;
&lt;br /&gt;
Create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot with persistence enabled. If the file is present after reboot, persistence is working.&lt;br /&gt;
&lt;br /&gt;
== What Didn’t Work, and Why ==&lt;br /&gt;
&lt;br /&gt;
=== parted ===&lt;br /&gt;
parted misreported the capacity of the test USB drive: a 32 GB device was reported as approximately 125 GB. Determining where the free space began or how large to make the persistence partition was not possible from that output. parted was not used further. The broader behavior—libparted-based tools handling the isohybrid format unreliably—is documented on the Debian User mailing list [9].&lt;br /&gt;
&lt;br /&gt;
=== gdisk / sgdisk ===&lt;br /&gt;
gdisk and sgdisk are GPT-aware tools and would seem the logical choice for a drive with a hybrid partition table. On the test USB, sgdisk produced:&amp;lt;blockquote&amp;gt;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&lt;br /&gt;
&lt;br /&gt;
Warning! Secondary partition table overlaps the last partition by 33 blocks!&lt;br /&gt;
&lt;br /&gt;
Could not create partition 3 from 14580 to 8177663&lt;br /&gt;
&lt;br /&gt;
Non-GPT disk; not saving changes. Use -g to override.&lt;br /&gt;
&lt;br /&gt;
Error encountered; not saving changes.&amp;lt;/blockquote&amp;gt;The isohybrid layout places the secondary GPT header in a location that overlaps the last partition. sgdisk identifies this as invalid and refuses to proceed. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk can’t be used here.&lt;br /&gt;
&lt;br /&gt;
cp was also tested as an alternative to dd for writing the ISO, on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout. It’s not an alternative—it’s a slower write with the same result.&lt;br /&gt;
&lt;br /&gt;
== The UEFI grub&amp;gt; Prompt ==&lt;br /&gt;
On the test hardware, adding a persistence partition and then selecting the UEFI:-prefixed boot entry consistently dropped to a bare grub&amp;gt; prompt. Running ls from that prompt showed the internal drive’s partitions; the USB’s live partition was unreachable from there.&lt;br /&gt;
&lt;br /&gt;
What was observed: the USB’s own GRUB appeared briefly—visible as a rapid flash on screen with a “no such…” error—then failed, after which the firmware handed control to the internal drive’s GRUB, which presented its own grub&amp;gt; prompt.&lt;br /&gt;
&lt;br /&gt;
The UEFI specification states that firmware may remove boot options it considers invalid [7]; the ArchWiki documents firmware removing entries for drives it detects as changed as a known occurrence [8]. After adding the persistence partition, the USB’s EFI entry—pointing to EFI/boot/bootx64.efi—may no longer have been treated as valid by the firmware, causing it to fall through to the next available bootloader on the internal drive. Whether modifying the partition table on a removable device is sufficient to trigger this behavior, and under what firmware conditions, wasn’t reproducible in a controlled way during testing.&lt;br /&gt;
&lt;br /&gt;
Selecting the plain (non-UEFI:) device entry uses the legacy MBR boot path, which loads the USB’s own GRUB directly and has no dependency on the UEFI NVRAM or EFI boot entries. On the test hardware, this path was unaffected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
== Anonymity ==&lt;br /&gt;
A Debian Live USB with persistence, used correctly, writes nothing to the host machine’s internal disk. It doesn’t modify the installed OS, create logs on the host filesystem, or leave traces in the usual locations.&lt;br /&gt;
&lt;br /&gt;
It doesn’t provide anonymity. Boot events may be logged by firmware or enterprise management systems. Network activity is visible to routers, ISPs, and network administrators regardless of which OS is running. Mounting the internal disk during a live session makes its contents accessible to the live environment, and any writes to it are permanent. A live USB is a portable, self-contained Debian environment—it isn’t a privacy tool by design.&lt;br /&gt;
&lt;br /&gt;
== A Note on Carrying Data ==&lt;br /&gt;
The persistence partition is a practical place to keep working data alongside the system state—documents, scripts, configuration files, anything you’d normally keep in ~/Documents or ~/bin. It travels with the drive.&lt;br /&gt;
&lt;br /&gt;
Installed packages persist across sessions but may have hardware-specific dependencies. For general desktop use this isn’t usually an issue, but it’s worth keeping in mind if you’re installing drivers or kernel modules that assume specific hardware.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] Syslinux Project. “Isohybrid.” Syslinux Wiki. https://wiki.syslinux.org/wiki/index.php?title=Isohybrid&lt;br /&gt;
&lt;br /&gt;
[2] Linux Command Library. “isohybrid(1) man page.” https://linuxcommandlibrary.com/man/isohybrid&lt;br /&gt;
&lt;br /&gt;
[3] Smith, Roderick W. “Hybrid MBRs.” GPT fdisk documentation. https://www.rodsbooks.com/gdisk/hybrid.html&lt;br /&gt;
&lt;br /&gt;
[4] Debian Manpages. “persistence.conf(5).” live-boot-doc, Trixie. https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&lt;br /&gt;
&lt;br /&gt;
[5] Debian Live Team. “Customizing Run-Time Behaviours.” Debian Live Manual. https://live-team.pages.debian.net/live-manual/html/live-manual/customizing-run-time-behaviours.en.html&lt;br /&gt;
&lt;br /&gt;
[6] Debian Manpages. “live-boot(7).” live-boot-doc. https://manpages.debian.org/unstable/live-boot-doc/live-boot.7.en.html&lt;br /&gt;
&lt;br /&gt;
[7] UEFI Forum. “Boot Manager.” UEFI Specification 2.10, §3. https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&lt;br /&gt;
&lt;br /&gt;
[8] ArchWiki. “Unified Extensible Firmware Interface.” https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface&lt;br /&gt;
&lt;br /&gt;
[9] Debian User Mailing List. “Error message from GParted, means what?” November 2016. https://lists.debian.org/debian-user/2016/11/msg01017.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Contributed by [https://forums.debian.net/search.php?keywords=distro-nix distro-nix] on Debian User Forums on 2026-04-06.&#039;&#039; Comments, corrections, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=229</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=229"/>
		<updated>2026-04-09T21:46:52Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: hyperlinks&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created: 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Updated: 2026-04-09 - added references and restructured heading order;&lt;br /&gt;
&lt;br /&gt;
ID: 005146.11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A Debian Live USB with persistence boots a full Debian environment from a USB drive while retaining changes across sessions. Files you create, settings you change, and packages you install survive reboot—stored on a dedicated partition rather than the volatile live environment. Nothing is written to the host machine’s internal disk.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A standard live USB is stateless: each boot starts from the same ISO image. The persistence partition changes that. From a single drive you get your shell configuration, documents, utilities, browser profile, and scripts, available on any machine you boot it from.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== What You’ll Need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum is 4 GB, but that leaves little room for persistence. A 32 GB drive is a practical working size. Download the Debian Live ISO from the official Debian website: &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tools required—dd, fdisk, and mkfs.ext4—are standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Install them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These packages are available from the live session’s apt cache without adding sources. They don’t persist to the USB unless persistence is already active.&lt;br /&gt;
&lt;br /&gt;
== Identifying Your USB Device ==&lt;br /&gt;
Plug in the USB drive and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your USB device will appear as /dev/sdb, /dev/sdc, or similar, depending on what else is attached. Confirm it by cross-referencing the reported size with the known capacity of the drive.&lt;br /&gt;
&lt;br /&gt;
Two placeholders are used throughout this document. /dev/sdX refers to the device itself—substitute your actual device identifier everywhere it appears. /dev/sdXN refers to the persistence partition—N is the partition number you’ll confirm from lsblk output after creating it in §4.&lt;br /&gt;
&lt;br /&gt;
Use the device path, not a partition path: /dev/sdb is correct; /dev/sdb1 is not.&lt;br /&gt;
&lt;br /&gt;
== Boot Entry Selection ==&lt;br /&gt;
The firmware boot menu on many systems presents two entries for a USB device: one labeled with the device name alone, and one prefixed with UEFI:. On the hardware used for this document, selecting the UEFI:-prefixed entry after adding a persistence partition consistently produced a bare grub&amp;gt; prompt rather than the Debian live menu. Selecting the plain device entry booted correctly every time.&lt;br /&gt;
&lt;br /&gt;
Throughout this procedure, select the plain device entry—not the one prefixed with UEFI:.&lt;br /&gt;
&lt;br /&gt;
This behavior was observed on specific hardware. Whether it reproduces on all firmware is not established here. The mechanism and a possible explanation are in §5.3. If your firmware presents only a UEFI boot path, recovery from within a booted live session may be possible by correcting the GRUB prefix, but that procedure is outside the scope of this document.&lt;br /&gt;
&lt;br /&gt;
= Procedure =&lt;br /&gt;
&lt;br /&gt;
=== Clean the Drive ===&lt;br /&gt;
If the USB has been used before, residual partition signatures or bootloader data in the early sectors can interfere with the ISO write or the subsequent boot. Clear them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
wipefs removes filesystem and partition table signatures. The dd command zeros the first 200 MB, covering the MBR, GPT header, and any EFI data in the early sectors.&lt;br /&gt;
&lt;br /&gt;
=== Write the ISO ===&lt;br /&gt;
Before running dd, confirm that sync resolves to the system binary and not a shell alias:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should be sync is /usr/bin/sync. If it returns an alias definition instead, unalias it with unalias sync, or substitute /usr/bin/sync explicitly at the end of the dd command.&lt;br /&gt;
&lt;br /&gt;
Write the ISO:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
status=progress shows the running transfer rate. sync flushes the write cache on completion—don’t remove the drive before it returns. The write will take a few minutes depending on the drive’s speed.&lt;br /&gt;
&lt;br /&gt;
=== Verify the Base Boot ===&lt;br /&gt;
Before adding the persistence partition, confirm the ISO write produced a bootable drive. Boot from the USB, selecting the plain (non-UEFI:) device entry. If it reaches the Debian live menu and boots cleanly, you have a confirmed working baseline. If it doesn’t boot at this stage, don’t continue—repeat §4.&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. The persistence partition goes there. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table that supports both BIOS and UEFI boot paths. Adding a partition requires an explicit start sector; without it, fdisk’s default placement can conflict with the hybrid structure in ways that affect the boot. The failure modes of parted and gdisk with this layout are documented in §5.&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Print the current partition table:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two partitions will be present: the main ISO partition (type 0 or Empty—this is expected for an isohybrid layout) and a small EFI partition of approximately 3.2 MB. The p output shows the end sector of the last partition in the End column. The persistence partition must start at the next sector—that value plus one. On the test hardware with a Debian 13.4 live ISO written to the drive, the last partition ended at sector 8175999 and the persistence partition started at sector 8176000. This figure will vary with the ISO version and release; read your own p output and don’t use the test value without verifying it matches.&lt;br /&gt;
&lt;br /&gt;
Create the new partition:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When fdisk prompts for the first sector, enter the start sector you identified from the p output—do not accept the default. Accept the default for the last sector to use the remaining space on the drive.&lt;br /&gt;
&lt;br /&gt;
If fdisk asks whether to remove an existing ext4 signature, answer &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;. This clears a remnant from a previous attempt.&lt;br /&gt;
&lt;br /&gt;
Write the changes and exit:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After fdisk writes the new partition table, the running kernel may not immediately recognize the change. partprobe signals the kernel to re-read the partition table on the device without requiring a reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it completes, confirm the new partition is visible:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your new partition will appear beneath the device in the output. Note its full identifier—for example, sdb3 or sdc4—as you’ll need it in the next two steps. If it doesn’t appear immediately, wait a moment and run lsblk again before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Format the Partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence. The Debian live system identifies the persistence partition by this label at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Configuration ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdXN /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The / union directive instructs the live system to mount the entire filesystem as a union overlay. Changes made during a session are written to the persistence partition rather than discarded on shutdown.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with Persistence ==&lt;br /&gt;
Boot from the USB, selecting the plain (non-UEFI:) device entry in the firmware boot menu. At the Debian live GRUB menu, press Tab to edit the selected boot entry. On the line beginning with linux, append persistence after boot=live components. Press Enter to boot.&lt;br /&gt;
&lt;br /&gt;
The first boot with persistence active will be slower than a standard live session—the system is running entirely from the USB drive, and the persistence overlay adds a layer of I/O. This is normal.&lt;br /&gt;
&lt;br /&gt;
== Verify Persistence ==&lt;br /&gt;
After booting, confirm the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should show sdXN mounted at /run/live/persistence/sdXN.&lt;br /&gt;
&lt;br /&gt;
Create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot with persistence enabled. If the file is present after reboot, persistence is working.&lt;br /&gt;
&lt;br /&gt;
== What Didn’t Work, and Why ==&lt;br /&gt;
&lt;br /&gt;
=== parted ===&lt;br /&gt;
parted misreported the capacity of the test USB drive: a 32 GB device was reported as approximately 125 GB. Determining where the free space began or how large to make the persistence partition was not possible from that output. parted was not used further. The broader behavior—libparted-based tools handling the isohybrid format unreliably—is documented on the Debian User mailing list [9].&lt;br /&gt;
&lt;br /&gt;
=== gdisk / sgdisk ===&lt;br /&gt;
gdisk and sgdisk are GPT-aware tools and would seem the logical choice for a drive with a hybrid partition table. On the test USB, sgdisk produced:&amp;lt;blockquote&amp;gt;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&lt;br /&gt;
&lt;br /&gt;
Warning! Secondary partition table overlaps the last partition by 33 blocks!&lt;br /&gt;
&lt;br /&gt;
Could not create partition 3 from 14580 to 8177663&lt;br /&gt;
&lt;br /&gt;
Non-GPT disk; not saving changes. Use -g to override.&lt;br /&gt;
&lt;br /&gt;
Error encountered; not saving changes.&amp;lt;/blockquote&amp;gt;The isohybrid layout places the secondary GPT header in a location that overlaps the last partition. sgdisk identifies this as invalid and refuses to proceed. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk can’t be used here.&lt;br /&gt;
&lt;br /&gt;
cp was also tested as an alternative to dd for writing the ISO, on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout. It’s not an alternative—it’s a slower write with the same result.&lt;br /&gt;
&lt;br /&gt;
== The UEFI grub&amp;gt; Prompt ==&lt;br /&gt;
On the test hardware, adding a persistence partition and then selecting the UEFI:-prefixed boot entry consistently dropped to a bare grub&amp;gt; prompt. Running ls from that prompt showed the internal drive’s partitions; the USB’s live partition was unreachable from there.&lt;br /&gt;
&lt;br /&gt;
What was observed: the USB’s own GRUB appeared briefly—visible as a rapid flash on screen with a “no such…” error—then failed, after which the firmware handed control to the internal drive’s GRUB, which presented its own grub&amp;gt; prompt.&lt;br /&gt;
&lt;br /&gt;
The UEFI specification states that firmware may remove boot options it considers invalid [7]; the ArchWiki documents firmware removing entries for drives it detects as changed as a known occurrence [8]. After adding the persistence partition, the USB’s EFI entry—pointing to EFI/boot/bootx64.efi—may no longer have been treated as valid by the firmware, causing it to fall through to the next available bootloader on the internal drive. Whether modifying the partition table on a removable device is sufficient to trigger this behavior, and under what firmware conditions, wasn’t reproducible in a controlled way during testing.&lt;br /&gt;
&lt;br /&gt;
Selecting the plain (non-UEFI:) device entry uses the legacy MBR boot path, which loads the USB’s own GRUB directly and has no dependency on the UEFI NVRAM or EFI boot entries. On the test hardware, this path was unaffected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
== Anonymity ==&lt;br /&gt;
A Debian Live USB with persistence, used correctly, writes nothing to the host machine’s internal disk. It doesn’t modify the installed OS, create logs on the host filesystem, or leave traces in the usual locations.&lt;br /&gt;
&lt;br /&gt;
It doesn’t provide anonymity. Boot events may be logged by firmware or enterprise management systems. Network activity is visible to routers, ISPs, and network administrators regardless of which OS is running. Mounting the internal disk during a live session makes its contents accessible to the live environment, and any writes to it are permanent. A live USB is a portable, self-contained Debian environment—it isn’t a privacy tool by design.&lt;br /&gt;
&lt;br /&gt;
== A Note on Carrying Data ==&lt;br /&gt;
The persistence partition is a practical place to keep working data alongside the system state—documents, scripts, configuration files, anything you’d normally keep in ~/Documents or ~/bin. It travels with the drive.&lt;br /&gt;
&lt;br /&gt;
Installed packages persist across sessions but may have hardware-specific dependencies. For general desktop use this isn’t usually an issue, but it’s worth keeping in mind if you’re installing drivers or kernel modules that assume specific hardware.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] Syslinux Project. “Isohybrid.” Syslinux Wiki. https://wiki.syslinux.org/wiki/index.php?title=Isohybrid&lt;br /&gt;
&lt;br /&gt;
[2] Linux Command Library. “isohybrid(1) man page.” https://linuxcommandlibrary.com/man/isohybrid&lt;br /&gt;
&lt;br /&gt;
[3] Smith, Roderick W. “Hybrid MBRs.” GPT fdisk documentation. https://www.rodsbooks.com/gdisk/hybrid.html&lt;br /&gt;
&lt;br /&gt;
[4] Debian Manpages. “persistence.conf(5).” live-boot-doc, Trixie. https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&lt;br /&gt;
&lt;br /&gt;
[5] Debian Live Team. “Customizing Run-Time Behaviours.” Debian Live Manual. https://live-team.pages.debian.net/live-manual/html/live-manual/customizing-run-time-behaviours.en.html&lt;br /&gt;
&lt;br /&gt;
[6] Debian Manpages. “live-boot(7).” live-boot-doc. https://manpages.debian.org/unstable/live-boot-doc/live-boot.7.en.html&lt;br /&gt;
&lt;br /&gt;
[7] UEFI Forum. “Boot Manager.” UEFI Specification 2.10, §3. https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&lt;br /&gt;
&lt;br /&gt;
[8] ArchWiki. “Unified Extensible Firmware Interface.” https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface&lt;br /&gt;
&lt;br /&gt;
[9] Debian User Mailing List. “Error message from GParted, means what?” November 2016. https://lists.debian.org/debian-user/2016/11/msg01017.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Contributed by [https://forums.debian.net/search.php?keywords=distro-nix distro-nix] on Debian User Forums on 2026-04-06.&#039;&#039; Comments, corrections, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=228</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=228"/>
		<updated>2026-04-09T19:20:25Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: minor edits&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created: 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Updated: 2026-04-09 - added references and restructured heading order;&lt;br /&gt;
&lt;br /&gt;
ID: 005146.11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A Debian Live USB with persistence boots a full Debian environment from a USB drive while retaining changes across sessions. Files you create, settings you change, and packages you install survive reboot—stored on a dedicated partition rather than the volatile live environment. Nothing is written to the host machine’s internal disk.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A standard live USB is stateless: each boot starts from the same ISO image. The persistence partition changes that. From a single drive you get your shell configuration, documents, utilities, browser profile, and scripts, available on any machine you boot it from.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== What You’ll Need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum is 4 GB, but that leaves little room for persistence. A 32 GB drive is a practical working size. Download the Debian Live ISO from the official Debian website: &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tools required—dd, fdisk, and mkfs.ext4—are standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Install them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These packages are available from the live session’s apt cache without adding sources. They don’t persist to the USB unless persistence is already active.&lt;br /&gt;
&lt;br /&gt;
== Identifying Your USB Device ==&lt;br /&gt;
Plug in the USB drive and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your USB device will appear as /dev/sdb, /dev/sdc, or similar, depending on what else is attached. Confirm it by cross-referencing the reported size with the known capacity of the drive.&lt;br /&gt;
&lt;br /&gt;
Two placeholders are used throughout this document. /dev/sdX refers to the device itself—substitute your actual device identifier everywhere it appears. /dev/sdXN refers to the persistence partition—N is the partition number you’ll confirm from lsblk output after creating it in §4.&lt;br /&gt;
&lt;br /&gt;
Use the device path, not a partition path: /dev/sdb is correct; /dev/sdb1 is not.&lt;br /&gt;
&lt;br /&gt;
== Boot Entry Selection ==&lt;br /&gt;
The firmware boot menu on many systems presents two entries for a USB device: one labeled with the device name alone, and one prefixed with UEFI:. On the hardware used for this document, selecting the UEFI:-prefixed entry after adding a persistence partition consistently produced a bare grub&amp;gt; prompt rather than the Debian live menu. Selecting the plain device entry booted correctly every time.&lt;br /&gt;
&lt;br /&gt;
Throughout this procedure, select the plain device entry—not the one prefixed with UEFI:.&lt;br /&gt;
&lt;br /&gt;
This behavior was observed on specific hardware. Whether it reproduces on all firmware is not established here. The mechanism and a possible explanation are in §5.3. If your firmware presents only a UEFI boot path, recovery from within a booted live session may be possible by correcting the GRUB prefix, but that procedure is outside the scope of this document.&lt;br /&gt;
&lt;br /&gt;
= Procedure =&lt;br /&gt;
&lt;br /&gt;
=== Clean the Drive ===&lt;br /&gt;
If the USB has been used before, residual partition signatures or bootloader data in the early sectors can interfere with the ISO write or the subsequent boot. Clear them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
wipefs removes filesystem and partition table signatures. The dd command zeros the first 200 MB, covering the MBR, GPT header, and any EFI data in the early sectors.&lt;br /&gt;
&lt;br /&gt;
=== Write the ISO ===&lt;br /&gt;
Before running dd, confirm that sync resolves to the system binary and not a shell alias:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should be sync is /usr/bin/sync. If it returns an alias definition instead, unalias it with unalias sync, or substitute /usr/bin/sync explicitly at the end of the dd command.&lt;br /&gt;
&lt;br /&gt;
Write the ISO:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
status=progress shows the running transfer rate. sync flushes the write cache on completion—don’t remove the drive before it returns. The write will take a few minutes depending on the drive’s speed.&lt;br /&gt;
&lt;br /&gt;
=== Verify the Base Boot ===&lt;br /&gt;
Before adding the persistence partition, confirm the ISO write produced a bootable drive. Boot from the USB, selecting the plain (non-UEFI:) device entry. If it reaches the Debian live menu and boots cleanly, you have a confirmed working baseline. If it doesn’t boot at this stage, don’t continue—repeat §4.&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. The persistence partition goes there. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table that supports both BIOS and UEFI boot paths. Adding a partition requires an explicit start sector; without it, fdisk’s default placement can conflict with the hybrid structure in ways that affect the boot. The failure modes of parted and gdisk with this layout are documented in §5.&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Print the current partition table:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two partitions will be present: the main ISO partition (type 0 or Empty—this is expected for an isohybrid layout) and a small EFI partition of approximately 3.2 MB. The p output shows the end sector of the last partition in the End column. The persistence partition must start at the next sector—that value plus one. On the test hardware with a Debian 13.4 live ISO written to the drive, the last partition ended at sector 8175999 and the persistence partition started at sector 8176000. This figure will vary with the ISO version and release; read your own p output and don’t use the test value without verifying it matches.&lt;br /&gt;
&lt;br /&gt;
Create the new partition:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When fdisk prompts for the first sector, enter the start sector you identified from the p output—do not accept the default. Accept the default for the last sector to use the remaining space on the drive.&lt;br /&gt;
&lt;br /&gt;
If fdisk asks whether to remove an existing ext4 signature, answer &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;. This clears a remnant from a previous attempt.&lt;br /&gt;
&lt;br /&gt;
Write the changes and exit:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After fdisk writes the new partition table, the running kernel may not immediately recognize the change. partprobe signals the kernel to re-read the partition table on the device without requiring a reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it completes, confirm the new partition is visible:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your new partition will appear beneath the device in the output. Note its full identifier—for example, sdb3 or sdc4—as you’ll need it in the next two steps. If it doesn’t appear immediately, wait a moment and run lsblk again before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Format the Partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence. The Debian live system identifies the persistence partition by this label at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Configuration ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdXN /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The / union directive instructs the live system to mount the entire filesystem as a union overlay. Changes made during a session are written to the persistence partition rather than discarded on shutdown.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with Persistence ==&lt;br /&gt;
Boot from the USB, selecting the plain (non-UEFI:) device entry in the firmware boot menu. At the Debian live GRUB menu, press Tab to edit the selected boot entry. On the line beginning with linux, append persistence after boot=live components. Press Enter to boot.&lt;br /&gt;
&lt;br /&gt;
The first boot with persistence active will be slower than a standard live session—the system is running entirely from the USB drive, and the persistence overlay adds a layer of I/O. This is normal.&lt;br /&gt;
&lt;br /&gt;
== Verify Persistence ==&lt;br /&gt;
After booting, confirm the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should show sdXN mounted at /run/live/persistence/sdXN.&lt;br /&gt;
&lt;br /&gt;
Create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot with persistence enabled. If the file is present after reboot, persistence is working.&lt;br /&gt;
&lt;br /&gt;
== What Didn’t Work, and Why ==&lt;br /&gt;
&lt;br /&gt;
=== parted ===&lt;br /&gt;
parted misreported the capacity of the test USB drive: a 32 GB device was reported as approximately 125 GB. Determining where the free space began or how large to make the persistence partition was not possible from that output. parted was not used further. The broader behavior—libparted-based tools handling the isohybrid format unreliably—is documented on the Debian User mailing list [9].&lt;br /&gt;
&lt;br /&gt;
=== gdisk / sgdisk ===&lt;br /&gt;
gdisk and sgdisk are GPT-aware tools and would seem the logical choice for a drive with a hybrid partition table. On the test USB, sgdisk produced:&amp;lt;blockquote&amp;gt;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&lt;br /&gt;
&lt;br /&gt;
Warning! Secondary partition table overlaps the last partition by 33 blocks!&lt;br /&gt;
&lt;br /&gt;
Could not create partition 3 from 14580 to 8177663&lt;br /&gt;
&lt;br /&gt;
Non-GPT disk; not saving changes. Use -g to override.&lt;br /&gt;
&lt;br /&gt;
Error encountered; not saving changes.&amp;lt;/blockquote&amp;gt;The isohybrid layout places the secondary GPT header in a location that overlaps the last partition. sgdisk identifies this as invalid and refuses to proceed. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk can’t be used here.&lt;br /&gt;
&lt;br /&gt;
cp was also tested as an alternative to dd for writing the ISO, on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout. It’s not an alternative—it’s a slower write with the same result.&lt;br /&gt;
&lt;br /&gt;
== The UEFI grub&amp;gt; Prompt ==&lt;br /&gt;
On the test hardware, adding a persistence partition and then selecting the UEFI:-prefixed boot entry consistently dropped to a bare grub&amp;gt; prompt. Running ls from that prompt showed the internal drive’s partitions; the USB’s live partition was unreachable from there.&lt;br /&gt;
&lt;br /&gt;
What was observed: the USB’s own GRUB appeared briefly—visible as a rapid flash on screen with a “no such…” error—then failed, after which the firmware handed control to the internal drive’s GRUB, which presented its own grub&amp;gt; prompt.&lt;br /&gt;
&lt;br /&gt;
The UEFI specification states that firmware may remove boot options it considers invalid [7]; the ArchWiki documents firmware removing entries for drives it detects as changed as a known occurrence [8]. After adding the persistence partition, the USB’s EFI entry—pointing to EFI/boot/bootx64.efi—may no longer have been treated as valid by the firmware, causing it to fall through to the next available bootloader on the internal drive. Whether modifying the partition table on a removable device is sufficient to trigger this behavior, and under what firmware conditions, wasn’t reproducible in a controlled way during testing.&lt;br /&gt;
&lt;br /&gt;
Selecting the plain (non-UEFI:) device entry uses the legacy MBR boot path, which loads the USB’s own GRUB directly and has no dependency on the UEFI NVRAM or EFI boot entries. On the test hardware, this path was unaffected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
== Anonymity ==&lt;br /&gt;
A Debian Live USB with persistence, used correctly, writes nothing to the host machine’s internal disk. It doesn’t modify the installed OS, create logs on the host filesystem, or leave traces in the usual locations.&lt;br /&gt;
&lt;br /&gt;
It doesn’t provide anonymity. Boot events may be logged by firmware or enterprise management systems. Network activity is visible to routers, ISPs, and network administrators regardless of which OS is running. Mounting the internal disk during a live session makes its contents accessible to the live environment, and any writes to it are permanent. A live USB is a portable, self-contained Debian environment—it isn’t a privacy tool by design.&lt;br /&gt;
&lt;br /&gt;
== A Note on Carrying Data ==&lt;br /&gt;
The persistence partition is a practical place to keep working data alongside the system state—documents, scripts, configuration files, anything you’d normally keep in ~/Documents or ~/bin. It travels with the drive.&lt;br /&gt;
&lt;br /&gt;
Installed packages persist across sessions but may have hardware-specific dependencies. For general desktop use this isn’t usually an issue, but it’s worth keeping in mind if you’re installing drivers or kernel modules that assume specific hardware.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] Syslinux Project. “Isohybrid.” Syslinux Wiki. &amp;lt;nowiki&amp;gt;https://wiki.syslinux.org/wiki/index.php?title=Isohybrid&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2] Linux Command Library. “isohybrid(1) man page.” &amp;lt;nowiki&amp;gt;https://linuxcommandlibrary.com/man/isohybrid&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[3] Smith, Roderick W. “Hybrid MBRs.” GPT fdisk documentation. &amp;lt;nowiki&amp;gt;https://www.rodsbooks.com/gdisk/hybrid.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[4] Debian Manpages. “persistence.conf(5).” live-boot-doc, Trixie. &amp;lt;nowiki&amp;gt;https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[5] Debian Live Team. “Customizing Run-Time Behaviours.” Debian Live Manual. &amp;lt;nowiki&amp;gt;https://live-team.pages.debian.net/live-manual/html/live-manual/customizing-run-time-behaviours.en.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[6] Debian Manpages. “live-boot(7).” live-boot-doc. &amp;lt;nowiki&amp;gt;https://manpages.debian.org/unstable/live-boot-doc/live-boot.7.en.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[7] UEFI Forum. “Boot Manager.” UEFI Specification 2.10, §3. &amp;lt;nowiki&amp;gt;https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[8] ArchWiki. “Unified Extensible Firmware Interface.” &amp;lt;nowiki&amp;gt;https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[9] Debian User Mailing List. “Error message from GParted, means what?” November 2016. &amp;lt;nowiki&amp;gt;https://lists.debian.org/debian-user/2016/11/msg01017.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Contributed by distro-nix on Debian User Forums on 2026-04-06.&#039;&#039; Comments, corrections, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=227</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=227"/>
		<updated>2026-04-09T19:13:46Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: proff reading&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created: 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Updated: 2026-04-09 - added references and restructured heading order;&lt;br /&gt;
&lt;br /&gt;
ID: 005146.11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A Debian Live USB with persistence boots a full Debian environment from a USB drive while retaining changes across sessions. Files you create, settings you change, and packages you install survive reboot—stored on a dedicated partition rather than the volatile live environment. Nothing is written to the host machine’s internal disk.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A standard live USB is stateless: each boot starts from the same ISO image. The persistence partition changes that. From a single drive you get your shell configuration, documents, utilities, browser profile, and scripts, available on any machine you boot it from.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== What You’ll Need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum is 4 GB, but that leaves little room for persistence. A 32 GB drive is a practical working size. Download the Debian Live ISO from the official Debian website: &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tools required—dd, fdisk, and mkfs.ext4—are standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Install them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These packages are available from the live session’s apt cache without adding sources. They don’t persist to the USB unless persistence is already active.&lt;br /&gt;
&lt;br /&gt;
== Identifying Your USB Device ==&lt;br /&gt;
Plug in the USB drive and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your USB device will appear as /dev/sdb, /dev/sdc, or similar, depending on what else is attached. Confirm it by cross-referencing the reported size with the known capacity of the drive.&lt;br /&gt;
&lt;br /&gt;
Two placeholders are used throughout this document. /dev/sdX refers to the device itself—substitute your actual device identifier everywhere it appears. /dev/sdXN refers to the persistence partition—N is the partition number you’ll confirm from lsblk output after creating it in §4.&lt;br /&gt;
&lt;br /&gt;
Use the device path, not a partition path: /dev/sdb is correct; /dev/sdb1 is not.&lt;br /&gt;
&lt;br /&gt;
== Boot Entry Selection ==&lt;br /&gt;
The firmware boot menu on many systems presents two entries for a USB device: one labeled with the device name alone, and one prefixed with UEFI:. On the hardware used for this document, selecting the UEFI:-prefixed entry after adding a persistence partition consistently produced a bare grub&amp;gt; prompt rather than the Debian live menu. Selecting the plain device entry booted correctly every time.&lt;br /&gt;
&lt;br /&gt;
Throughout this procedure, select the plain device entry—not the one prefixed with UEFI:.&lt;br /&gt;
&lt;br /&gt;
This behavior was observed on specific hardware. Whether it reproduces on all firmware is not established here. The mechanism and a possible explanation are in §5.3. If your firmware presents only a UEFI boot path, recovery from within a booted live session may be possible by correcting the GRUB prefix, but that procedure is outside the scope of this document.&lt;br /&gt;
&lt;br /&gt;
== Procedure ==&lt;br /&gt;
&lt;br /&gt;
=== Clean the Drive ===&lt;br /&gt;
If the USB has been used before, residual partition signatures or bootloader data in the early sectors can interfere with the ISO write or the subsequent boot. Clear them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
wipefs removes filesystem and partition table signatures. The dd command zeros the first 200 MB, covering the MBR, GPT header, and any EFI data in the early sectors.&lt;br /&gt;
&lt;br /&gt;
== Write the ISO ==&lt;br /&gt;
Before running dd, confirm that sync resolves to the system binary and not a shell alias:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should be sync is /usr/bin/sync. If it returns an alias definition instead, unalias it with unalias sync, or substitute /usr/bin/sync explicitly at the end of the dd command.&lt;br /&gt;
&lt;br /&gt;
Write the ISO:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
status=progress shows the running transfer rate. sync flushes the write cache on completion—don’t remove the drive before it returns. The write will take a few minutes depending on the drive’s speed.&lt;br /&gt;
&lt;br /&gt;
== Verify the Base Boot ==&lt;br /&gt;
Before adding the persistence partition, confirm the ISO write produced a bootable drive. Boot from the USB, selecting the plain (non-UEFI:) device entry. If it reaches the Debian live menu and boots cleanly, you have a confirmed working baseline. If it doesn’t boot at this stage, don’t continue—repeat §4.&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. The persistence partition goes there. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table that supports both BIOS and UEFI boot paths. Adding a partition requires an explicit start sector; without it, fdisk’s default placement can conflict with the hybrid structure in ways that affect the boot. The failure modes of parted and gdisk with this layout are documented in §5.&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Print the current partition table:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two partitions will be present: the main ISO partition (type 0 or Empty—this is expected for an isohybrid layout) and a small EFI partition of approximately 3.2 MB. The p output shows the end sector of the last partition in the End column. The persistence partition must start at the next sector—that value plus one. On the test hardware with a Debian 13.4 live ISO written to the drive, the last partition ended at sector 8175999 and the persistence partition started at sector 8176000. This figure will vary with the ISO version and release; read your own p output and don’t use the test value without verifying it matches.&lt;br /&gt;
&lt;br /&gt;
Create the new partition:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When fdisk prompts for the first sector, enter the start sector you identified from the p output—do not accept the default. Accept the default for the last sector to use the remaining space on the drive.&lt;br /&gt;
&lt;br /&gt;
If fdisk asks whether to remove an existing ext4 signature, answer &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;. This clears a remnant from a previous attempt.&lt;br /&gt;
&lt;br /&gt;
Write the changes and exit:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After fdisk writes the new partition table, the running kernel may not immediately recognize the change. partprobe signals the kernel to re-read the partition table on the device without requiring a reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it completes, confirm the new partition is visible:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your new partition will appear beneath the device in the output. Note its full identifier—for example, sdb3 or sdc4—as you’ll need it in the next two steps. If it doesn’t appear immediately, wait a moment and run lsblk again before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Format the Partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence. The Debian live system identifies the persistence partition by this label at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Configuration ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdXN /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The / union directive instructs the live system to mount the entire filesystem as a union overlay. Changes made during a session are written to the persistence partition rather than discarded on shutdown.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with Persistence ==&lt;br /&gt;
Boot from the USB, selecting the plain (non-UEFI:) device entry in the firmware boot menu. At the Debian live GRUB menu, press Tab to edit the selected boot entry. On the line beginning with linux, append persistence after boot=live components. Press Enter to boot.&lt;br /&gt;
&lt;br /&gt;
The first boot with persistence active will be slower than a standard live session—the system is running entirely from the USB drive, and the persistence overlay adds a layer of I/O. This is normal.&lt;br /&gt;
&lt;br /&gt;
== Verify Persistence ==&lt;br /&gt;
After booting, confirm the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should show sdXN mounted at /run/live/persistence/sdXN.&lt;br /&gt;
&lt;br /&gt;
Create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot with persistence enabled. If the file is present after reboot, persistence is working.&lt;br /&gt;
&lt;br /&gt;
== What Didn’t Work, and Why ==&lt;br /&gt;
&lt;br /&gt;
=== parted ===&lt;br /&gt;
parted misreported the capacity of the test USB drive: a 32 GB device was reported as approximately 125 GB. Determining where the free space began or how large to make the persistence partition was not possible from that output. parted was not used further. The broader behavior—libparted-based tools handling the isohybrid format unreliably—is documented on the Debian User mailing list [9].&lt;br /&gt;
&lt;br /&gt;
=== gdisk / sgdisk ===&lt;br /&gt;
gdisk and sgdisk are GPT-aware tools and would seem the logical choice for a drive with a hybrid partition table. On the test USB, sgdisk produced:&amp;lt;blockquote&amp;gt;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&lt;br /&gt;
&lt;br /&gt;
Warning! Secondary partition table overlaps the last partition by 33 blocks!&lt;br /&gt;
&lt;br /&gt;
Could not create partition 3 from 14580 to 8177663&lt;br /&gt;
&lt;br /&gt;
Non-GPT disk; not saving changes. Use -g to override.&lt;br /&gt;
&lt;br /&gt;
Error encountered; not saving changes.&amp;lt;/blockquote&amp;gt;The isohybrid layout places the secondary GPT header in a location that overlaps the last partition. sgdisk identifies this as invalid and refuses to proceed. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk can’t be used here.&lt;br /&gt;
&lt;br /&gt;
cp was also tested as an alternative to dd for writing the ISO, on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout. It’s not an alternative—it’s a slower write with the same result.&lt;br /&gt;
&lt;br /&gt;
== The UEFI grub&amp;gt; Prompt ==&lt;br /&gt;
On the test hardware, adding a persistence partition and then selecting the UEFI:-prefixed boot entry consistently dropped to a bare grub&amp;gt; prompt. Running ls from that prompt showed the internal drive’s partitions; the USB’s live partition was unreachable from there.&lt;br /&gt;
&lt;br /&gt;
What was observed: the USB’s own GRUB appeared briefly—visible as a rapid flash on screen with a “no such…” error—then failed, after which the firmware handed control to the internal drive’s GRUB, which presented its own grub&amp;gt; prompt.&lt;br /&gt;
&lt;br /&gt;
The UEFI specification states that firmware may remove boot options it considers invalid [7]; the ArchWiki documents firmware removing entries for drives it detects as changed as a known occurrence [8]. After adding the persistence partition, the USB’s EFI entry—pointing to EFI/boot/bootx64.efi—may no longer have been treated as valid by the firmware, causing it to fall through to the next available bootloader on the internal drive. Whether modifying the partition table on a removable device is sufficient to trigger this behavior, and under what firmware conditions, wasn’t reproducible in a controlled way during testing.&lt;br /&gt;
&lt;br /&gt;
Selecting the plain (non-UEFI:) device entry uses the legacy MBR boot path, which loads the USB’s own GRUB directly and has no dependency on the UEFI NVRAM or EFI boot entries. On the test hardware, this path was unaffected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
== Anonymity ==&lt;br /&gt;
A Debian Live USB with persistence, used correctly, writes nothing to the host machine’s internal disk. It doesn’t modify the installed OS, create logs on the host filesystem, or leave traces in the usual locations.&lt;br /&gt;
&lt;br /&gt;
It doesn’t provide anonymity. Boot events may be logged by firmware or enterprise management systems. Network activity is visible to routers, ISPs, and network administrators regardless of which OS is running. Mounting the internal disk during a live session makes its contents accessible to the live environment, and any writes to it are permanent. A live USB is a portable, self-contained Debian environment—it isn’t a privacy tool by design.&lt;br /&gt;
&lt;br /&gt;
== A Note on Carrying Data ==&lt;br /&gt;
The persistence partition is a practical place to keep working data alongside the system state—documents, scripts, configuration files, anything you’d normally keep in ~/Documents or ~/bin. It travels with the drive.&lt;br /&gt;
&lt;br /&gt;
Installed packages persist across sessions but may have hardware-specific dependencies. For general desktop use this isn’t usually an issue, but it’s worth keeping in mind if you’re installing drivers or kernel modules that assume specific hardware.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] Syslinux Project. “Isohybrid.” Syslinux Wiki. &amp;lt;nowiki&amp;gt;https://wiki.syslinux.org/wiki/index.php?title=Isohybrid&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2] Linux Command Library. “isohybrid(1) man page.” &amp;lt;nowiki&amp;gt;https://linuxcommandlibrary.com/man/isohybrid&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[3] Smith, Roderick W. “Hybrid MBRs.” GPT fdisk documentation. &amp;lt;nowiki&amp;gt;https://www.rodsbooks.com/gdisk/hybrid.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[4] Debian Manpages. “persistence.conf(5).” live-boot-doc, Trixie. &amp;lt;nowiki&amp;gt;https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[5] Debian Live Team. “Customizing Run-Time Behaviours.” Debian Live Manual. &amp;lt;nowiki&amp;gt;https://live-team.pages.debian.net/live-manual/html/live-manual/customizing-run-time-behaviours.en.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[6] Debian Manpages. “live-boot(7).” live-boot-doc. &amp;lt;nowiki&amp;gt;https://manpages.debian.org/unstable/live-boot-doc/live-boot.7.en.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[7] UEFI Forum. “Boot Manager.” UEFI Specification 2.10, §3. &amp;lt;nowiki&amp;gt;https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[8] ArchWiki. “Unified Extensible Firmware Interface.” &amp;lt;nowiki&amp;gt;https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[9] Debian User Mailing List. “Error message from GParted, means what?” November 2016. &amp;lt;nowiki&amp;gt;https://lists.debian.org/debian-user/2016/11/msg01017.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Contributed by distro-nix on Debian User Forums on 2026-04-06.&#039;&#039; Comments, corrections, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=226</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=226"/>
		<updated>2026-04-09T19:11:07Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: Added references and restructured heading order&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created: 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Updated: 2026-04-09 - added references and restructured heading order;&lt;br /&gt;
&lt;br /&gt;
ID: 005146.11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A Debian Live USB with persistence boots a full Debian environment from a USB drive while retaining changes across sessions. Files you create, settings you change, and packages you install survive reboot—stored on a dedicated partition rather than the volatile live environment. Nothing is written to the host machine’s internal disk.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;A standard live USB is stateless: each boot starts from the same ISO image. The persistence partition changes that. From a single drive you get your shell configuration, documents, utilities, browser profile, and scripts, available on any machine you boot it from.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== What You’ll Need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum is 4 GB, but that leaves little room for persistence. A 32 GB drive is a practical working size. Download the Debian Live ISO from the official Debian website: &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tools required—dd, fdisk, and mkfs.ext4—are standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Install them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These packages are available from the live session’s apt cache without adding sources. They don’t persist to the USB unless persistence is already active.&lt;br /&gt;
&lt;br /&gt;
== Identifying Your USB Device ==&lt;br /&gt;
Plug in the USB drive and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your USB device will appear as /dev/sdb, /dev/sdc, or similar, depending on what else is attached. Confirm it by cross-referencing the reported size with the known capacity of the drive.&lt;br /&gt;
&lt;br /&gt;
Two placeholders are used throughout this document. /dev/sdX refers to the device itself—substitute your actual device identifier everywhere it appears. /dev/sdXN refers to the persistence partition—N is the partition number you’ll confirm from lsblk output after creating it in §4.4.&lt;br /&gt;
&lt;br /&gt;
Use the device path, not a partition path: /dev/sdb is correct; /dev/sdb1 is not.&lt;br /&gt;
&lt;br /&gt;
== Boot Entry Selection ==&lt;br /&gt;
The firmware boot menu on many systems presents two entries for a USB device: one labeled with the device name alone, and one prefixed with UEFI:. On the hardware used for this document, selecting the UEFI:-prefixed entry after adding a persistence partition consistently produced a bare grub&amp;gt; prompt rather than the Debian live menu. Selecting the plain device entry booted correctly every time.&lt;br /&gt;
&lt;br /&gt;
Throughout this procedure, select the plain device entry—not the one prefixed with UEFI:.&lt;br /&gt;
&lt;br /&gt;
This behavior was observed on specific hardware. Whether it reproduces on all firmware is not established here. The mechanism and a possible explanation are in §5.3. If your firmware presents only a UEFI boot path, recovery from within a booted live session may be possible by correcting the GRUB prefix, but that procedure is outside the scope of this document.&lt;br /&gt;
&lt;br /&gt;
== Procedure ==&lt;br /&gt;
&lt;br /&gt;
=== Clean the Drive ===&lt;br /&gt;
If the USB has been used before, residual partition signatures or bootloader data in the early sectors can interfere with the ISO write or the subsequent boot. Clear them before starting:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
wipefs removes filesystem and partition table signatures. The dd command zeros the first 200 MB, covering the MBR, GPT header, and any EFI data in the early sectors.&lt;br /&gt;
&lt;br /&gt;
== Write the ISO ==&lt;br /&gt;
Before running dd, confirm that sync resolves to the system binary and not a shell alias:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should be sync is /usr/bin/sync. If it returns an alias definition instead, unalias it with unalias sync, or substitute /usr/bin/sync explicitly at the end of the dd command.&lt;br /&gt;
&lt;br /&gt;
Write the ISO:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
status=progress shows the running transfer rate. sync flushes the write cache on completion—don’t remove the drive before it returns. The write will take a few minutes depending on the drive’s speed.&lt;br /&gt;
&lt;br /&gt;
== Verify the Base Boot ==&lt;br /&gt;
Before adding the persistence partition, confirm the ISO write produced a bootable drive. Boot from the USB, selecting the plain (non-UEFI:) device entry. If it reaches the Debian live menu and boots cleanly, you have a confirmed working baseline. If it doesn’t boot at this stage, don’t continue—repeat §4.1 and §4.2.&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. The persistence partition goes there. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table that supports both BIOS and UEFI boot paths. Adding a partition requires an explicit start sector; without it, fdisk’s default placement can conflict with the hybrid structure in ways that affect the boot. The failure modes of parted and gdisk with this layout are documented in §5.&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Print the current partition table:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two partitions will be present: the main ISO partition (type 0 or Empty—this is expected for an isohybrid layout) and a small EFI partition of approximately 3.2 MB. The p output shows the end sector of the last partition in the End column. The persistence partition must start at the next sector—that value plus one. On the test hardware with a Debian 13.4 live ISO written to the drive, the last partition ended at sector 8175999 and the persistence partition started at sector 8176000. This figure will vary with the ISO version and release; read your own p output and don’t use the test value without verifying it matches.&lt;br /&gt;
&lt;br /&gt;
Create the new partition:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When fdisk prompts for the first sector, enter the start sector you identified from the p output—do not accept the default. Accept the default for the last sector to use the remaining space on the drive.&lt;br /&gt;
&lt;br /&gt;
If fdisk asks whether to remove an existing ext4 signature, answer &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;. This clears a remnant from a previous attempt.&lt;br /&gt;
&lt;br /&gt;
Write the changes and exit:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After fdisk writes the new partition table, the running kernel may not immediately recognize the change. partprobe signals the kernel to re-read the partition table on the device without requiring a reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it completes, confirm the new partition is visible:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your new partition will appear beneath the device in the output. Note its full identifier—for example, sdb3 or sdc4—as you’ll need it in the next two steps. If it doesn’t appear immediately, wait a moment and run lsblk again before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Format the Partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence. The Debian live system identifies the persistence partition by this label at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the Persistence Configuration ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdXN /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The / union directive instructs the live system to mount the entire filesystem as a union overlay. Changes made during a session are written to the persistence partition rather than discarded on shutdown.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with Persistence ==&lt;br /&gt;
Boot from the USB, selecting the plain (non-UEFI:) device entry in the firmware boot menu. At the Debian live GRUB menu, press Tab to edit the selected boot entry. On the line beginning with linux, append persistence after boot=live components. Press Enter to boot.&lt;br /&gt;
&lt;br /&gt;
The first boot with persistence active will be slower than a standard live session—the system is running entirely from the USB drive, and the persistence overlay adds a layer of I/O. This is normal.&lt;br /&gt;
&lt;br /&gt;
== Verify Persistence ==&lt;br /&gt;
After booting, confirm the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should show sdXN mounted at /run/live/persistence/sdXN.&lt;br /&gt;
&lt;br /&gt;
Create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot with persistence enabled. If the file is present after reboot, persistence is working.&lt;br /&gt;
&lt;br /&gt;
== What Didn’t Work, and Why ==&lt;br /&gt;
&lt;br /&gt;
=== parted ===&lt;br /&gt;
parted misreported the capacity of the test USB drive: a 32 GB device was reported as approximately 125 GB. Determining where the free space began or how large to make the persistence partition was not possible from that output. parted was not used further. The broader behavior—libparted-based tools handling the isohybrid format unreliably—is documented on the Debian User mailing list [9].&lt;br /&gt;
&lt;br /&gt;
=== gdisk / sgdisk ===&lt;br /&gt;
gdisk and sgdisk are GPT-aware tools and would seem the logical choice for a drive with a hybrid partition table. On the test USB, sgdisk produced:&amp;lt;blockquote&amp;gt;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&lt;br /&gt;
&lt;br /&gt;
Warning! Secondary partition table overlaps the last partition by 33 blocks!&lt;br /&gt;
&lt;br /&gt;
Could not create partition 3 from 14580 to 8177663&lt;br /&gt;
&lt;br /&gt;
Non-GPT disk; not saving changes. Use -g to override.&lt;br /&gt;
&lt;br /&gt;
Error encountered; not saving changes.&amp;lt;/blockquote&amp;gt;The isohybrid layout places the secondary GPT header in a location that overlaps the last partition. sgdisk identifies this as invalid and refuses to proceed. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk can’t be used here.&lt;br /&gt;
&lt;br /&gt;
cp was also tested as an alternative to dd for writing the ISO, on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout. It’s not an alternative—it’s a slower write with the same result.&lt;br /&gt;
&lt;br /&gt;
== The UEFI grub&amp;gt; Prompt ==&lt;br /&gt;
On the test hardware, adding a persistence partition and then selecting the UEFI:-prefixed boot entry consistently dropped to a bare grub&amp;gt; prompt. Running ls from that prompt showed the internal drive’s partitions; the USB’s live partition was unreachable from there.&lt;br /&gt;
&lt;br /&gt;
What was observed: the USB’s own GRUB appeared briefly—visible as a rapid flash on screen with a “no such…” error—then failed, after which the firmware handed control to the internal drive’s GRUB, which presented its own grub&amp;gt; prompt.&lt;br /&gt;
&lt;br /&gt;
The UEFI specification states that firmware may remove boot options it considers invalid [7]; the ArchWiki documents firmware removing entries for drives it detects as changed as a known occurrence [8]. After adding the persistence partition, the USB’s EFI entry—pointing to EFI/boot/bootx64.efi—may no longer have been treated as valid by the firmware, causing it to fall through to the next available bootloader on the internal drive. Whether modifying the partition table on a removable device is sufficient to trigger this behavior, and under what firmware conditions, wasn’t reproducible in a controlled way during testing.&lt;br /&gt;
&lt;br /&gt;
Selecting the plain (non-UEFI:) device entry uses the legacy MBR boot path, which loads the USB’s own GRUB directly and has no dependency on the UEFI NVRAM or EFI boot entries. On the test hardware, this path was unaffected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
== Anonymity ==&lt;br /&gt;
A Debian Live USB with persistence, used correctly, writes nothing to the host machine’s internal disk. It doesn’t modify the installed OS, create logs on the host filesystem, or leave traces in the usual locations.&lt;br /&gt;
&lt;br /&gt;
It doesn’t provide anonymity. Boot events may be logged by firmware or enterprise management systems. Network activity is visible to routers, ISPs, and network administrators regardless of which OS is running. Mounting the internal disk during a live session makes its contents accessible to the live environment, and any writes to it are permanent. A live USB is a portable, self-contained Debian environment—it isn’t a privacy tool by design.&lt;br /&gt;
&lt;br /&gt;
7. A Note on Carrying Data&lt;br /&gt;
&lt;br /&gt;
The persistence partition is a practical place to keep working data alongside the system state—documents, scripts, configuration files, anything you’d normally keep in ~/Documents or ~/bin. It travels with the drive.&lt;br /&gt;
&lt;br /&gt;
Installed packages persist across sessions but may have hardware-specific dependencies. For general desktop use this isn’t usually an issue, but it’s worth keeping in mind if you’re installing drivers or kernel modules that assume specific hardware.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] Syslinux Project. “Isohybrid.” Syslinux Wiki. &amp;lt;nowiki&amp;gt;https://wiki.syslinux.org/wiki/index.php?title=Isohybrid&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2] Linux Command Library. “isohybrid(1) man page.” &amp;lt;nowiki&amp;gt;https://linuxcommandlibrary.com/man/isohybrid&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[3] Smith, Roderick W. “Hybrid MBRs.” GPT fdisk documentation. &amp;lt;nowiki&amp;gt;https://www.rodsbooks.com/gdisk/hybrid.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[4] Debian Manpages. “persistence.conf(5).” live-boot-doc, Trixie. &amp;lt;nowiki&amp;gt;https://manpages.debian.org/trixie/live-boot-doc/persistence.conf.5.en.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[5] Debian Live Team. “Customizing Run-Time Behaviours.” Debian Live Manual. &amp;lt;nowiki&amp;gt;https://live-team.pages.debian.net/live-manual/html/live-manual/customizing-run-time-behaviours.en.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[6] Debian Manpages. “live-boot(7).” live-boot-doc. &amp;lt;nowiki&amp;gt;https://manpages.debian.org/unstable/live-boot-doc/live-boot.7.en.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[7] UEFI Forum. “Boot Manager.” UEFI Specification 2.10, §3. &amp;lt;nowiki&amp;gt;https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[8] ArchWiki. “Unified Extensible Firmware Interface.” &amp;lt;nowiki&amp;gt;https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[9] Debian User Mailing List. “Error message from GParted, means what?” November 2016. &amp;lt;nowiki&amp;gt;https://lists.debian.org/debian-user/2016/11/msg01017.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Contributed by distro-nix on Debian User Forums on 2026-04-06.&#039;&#039; Comments, corrections, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=225</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=225"/>
		<updated>2026-04-08T14:15:42Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created : 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Last Updated : 2026-04-07&lt;br /&gt;
&lt;br /&gt;
ID: 005146.10&lt;br /&gt;
&lt;br /&gt;
A persistent Debian live USB is one of those tools that can come in handy once you have it. Boot it on your own machine, a colleague&#039;s laptop, or a borrowed computer. It has your environment, your files, your settings, exactly where you left them. Nothing is written to the host machine, nothing left behind when you pull out the USB.&lt;br /&gt;
&lt;br /&gt;
The persistence layer is what makes all the difference: a standard live USB is stateless—helpful for recovery and installation, but each session starts fresh. By adding a persistence partition, you have a portable Debian installation: your shell configuration, your documents, your utilities, your scripts, your browser profile, all carried around in your pocket.&lt;br /&gt;
&lt;br /&gt;
This is also a practical solution when you&#039;re working across multiple machines but don&#039;t want to maintain separate installations on each. It&#039;s particularly useful for sysadmins who move between systems regularly, or anyone who needs a known-good Debian environment available on demand without depending on the host.&lt;br /&gt;
&lt;br /&gt;
== What you&#039;ll need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum requirement is 4 GB, but that leaves you very little room for the persistence partition. The more you plan to store, the larger the drive should be. A 32 GB drive gives you a nice working space.&lt;br /&gt;
&lt;br /&gt;
Download the latest Debian Live ISO from the official Debian website at &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;.  Choose the release and desktop environment that suits you, or the minimal image if you want to keep it lean.&lt;br /&gt;
&lt;br /&gt;
you&#039;ll be working entirely in the terminal on a GNU/Linux system. The tools you need: &#039;&#039;&#039;dd, fdisk, and mkfs.ext4&#039;&#039;&#039;—are all standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Check first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They are small, standard packages and will be in the live session&#039;s apt cache without needing to add sources. Neither persists to the USB unless you&#039;re already booted with persistence active, so install them in the same session you&#039;re doing the setup.&lt;br /&gt;
&lt;br /&gt;
A word about dd before you start&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dd&#039;&#039;&#039; has the nickname of &amp;quot;disk destroyer&amp;quot; because whatever is in the of= (output file) if you mistype is gone. dd writes directly to block devices with no undo—confirm your device identifier before running the command.&lt;br /&gt;
&lt;br /&gt;
Plug in the USB drive, open the terminal, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look for your USB device in the output—it will appear as /dev/sdb, /dev/sdc, or similar depending on what else you have attached.&lt;br /&gt;
&lt;br /&gt;
Cross-reference the size to confirm you have the right device. In the commands that follow, /dev/sdX is a placeholder—replace it with your actual device identifier every time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the device itself (e.g. /dev/sdb), not a partition such as /dev/sdb1. &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Another trap worth knowing: if your shell has a sync alias defined—from an old backup script, for example—the &amp;amp;&amp;amp; sync at the end of the dd command will silently call that alias instead of /usr/bin/sync, leaving the write cache unflushed. You&#039;d never know from the output. Before running dd, confirm you&#039;re getting the real thing:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should return sync is /usr/bin/sync. If it returns an alias definition instead, either unalias it with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ unalias sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or call the binary directly with &#039;&#039;&#039;/usr/bin/sync&#039;&#039;&#039; at the end of your &#039;&#039;&#039;dd&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
== A note on UEFI ==&lt;br /&gt;
I found out the long, hard way that UEFI firmware causes persistent problems with live USB booting, particularly after the partition table on the USB has been modified. The symptom is consistent: the machine drops to a &#039;&#039;&#039;grub&amp;gt; prompt on boot, and the internal disk&#039;s filesystem is visible while the USB&#039;s live partition is&#039;&#039;&#039; unreachable. On some firmware implementations, adding a partition to the USB invalidates its EFI boot entry, causing the firmware to fall back to the internal drive&#039;s bootloader—even when you explicitly select the USB in the boot menu.&lt;br /&gt;
&lt;br /&gt;
This isn&#039;t a problem with the USB, the ISO, or the persistence setup. It is a firmware behavior that seems to affect a wide range of hardware.&lt;br /&gt;
&lt;br /&gt;
During testing, both parted and &#039;&#039;&#039;gdisk/sgdisk were&#039;&#039;&#039; used. parted misreported the USB capacity. sgdisk detected an invalid GPT with an overlapping secondary partition table and refused to proceed. &#039;&#039;&#039;fdisk with an explicit partition start sector is the only tool that works cleanly with the Debian live ISO&#039;s isohybrid layout.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When selecting your USB drive from the firmware boot menu, always choose the plain device entry—not the one prefixed with &amp;quot;UEFI:&amp;quot;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Most firmware boot menus show two entries for a USB device—one labelled simply with the device name (legacy MBR boot) and one prefixed with &amp;quot;UEFI:&amp;quot;.&#039;&#039;&#039; Most people choose the UEFI entry because they have modern hardware. But it is not the case here.&lt;br /&gt;
&lt;br /&gt;
When you think of &amp;quot;Legacy boot&amp;quot; in this context, it doesn&#039;t mean out of date or inferior. It means a different bootloader handoff mechanism—one that isn&#039;t broken by partition table changes. The Debian Live GRUB it loads is identical in any case. You&#039;re not giving anything up by choosing it over UEFI.&lt;br /&gt;
&lt;br /&gt;
Select the plain device entry. Persistence works correctly and reliably via this path. The first persistence-enabled boot will be noticeably slower than usual since the system is running entirely from the USB key—and that’s normal. A USB 3.0 drive was used in the physical testing for this paper.&lt;br /&gt;
&lt;br /&gt;
If your machine has no legacy boot option and UEFI is the only available path, the problem can potentially be resolved from within a booted live session by correcting the GRUB prefix—but this is an advanced recovery procedure, not the standard setup path.&lt;br /&gt;
&lt;br /&gt;
== What went wrong, and why ==&lt;br /&gt;
I wish this was a straightforward tutorial, but it didn&#039;t go as smoothly as I&#039;d hoped. The pitfalls and troubleshooting can serve as useful reference. This section documents the full troubleshooting process that led to finding a working procedure. If you&#039;ve already hit &#039;&#039;&#039;grub&amp;gt; and given up, welcome to the club. If you&#039;re wondering why the obvious approaches don&#039;t work, read this first—it might save you several hours.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039;The symptom many seem to run into&#039;&#039;&#039; ===&lt;br /&gt;
The most common failure mode is this: you write the ISO, verify it boots, add the persistence partition, reboot—and instead of the Debian live menu you get a bare grub&amp;gt; prompt. Nothing you type seems to help. Running ls shows your internal disk&#039;s filesystem, but the USB&#039;s live partition is nowhere to be found.&lt;br /&gt;
&lt;br /&gt;
This is the point where you conclude that persistence is broken, that the USB stick is faulty, or that the procedure is wrong. That&#039;s not where the problem lies.&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039;The host OS red herring&#039;&#039;&#039; ===&lt;br /&gt;
The first machine used for testing had Ubuntu Server 24.04 installed on the internal SSD. Ubuntu&#039;s GRUB had registered itself as the primary EFI bootloader in the UEFI NVRAM. When the USB was selected in the boot menu, the firmware handed control to Ubuntu&#039;s GRUB rather than the USB&#039;s own EFI bootloader—even when the USB was explicitly chosen.&lt;br /&gt;
&lt;br /&gt;
From the &#039;&#039;&#039;grub&amp;gt;&#039;&#039;&#039; prompt, running :&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;grub&amp;gt; ls hd0,gpt2/&#039;&#039;&#039; contained Ubuntu&#039;s /boot partition with vmlinuz-6.8.0-106-generic, and &#039;&#039;&#039;hd0,gpt3&#039;&#039;&#039; contained Ubuntu&#039;s root filesystem. The USB&#039;s live partition was accessible on &#039;&#039;&#039;hd2&#039;&#039;&#039;, but Ubuntu&#039;s GRUB could not read the iso9660 filesystem on it—the module reported &amp;quot;unknown filesystem&amp;quot; on every attempt, even after loading iso9660.mod. The live kernel and initrd were completely unreachable from that prompt.&lt;br /&gt;
&lt;br /&gt;
The theory was that installing Debian 13 on the test machine would fix the problem. It resolved the host OS interference, but not the &#039;&#039;&#039;grub&amp;gt;&#039;&#039;&#039; problem. The only thing &amp;quot;persistent&amp;quot; about this setup was that after adding the persistence partition it persistently went back to &#039;&#039;&#039;grub&amp;gt;&#039;&#039;&#039; showing that the Ubuntu machine was a red herring obscuring the real problem.&lt;br /&gt;
&lt;br /&gt;
=== The partitioning tool failures ===&lt;br /&gt;
The Debian live ISO uses an isohybrid layout—a hybrid partition table that is valid as both an MBR and a GPT. This is why a single ISO can boot on both legacy BIOS and UEFI systems. It&#039;s also what makes adding a persistence partition not so straightforward.&lt;br /&gt;
&lt;br /&gt;
=== Three tools I tried before getting something to work ===&lt;br /&gt;
&#039;&#039;&#039;parted&#039;&#039;&#039; was the first try. It misreported the USB capacity entirely by reporting my 32GB thumbdrive reported 125GB, making it impossible to determine where the free space began or how large the persistence partition would be. Next... &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gdisk/sgdisk&#039;&#039;&#039; was the next candidate, specifically because it is &#039;&#039;GPT-aware&#039;&#039; and should in theory handle a hybrid partition table better than fdisk. The output told a different story: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt; &#039;&#039;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Warning! Secondary partition table overlaps the last partition by 33 blocks!&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Could not create partition 3 from 14580 to 8177663&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Non-GPT disk; not saving changes. Use -g to override.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Error encountered; not saving changes.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt; The isohybrid layout places the secondary GPT partition table in a location that overlaps the last partition. sgdisk correctly identifies this as invalid and refuses to go any further. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk cannot be used here.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;cp&#039;&#039;&#039; was a last resort alternative to &#039;&#039;&#039;dd&#039;&#039;&#039; for writing the ISO, based on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout to dd. cp is not a solution—it&#039;s just a slower version of the same write operation. &lt;br /&gt;
&lt;br /&gt;
fdisk with its default n command also caused problems on earlier attempts—it prompted to remove an existing ext4 signature from a previous attempt and placed the partition in a way that triggered the UEFI firmware issue. The fix was to specify the start sector explicitly as 8176000, the sector immediately following the end of the ISO partition. This places the persistence partition cleanly in the unallocated space without touching any part of the isohybrid structure.&lt;br /&gt;
&lt;br /&gt;
=== Why the grub&amp;gt; prompt had me stumped ===&lt;br /&gt;
After adding the persistence partition with fdisk and rebooting, the machine consistently dropped to &#039;&#039;&#039;grub&amp;gt;&#039;&#039;&#039;. The assumption at this point was that the USB&#039;s own GRUB was loading but failing to find its configuration file—which is what the prompt suggests. &lt;br /&gt;
&lt;br /&gt;
In reality, the USB&#039;s GRUB was loading briefly (visible as three rapid flashes on screen with a &amp;quot;no such...&amp;quot; error), then failing, and the firmware was falling back to the internal Debian installation&#039;s GRUB, which then presented its own grub&amp;gt; prompt. The ls output confirmed this—the internal drive&#039;s EFI partition was visible as hd0,gpt1, not the USB. &lt;br /&gt;
&lt;br /&gt;
The USB&#039;s GRUB fails after partition table modification because many UEFI firmware implementations invalidate or reorder EFI boot entries when they detect a change to the partition table on a device. The USB&#039;s EFI entry—pointing to EFI/boot/bootx64.efi was effectively orphaned. The firmware no longer saw it as a valid boot option and fell through to the next entry, which was the internal drive. At least that’s my theory.&lt;br /&gt;
&lt;br /&gt;
== The solution: legacy boot ==&lt;br /&gt;
The boot menu on the test machine showed two entries for the USB:&amp;lt;blockquote&amp;gt;Choose this → &#039;&#039;&#039;&#039;&#039;SanDisk Cruzer Glide (29812MB)&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Not this → UEFI: SanDisk Cruzer Glide (29812MB)&#039;&#039;&amp;lt;/blockquote&amp;gt;The UEFI entry is the one that breaks after partition table changes. The plain entry uses the legacy MBR boot path, which is not affected by EFI boot entry invalidation. Selecting the legacy entry boots the USB&#039;s own GRUB directly via the MBR, which has zero dependency on the UEFI NVRAM and isn&#039;t affected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
Persistence works correctly and reliably via this path. The procedure itself—fdisk with an explicit sector, mkfs.ext4, persistence.conf—is valid. The only required change from most published guides is which boot entry you select in the firmware menu.&lt;br /&gt;
&lt;br /&gt;
== Clean the drive ==&lt;br /&gt;
If the USB has been used before, old partition signatures or bootloader data in the early sectors can cause problems—stale EFI entries or a leftover GRUB installation can interfere with the boot process even after a fresh ISO write. Clear them out first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;wipefs&#039;&#039;&#039; removes filesystem and partition table signatures. The &#039;&#039;&#039;dd&#039;&#039;&#039; zeros the first 200 MB, which covers the MBR, GPT header, and any EFI data that might otherwise survive a simple reformat. Then proceed with the ISO write.&lt;br /&gt;
&lt;br /&gt;
== Write the ISO to the USB drive ==&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The status=progress flag gives you a running transfer rate, otherwise you can&#039;t see it is working. The sync at the end flushes any remaining data from the write cache—don&#039;t pull the drive before it completes.&lt;br /&gt;
&lt;br /&gt;
This may take a few minutes depending on the speed of your drive, so be patient and don&#039;t be tempted to abort the process even if it appears to stall. When it finishes, the USB is bootable but stateless. The next steps add the persistence layer.&lt;br /&gt;
&lt;br /&gt;
Before continuing, verify the USB boots. Select the legacy (non-UEFI) entry for the USB in your firmware boot menu. This confirms the ISO write is clean and gives you a known-good baseline before you make any further changes. If it doesn&#039;t boot at this stage, stop and repeat Steps 1 and 2—don&#039;t proceed to the persistence steps until you have a confirmed working boot.&lt;br /&gt;
&lt;br /&gt;
== Create the persistence partition ==&lt;br /&gt;
Finally, I tried &#039;&#039;&#039;fdisk&#039;&#039;&#039;. The ISO write leaves unallocated space at the end of the drive, so fdisk creates a new partition there for persistence. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table—and the partition has to be created with an explicit start sector to avoid corrupting that layout. Other partitioning tools (parted, gdisk) do not handle this correctly.&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once inside &#039;&#039;&#039;fdisk&#039;&#039;&#039;, print the current partition layout:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &#039;&#039;&#039;p&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll see two existing partitions—the main ISO partition (type 0 or Empty, which is normal for isohybrid) and a small 3.2 MB EFI partition.&lt;br /&gt;
&lt;br /&gt;
The persistence partition must start at the next sector after the last partition ends—on a Debian 13.4 live ISO this is sector 8176000, immediately after the ISO partition which ends at 8175999. &lt;br /&gt;
&lt;br /&gt;
Create the new partition:  &lt;br /&gt;
&lt;br /&gt;
Command (m for help): &#039;&#039;&#039;n&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
When prompted for the first sector, enter &#039;&#039;&#039;8176000&#039;&#039;&#039; rather than accepting the default.&lt;br /&gt;
&lt;br /&gt;
Accept the default for the last sector to use the remaining space.&lt;br /&gt;
&lt;br /&gt;
If &#039;&#039;&#039;fdisk&#039;&#039;&#039; asks whether to remove an existing ext4 signature, answer &#039;&#039;&#039;Y&#039;&#039;&#039;—this is a remnant from a previous attempt and should be cleared. &lt;br /&gt;
&lt;br /&gt;
Write the changes and exit: &lt;br /&gt;
&lt;br /&gt;
Command (m for help): &#039;&#039;&#039;w&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
If the system does not immediately recognize the new partition, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Format the persistence partition ==&lt;br /&gt;
Format the new partition as ext4 with the label &#039;&#039;&#039;persistence—the label is not&#039;&#039;&#039; a suggestion, the Debian live system looks for it by name at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdX3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace sdX3 with your actual partition identifier (for example, /dev/sdb3).&lt;br /&gt;
&lt;br /&gt;
== Create the persistence configuration file ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdX3 /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file that tells the live system what to persist:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;/ union&#039;&#039;&#039; directive mounts the entire filesystem as a union overlay—changes you make during a session are written to the persistence partition rather than lost when you shut down.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition cleanly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with persistence ==&lt;br /&gt;
Boot your system from the USB drive, selecting the legacy &#039;&#039;&#039;(non-UEFI)&#039;&#039;&#039; entry in the firmware boot menu. At the Debian live GRUB menu, press the Tab key to edit the boot entry. Find the line beginning with linux and add persistence after boot=live components. Press Enter to boot into the live system.&lt;br /&gt;
&lt;br /&gt;
From this point on, any files you create, settings you change, or packages you install will survive across reboots—stored on the persistence partition rather than in the volatile live environment. The first boot with persistence active will be slower than a standard live session since the system is running entirely from the USB.&lt;br /&gt;
&lt;br /&gt;
== Verify persistence is working ==&lt;br /&gt;
After booting, check that the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see sdX3 mounted at /run/live/persistence/sdX3.&lt;br /&gt;
&lt;br /&gt;
Then create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot again with the persistence option enabled. If the file is there, persistence is working.&lt;br /&gt;
&lt;br /&gt;
Anonymity&lt;br /&gt;
&lt;br /&gt;
This is not a stealth tool. When used correctly, a Debian Live USB with persistence doesn&#039;t modify the host system—no files or logs are written to the internal disk unless you explicitly mount and use it. However, it does not provide anonymity or invisibility:&lt;br /&gt;
&lt;br /&gt;
* Boot events may be logged by firmware or enterprise systems&lt;br /&gt;
* USB usage may be detectable&lt;br /&gt;
* Network activity is visible to routers, ISPs, and organisations&lt;br /&gt;
* User actions can leave traces if internal drives are mounted&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A note on carrying data files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The persistence partition isn&#039;t just for system state. It&#039;s a practical place to keep working data—documents, scripts, utilities, configuration files—that you need available no matter which system you boot from. Think of it as your portable home directory. Anything you&#039;d normally keep in /Documents or /bin travels with the drive.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re working across machines with different hardware, keep in mind that installed packages persist but may have hardware-specific dependencies. For most desktop use this isn&#039;t an issue, but it&#039;s worth being aware of if you&#039;re installing drivers or kernel modules. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by distro-nix on Debian User Forums on 2026-04-06.&#039;&#039; Comments, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=224</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=224"/>
		<updated>2026-04-08T14:04:03Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created : 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Last Updated : 2026-04-07&lt;br /&gt;
&lt;br /&gt;
ID: 005146.10&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
=== A persistent Debian live USB is one of those tools that can come in handy once you have it. Boot it on your own machine, a colleague&#039;s laptop, or a borrowed computer. It has your environment, your files, your settings, exactly where you left them. Nothing is written to the host machine, nothing left behind when you pull out the USB. ===&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;The persistence layer is what makes all the difference: a standard live USB is stateless—helpful for recovery and installation, but each session starts fresh. By adding a persistence partition, you have a portable Debian installation: your shell configuration, your documents, your utilities, your scripts, your browser profile, all carried around in your pocket.&lt;br /&gt;
&lt;br /&gt;
This is also a practical solution when you&#039;re working across multiple machines but don&#039;t want to maintain separate installations on each. It&#039;s particularly useful for sysadmins who move between systems regularly, or anyone who needs a known-good Debian environment available on demand without depending on the host.&lt;br /&gt;
&lt;br /&gt;
== What you&#039;ll need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum requirement is 4 GB, but that leaves you very little room for the persistence partition. The more you plan to store, the larger the drive should be. A 32 GB drive gives you a nice working space.&lt;br /&gt;
&lt;br /&gt;
Download the latest Debian Live ISO from the official Debian website at &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;.  Choose the release and desktop environment that suits you, or the minimal image if you want to keep it lean.&lt;br /&gt;
&lt;br /&gt;
you&#039;ll be working entirely in the terminal on a GNU/Linux system. The tools you need: &#039;&#039;&#039;dd, fdisk, and mkfs.ext4&#039;&#039;&#039;—are all standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Check first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They are small, standard packages and will be in the live session&#039;s apt cache without needing to add sources. Neither persists to the USB unless you&#039;re already booted with persistence active, so install them in the same session you&#039;re doing the setup.&lt;br /&gt;
&lt;br /&gt;
A word about dd before you start&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dd&#039;&#039;&#039; has the nickname of &amp;quot;disk destroyer&amp;quot; because whatever is in the of= (output file) if you mistype is gone. dd writes directly to block devices with no undo—confirm your device identifier before running the command.&lt;br /&gt;
&lt;br /&gt;
Plug in the USB drive, open the terminal, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look for your USB device in the output—it will appear as /dev/sdb, /dev/sdc, or similar depending on what else you have attached.&lt;br /&gt;
&lt;br /&gt;
Cross-reference the size to confirm you have the right device. In the commands that follow, /dev/sdX is a placeholder—replace it with your actual device identifier every time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the device itself (e.g. /dev/sdb), not a partition such as /dev/sdb1. &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Another trap worth knowing: if your shell has a sync alias defined—from an old backup script, for example—the &amp;amp;&amp;amp; sync at the end of the dd command will silently call that alias instead of /usr/bin/sync, leaving the write cache unflushed. You&#039;d never know from the output. Before running dd, confirm you&#039;re getting the real thing:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should return sync is /usr/bin/sync. If it returns an alias definition instead, either unalias it with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ unalias sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or call the binary directly with &#039;&#039;&#039;/usr/bin/sync&#039;&#039;&#039; at the end of your &#039;&#039;&#039;dd&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
== A note on UEFI ==&lt;br /&gt;
I found out the long, hard way that UEFI firmware causes persistent problems with live USB booting, particularly after the partition table on the USB has been modified. The symptom is consistent: the machine drops to a &#039;&#039;&#039;grub&amp;gt; prompt on boot, and the internal disk&#039;s filesystem is visible while the USB&#039;s live partition is&#039;&#039;&#039; unreachable. On some firmware implementations, adding a partition to the USB invalidates its EFI boot entry, causing the firmware to fall back to the internal drive&#039;s bootloader—even when you explicitly select the USB in the boot menu.&lt;br /&gt;
&lt;br /&gt;
This isn&#039;t a problem with the USB, the ISO, or the persistence setup. It is a firmware behavior that seems to affect a wide range of hardware.&lt;br /&gt;
&lt;br /&gt;
During testing, both parted and &#039;&#039;&#039;gdisk/sgdisk were&#039;&#039;&#039; used. parted misreported the USB capacity. sgdisk detected an invalid GPT with an overlapping secondary partition table and refused to proceed. &#039;&#039;&#039;fdisk with an explicit partition start sector is the only tool that works cleanly with the Debian live ISO&#039;s isohybrid layout.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When selecting your USB drive from the firmware boot menu, always choose the plain device entry—not the one prefixed with &amp;quot;UEFI:&amp;quot;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Most firmware boot menus show two entries for a USB device—one labelled simply with the device name (legacy MBR boot) and one prefixed with &amp;quot;UEFI:&amp;quot;.&#039;&#039;&#039; Most people choose the UEFI entry because they have modern hardware. But it is not the case here.&lt;br /&gt;
&lt;br /&gt;
When you think of &amp;quot;Legacy boot&amp;quot; in this context, it doesn&#039;t mean out of date or inferior. It means a different bootloader handoff mechanism—one that isn&#039;t broken by partition table changes. The Debian Live GRUB it loads is identical in any case. You&#039;re not giving anything up by choosing it over UEFI.&lt;br /&gt;
&lt;br /&gt;
Select the plain device entry. Persistence works correctly and reliably via this path. The first persistence-enabled boot will be noticeably slower than usual since the system is running entirely from the USB key—and that’s normal. A USB 3.0 drive was used in the physical testing for this paper.&lt;br /&gt;
&lt;br /&gt;
If your machine has no legacy boot option and UEFI is the only available path, the problem can potentially be resolved from within a booted live session by correcting the GRUB prefix—but this is an advanced recovery procedure, not the standard setup path.&lt;br /&gt;
&lt;br /&gt;
== What went wrong, and why ==&lt;br /&gt;
I wish this was a straightforward tutorial, but it didn&#039;t go as smoothly as I&#039;d hoped. The pitfalls and troubleshooting can serve as useful reference. This section documents the full troubleshooting process that led to finding a working procedure. If you&#039;ve already hit &#039;&#039;&#039;grub&amp;gt; and given up, welcome to the club. If you&#039;re wondering why the obvious approaches don&#039;t work, read this first—it might save you several hours.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039;The symptom many seem to run into&#039;&#039;&#039; ===&lt;br /&gt;
The most common failure mode is this: you write the ISO, verify it boots, add the persistence partition, reboot—and instead of the Debian live menu you get a bare grub&amp;gt; prompt. Nothing you type seems to help. Running ls shows your internal disk&#039;s filesystem, but the USB&#039;s live partition is nowhere to be found.&lt;br /&gt;
&lt;br /&gt;
This is the point where you conclude that persistence is broken, that the USB stick is faulty, or that the procedure is wrong. That&#039;s not where the problem lies.&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039;The host OS red herring&#039;&#039;&#039; ===&lt;br /&gt;
The first machine used for testing had Ubuntu Server 24.04 installed on the internal SSD. Ubuntu&#039;s GRUB had registered itself as the primary EFI bootloader in the UEFI NVRAM. When the USB was selected in the boot menu, the firmware handed control to Ubuntu&#039;s GRUB rather than the USB&#039;s own EFI bootloader—even when the USB was explicitly chosen.&lt;br /&gt;
&lt;br /&gt;
From the &#039;&#039;&#039;grub&amp;gt;&#039;&#039;&#039; prompt, running :&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;grub&amp;gt; ls hd0,gpt2/&#039;&#039;&#039; contained Ubuntu&#039;s /boot partition with vmlinuz-6.8.0-106-generic, and &#039;&#039;&#039;hd0,gpt3&#039;&#039;&#039; contained Ubuntu&#039;s root filesystem. The USB&#039;s live partition was accessible on &#039;&#039;&#039;hd2&#039;&#039;&#039;, but Ubuntu&#039;s GRUB could not read the iso9660 filesystem on it—the module reported &amp;quot;unknown filesystem&amp;quot; on every attempt, even after loading iso9660.mod. The live kernel and initrd were completely unreachable from that prompt.&lt;br /&gt;
&lt;br /&gt;
The theory was that installing Debian 13 on the test machine would fix the problem. It resolved the host OS interference, but not the &#039;&#039;&#039;grub&amp;gt;&#039;&#039;&#039; problem. The only thing &amp;quot;persistent&amp;quot; about this setup was that after adding the persistence partition it persistently went back to &#039;&#039;&#039;grub&amp;gt;&#039;&#039;&#039; showing that the Ubuntu machine was a red herring obscuring the real problem.&lt;br /&gt;
&lt;br /&gt;
=== The partitioning tool failures ===&lt;br /&gt;
The Debian live ISO uses an isohybrid layout—a hybrid partition table that is valid as both an MBR and a GPT. This is why a single ISO can boot on both legacy BIOS and UEFI systems. It&#039;s also what makes adding a persistence partition not so straightforward.&lt;br /&gt;
&lt;br /&gt;
=== Three tools I tried before getting something to work ===&lt;br /&gt;
parted was the first try. It misreported the USB capacity entirely by reporting my 32GB ad 125GB, making it impossible to determine where the free space began or how large the persistence partition would be. Next...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gdisk/sgdisk&#039;&#039;&#039; was the next candidate, specifically because it is &#039;&#039;GPT-aware&#039;&#039; and should in theory handle a hybrid partition table better than fdisk. The output told a different story: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt; &#039;&#039;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Warning! Secondary partition table overlaps the last partition by 33 blocks!&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Could not create partition 3 from 14580 to 8177663&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Non-GPT disk; not saving changes. Use -g to override.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Error encountered; not saving changes.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt; The isohybrid layout places the secondary GPT partition table in a location that overlaps the last partition. sgdisk correctly identifies this as invalid and refuses to go any further. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk cannot be used here.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;cp&#039;&#039;&#039; was a last resort alternative to &#039;&#039;&#039;dd&#039;&#039;&#039; for writing the ISO, based on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout to dd. cp is not a solution—it&#039;s just a slower version of the same write operation. &lt;br /&gt;
&lt;br /&gt;
fdisk with its default n command also caused problems on earlier attempts—it prompted to remove an existing ext4 signature from a previous attempt and placed the partition in a way that triggered the UEFI firmware issue. The fix was to specify the start sector explicitly as 8176000, the sector immediately following the end of the ISO partition. This places the persistence partition cleanly in the unallocated space without touching any part of the isohybrid structure.&lt;br /&gt;
&lt;br /&gt;
=== Why the grub&amp;gt; prompt had me stumped ===&lt;br /&gt;
After adding the persistence partition with fdisk and rebooting, the machine consistently dropped to grub&amp;gt;. The assumption at this point was that the USB&#039;s own GRUB was loading but failing to find its configuration file—which is what the prompt suggests. &lt;br /&gt;
&lt;br /&gt;
In reality, the USB&#039;s GRUB was loading briefly (visible as three rapid flashes on screen with a &amp;quot;no such...&amp;quot; error), then failing, and the firmware was falling back to the internal Debian installation&#039;s GRUB, which then presented its own grub&amp;gt; prompt. The ls output confirmed this—the internal drive&#039;s EFI partition was visible as hd0,gpt1, not the USB. &lt;br /&gt;
&lt;br /&gt;
The USB&#039;s GRUB fails after partition table modification because many UEFI firmware implementations invalidate or reorder EFI boot entries when they detect a change to the partition table on a device. The USB&#039;s EFI entry—pointing to EFI/boot/bootx64.efi was effectively orphaned. The firmware no longer saw it as a valid boot option and fell through to the next entry, which was the internal drive. At least that’s my theory.&lt;br /&gt;
&lt;br /&gt;
== The solution: legacy boot ==&lt;br /&gt;
The boot menu on the test machine showed two entries for the USB:&amp;lt;blockquote&amp;gt;Choose this → &#039;&#039;&#039;&#039;&#039;SanDisk Cruzer Glide (29812MB)&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Not this → UEFI: SanDisk Cruzer Glide (29812MB)&#039;&#039;&amp;lt;/blockquote&amp;gt;The UEFI entry is the one that breaks after partition table changes. The plain entry uses the legacy MBR boot path, which is not affected by EFI boot entry invalidation. Selecting the legacy entry boots the USB&#039;s own GRUB directly via the MBR, which has zero dependency on the UEFI NVRAM and isn&#039;t affected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
Persistence works correctly and reliably via this path. The procedure itself—fdisk with an explicit sector, mkfs.ext4, persistence.conf—is valid. The only required change from most published guides is which boot entry you select in the firmware menu.&lt;br /&gt;
&lt;br /&gt;
== Clean the drive ==&lt;br /&gt;
If the USB has been used before, old partition signatures or bootloader data in the early sectors can cause problems—stale EFI entries or a leftover GRUB installation can interfere with the boot process even after a fresh ISO write. Clear them out first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;wipefs&#039;&#039;&#039; removes filesystem and partition table signatures. The &#039;&#039;&#039;dd&#039;&#039;&#039; zeros the first 200 MB, which covers the MBR, GPT header, and any EFI data that might otherwise survive a simple reformat. Then proceed with the ISO write.&lt;br /&gt;
&lt;br /&gt;
== Write the ISO to the USB drive ==&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The status=progress flag gives you a running transfer rate, otherwise you can&#039;t see it is working. The sync at the end flushes any remaining data from the write cache—don&#039;t pull the drive before it completes.&lt;br /&gt;
&lt;br /&gt;
This may take a few minutes depending on the speed of your drive, so be patient and don&#039;t be tempted to abort the process even if it appears to stall. When it finishes, the USB is bootable but stateless. The next steps add the persistence layer.&lt;br /&gt;
&lt;br /&gt;
Before continuing, verify the USB boots. Select the legacy (non-UEFI) entry for the USB in your firmware boot menu. This confirms the ISO write is clean and gives you a known-good baseline before you make any further changes. If it doesn&#039;t boot at this stage, stop and repeat Steps 1 and 2—don&#039;t proceed to the persistence steps until you have a confirmed working boot.&lt;br /&gt;
&lt;br /&gt;
== Create the persistence partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. You&#039;ll use fdisk to create a new partition there for persistence. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table—and the partition must be created with an explicit start sector to avoid corrupting that layout. Other partitioning tools (parted, gdisk) do not handle this correctly.&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once inside &#039;&#039;&#039;fdisk&#039;&#039;&#039;, print the current partition layout:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &#039;&#039;&#039;p&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll see two existing partitions—the main ISO partition (type 0 or Empty, which is normal for isohybrid) and a small 3.2 MB EFI partition.&lt;br /&gt;
&lt;br /&gt;
The persistence partition must start at the next sector after the last partition ends—on a Debian 13.4 live ISO this is sector 8176000, immediately after the ISO partition which ends at 8175999. &lt;br /&gt;
&lt;br /&gt;
Create the new partition:  &lt;br /&gt;
&lt;br /&gt;
Command (m for help): &#039;&#039;&#039;n&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
When prompted for the first sector, enter &#039;&#039;&#039;8176000&#039;&#039;&#039; rather than accepting the default.&lt;br /&gt;
&lt;br /&gt;
Accept the default for the last sector to use the remaining space.&lt;br /&gt;
&lt;br /&gt;
If &#039;&#039;&#039;fdisk&#039;&#039;&#039; asks whether to remove an existing ext4 signature, answer &#039;&#039;&#039;Y&#039;&#039;&#039;—this is a remnant from a previous attempt and should be cleared. &lt;br /&gt;
&lt;br /&gt;
Write the changes and exit: &lt;br /&gt;
&lt;br /&gt;
Command (m for help): &#039;&#039;&#039;w&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
If the system does not immediately recognize the new partition, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Format the persistence partition ==&lt;br /&gt;
Format the new partition as ext4 with the label &#039;&#039;&#039;persistence—the label is not&#039;&#039;&#039; a suggestion, the Debian live system looks for it by name at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdX3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace sdX3 with your actual partition identifier (for example, /dev/sdb3).&lt;br /&gt;
&lt;br /&gt;
== Create the persistence configuration file ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdX3 /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file that tells the live system what to persist:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;/ union&#039;&#039;&#039; directive mounts the entire filesystem as a union overlay—changes you make during a session are written to the persistence partition rather than lost when you shut down.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition cleanly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with persistence ==&lt;br /&gt;
Boot your system from the USB drive, selecting the legacy &#039;&#039;&#039;(non-UEFI)&#039;&#039;&#039; entry in the firmware boot menu. At the Debian live GRUB menu, press the Tab key to edit the boot entry. Find the line beginning with linux and add persistence after boot=live components. Press Enter to boot into the live system.&lt;br /&gt;
&lt;br /&gt;
From this point on, any files you create, settings you change, or packages you install will survive across reboots—stored on the persistence partition rather than in the volatile live environment. The first boot with persistence active will be slower than a standard live session since the system is running entirely from the USB.&lt;br /&gt;
&lt;br /&gt;
== Verify persistence is working ==&lt;br /&gt;
After booting, check that the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see sdX3 mounted at /run/live/persistence/sdX3.&lt;br /&gt;
&lt;br /&gt;
Then create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot again with the persistence option enabled. If the file is there, persistence is working.&lt;br /&gt;
&lt;br /&gt;
Anonymity&lt;br /&gt;
&lt;br /&gt;
This is not a stealth tool. When used correctly, a Debian Live USB with persistence doesn&#039;t modify the host system—no files or logs are written to the internal disk unless you explicitly mount and use it. However, it does not provide anonymity or invisibility:&lt;br /&gt;
&lt;br /&gt;
* Boot events may be logged by firmware or enterprise systems&lt;br /&gt;
* USB usage may be detectable&lt;br /&gt;
* Network activity is visible to routers, ISPs, and organisations&lt;br /&gt;
* User actions can leave traces if internal drives are mounted&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A note on carrying data files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The persistence partition isn&#039;t just for system state. It&#039;s a practical place to keep working data—documents, scripts, utilities, configuration files—that you need available no matter which system you boot from. Think of it as your portable home directory. Anything you&#039;d normally keep in /Documents or /bin travels with the drive.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re working across machines with different hardware, keep in mind that installed packages persist but may have hardware-specific dependencies. For most desktop use this isn&#039;t an issue, but it&#039;s worth being aware of if you&#039;re installing drivers or kernel modules. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by distro-nix on Debian User Forums on 2026-04-06.&#039;&#039; Comments, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=223</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=223"/>
		<updated>2026-04-08T02:42:51Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: removed step numbers&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created : 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Last Updated : 2026-04-07&lt;br /&gt;
&lt;br /&gt;
ID: 005146.10&lt;br /&gt;
&lt;br /&gt;
=== A persistent Debian live USB is one of those tools that can come in handy once you have it. Boot it on your own machine, a colleague&#039;s laptop, or a borrowed computer. It has your environment, your files, your settings, exactly where you left them. Nothing is written to the host machine, nothing left behind when you pull out the USB. ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The persistence layer is what makes all the difference: a standard live USB is stateless—helpful for recovery and installation, but each session starts fresh. By adding a persistence partition, you have a portable Debian installation: your shell configuration, your documents, your utilities, your scripts, your browser profile, all carried around in your pocket.&lt;br /&gt;
&lt;br /&gt;
This is also a practical solution when you&#039;re working across multiple machines but don&#039;t want to maintain separate installations on each. It&#039;s particularly useful for sysadmins who move between systems regularly, or anyone who needs a known-good Debian environment available on demand without depending on the host.&lt;br /&gt;
&lt;br /&gt;
== What you&#039;ll need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum requirement is 4 GB, but that leaves you very little room for the persistence partition. The more you plan to store, the larger the drive should be. A 32 GB drive gives you a nice working space.&lt;br /&gt;
&lt;br /&gt;
Download the latest Debian Live ISO from the official Debian website at &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;.  Choose the release and desktop environment that suits you, or the minimal image if you want to keep it lean.&lt;br /&gt;
&lt;br /&gt;
you&#039;ll be working entirely in the terminal on a GNU/Linux system. The tools you need: &#039;&#039;&#039;dd, fdisk, and mkfs.ext4&#039;&#039;&#039;—are all standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Check first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They are small, standard packages and will be in the live session&#039;s apt cache without needing to add sources. Neither persists to the USB unless you&#039;re already booted with persistence active, so install them in the same session you&#039;re doing the setup.&lt;br /&gt;
&lt;br /&gt;
A word about dd before you start&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dd&#039;&#039;&#039; has the nickname of &amp;quot;disk destroyer&amp;quot; because whatever is in the of= (output file) if you mistype is gone. dd writes directly to block devices with no undo—confirm your device identifier before running the command.&lt;br /&gt;
&lt;br /&gt;
Plug in the USB drive, open the terminal, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look for your USB device in the output—it will appear as /dev/sdb, /dev/sdc, or similar depending on what else you have attached.&lt;br /&gt;
&lt;br /&gt;
Cross-reference the size to confirm you have the right device. In the commands that follow, /dev/sdX is a placeholder—replace it with your actual device identifier every time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the device itself (e.g. /dev/sdb), not a partition such as /dev/sdb1. &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Another trap worth knowing: if your shell has a sync alias defined—from an old backup script, for example—the &amp;amp;&amp;amp; sync at the end of the dd command will silently call that alias instead of /usr/bin/sync, leaving the write cache unflushed. You&#039;d never know from the output. Before running dd, confirm you&#039;re getting the real thing:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should return sync is /usr/bin/sync. If it returns an alias definition instead, either unalias it with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ unalias sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or call the binary directly with &#039;&#039;&#039;/usr/bin/sync&#039;&#039;&#039; at the end of your &#039;&#039;&#039;dd&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
== A note on UEFI ==&lt;br /&gt;
I found out the long, hard way that UEFI firmware causes persistent problems with live USB booting, particularly after the partition table on the USB has been modified. The symptom is consistent: the machine drops to a &#039;&#039;&#039;grub&amp;gt; prompt on boot, and the internal disk&#039;s filesystem is visible while the USB&#039;s live partition is&#039;&#039;&#039; unreachable. On some firmware implementations, adding a partition to the USB invalidates its EFI boot entry, causing the firmware to fall back to the internal drive&#039;s bootloader—even when you explicitly select the USB in the boot menu.&lt;br /&gt;
&lt;br /&gt;
This isn&#039;t a problem with the USB, the ISO, or the persistence setup. It is a firmware behavior that seems to affect a wide range of hardware.&lt;br /&gt;
&lt;br /&gt;
During testing, both parted and &#039;&#039;&#039;gdisk/sgdisk were&#039;&#039;&#039; used. parted misreported the USB capacity. sgdisk detected an invalid GPT with an overlapping secondary partition table and refused to proceed. &#039;&#039;&#039;fdisk with an explicit partition start sector is the only tool that works cleanly with the Debian live ISO&#039;s isohybrid layout.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When selecting your USB drive from the firmware boot menu, always choose the plain device entry—not the one prefixed with &amp;quot;UEFI:&amp;quot;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Most firmware boot menus show two entries for a USB device—one labelled simply with the device name (legacy MBR boot) and one prefixed with &amp;quot;UEFI:&amp;quot;.&#039;&#039;&#039; Most people choose the UEFI entry because they have modern hardware. But it is not the case here.&lt;br /&gt;
&lt;br /&gt;
When you think of &amp;quot;Legacy boot&amp;quot; in this context, it doesn&#039;t mean out of date or inferior. It means a different bootloader handoff mechanism—one that isn&#039;t broken by partition table changes. The Debian Live GRUB it loads is identical in any case. You&#039;re not giving anything up by choosing it over UEFI.&lt;br /&gt;
&lt;br /&gt;
Select the plain device entry. Persistence works correctly and reliably via this path. The first persistence-enabled boot will be noticeably slower than usual since the system is running entirely from the USB key—and that’s normal. A USB 3.0 drive was used in the physical testing for this paper.&lt;br /&gt;
&lt;br /&gt;
If your machine has no legacy boot option and UEFI is the only available path, the problem can potentially be resolved from within a booted live session by correcting the GRUB prefix—but this is an advanced recovery procedure, not the standard setup path.&lt;br /&gt;
&lt;br /&gt;
== What went wrong, and why ==&lt;br /&gt;
I wish this was a straightforward tutorial, but it didn&#039;t go as smoothly as I&#039;d hoped. The pitfalls and troubleshooting can serve as useful reference. This section documents the full troubleshooting process that led to finding a working procedure. If you&#039;ve already hit &#039;&#039;&#039;grub&amp;gt; and given up, welcome to the club. If you&#039;re wondering why the obvious approaches don&#039;t work, read this first—it might save you several hours.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039;The symptom many seem to run into&#039;&#039;&#039; ===&lt;br /&gt;
The most common failure mode is this: you write the ISO, verify it boots, add the persistence partition, reboot—and instead of the Debian live menu you get a bare grub&amp;gt; prompt. Nothing you type seems to help. Running ls shows your internal disk&#039;s filesystem, but the USB&#039;s live partition is nowhere to be found.&lt;br /&gt;
&lt;br /&gt;
This is the point where you conclude that persistence is broken, that the USB stick is faulty, or that the procedure is wrong. That&#039;s not where the problem lies.&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039;The host OS red herring&#039;&#039;&#039; ===&lt;br /&gt;
The first machine used for testing had Ubuntu Server 24.04 installed on the internal SSD. Ubuntu&#039;s GRUB had registered itself as the primary EFI bootloader in the UEFI NVRAM. When the USB was selected in the boot menu, the firmware handed control to Ubuntu&#039;s GRUB rather than the USB&#039;s own EFI bootloader—even when the USB was explicitly chosen.&lt;br /&gt;
&lt;br /&gt;
From the &#039;&#039;&#039;grub&amp;gt;&#039;&#039;&#039; prompt, running :&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;grub&amp;gt; ls hd0,gpt2/&#039;&#039;&#039; contained Ubuntu&#039;s /boot partition with vmlinuz-6.8.0-106-generic, and &#039;&#039;&#039;hd0,gpt3&#039;&#039;&#039; contained Ubuntu&#039;s root filesystem. The USB&#039;s live partition was accessible on &#039;&#039;&#039;hd2&#039;&#039;&#039;, but Ubuntu&#039;s GRUB could not read the iso9660 filesystem on it—the module reported &amp;quot;unknown filesystem&amp;quot; on every attempt, even after loading iso9660.mod. The live kernel and initrd were completely unreachable from that prompt.&lt;br /&gt;
&lt;br /&gt;
The theory was that installing Debian 13 on the test machine would fix the problem. It resolved the host OS interference, but not the &#039;&#039;&#039;grub&amp;gt;&#039;&#039;&#039; problem. The only thing &amp;quot;persistent&amp;quot; about this setup was that after adding the persistence partition it persistently went back to &#039;&#039;&#039;grub&amp;gt;&#039;&#039;&#039; showing that the Ubuntu machine was a red herring obscuring the real problem.&lt;br /&gt;
&lt;br /&gt;
=== The partitioning tool failures ===&lt;br /&gt;
The Debian live ISO uses an isohybrid layout—a hybrid partition table that is valid as both an MBR and a GPT. This is why a single ISO can boot on both legacy BIOS and UEFI systems. It&#039;s also what makes adding a persistence partition not so straightforward.&lt;br /&gt;
&lt;br /&gt;
=== Three tools I tried before getting something to work ===&lt;br /&gt;
parted was the first try. It misreported the USB capacity entirely by reporting my 32GB ad 125GB, making it impossible to determine where the free space began or how large the persistence partition would be. Next...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gdisk/sgdisk&#039;&#039;&#039; was the next candidate, specifically because it is &#039;&#039;GPT-aware&#039;&#039; and should in theory handle a hybrid partition table better than fdisk. The output told a different story: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt; &#039;&#039;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Warning! Secondary partition table overlaps the last partition by 33 blocks!&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Could not create partition 3 from 14580 to 8177663&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Non-GPT disk; not saving changes. Use -g to override.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Error encountered; not saving changes.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt; The isohybrid layout places the secondary GPT partition table in a location that overlaps the last partition. sgdisk correctly identifies this as invalid and refuses to go any further. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk cannot be used here.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;cp&#039;&#039;&#039; was a last resort alternative to &#039;&#039;&#039;dd&#039;&#039;&#039; for writing the ISO, based on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout to dd. cp is not a solution—it&#039;s just a slower version of the same write operation. &lt;br /&gt;
&lt;br /&gt;
fdisk with its default n command also caused problems on earlier attempts—it prompted to remove an existing ext4 signature from a previous attempt and placed the partition in a way that triggered the UEFI firmware issue. The fix was to specify the start sector explicitly as 8176000, the sector immediately following the end of the ISO partition. This places the persistence partition cleanly in the unallocated space without touching any part of the isohybrid structure.&lt;br /&gt;
&lt;br /&gt;
=== Why the grub&amp;gt; prompt had me stumped ===&lt;br /&gt;
After adding the persistence partition with fdisk and rebooting, the machine consistently dropped to grub&amp;gt;. The assumption at this point was that the USB&#039;s own GRUB was loading but failing to find its configuration file—which is what the prompt suggests. &lt;br /&gt;
&lt;br /&gt;
In reality, the USB&#039;s GRUB was loading briefly (visible as three rapid flashes on screen with a &amp;quot;no such...&amp;quot; error), then failing, and the firmware was falling back to the internal Debian installation&#039;s GRUB, which then presented its own grub&amp;gt; prompt. The ls output confirmed this—the internal drive&#039;s EFI partition was visible as hd0,gpt1, not the USB. &lt;br /&gt;
&lt;br /&gt;
The USB&#039;s GRUB fails after partition table modification because many UEFI firmware implementations invalidate or reorder EFI boot entries when they detect a change to the partition table on a device. The USB&#039;s EFI entry—pointing to EFI/boot/bootx64.efi was effectively orphaned. The firmware no longer saw it as a valid boot option and fell through to the next entry, which was the internal drive. At least that’s my theory.&lt;br /&gt;
&lt;br /&gt;
== The solution: legacy boot ==&lt;br /&gt;
The boot menu on the test machine showed two entries for the USB:&amp;lt;blockquote&amp;gt;Choose this → &#039;&#039;&#039;&#039;&#039;SanDisk Cruzer Glide (29812MB)&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Not this → UEFI: SanDisk Cruzer Glide (29812MB)&#039;&#039;&amp;lt;/blockquote&amp;gt;The UEFI entry is the one that breaks after partition table changes. The plain entry uses the legacy MBR boot path, which is not affected by EFI boot entry invalidation. Selecting the legacy entry boots the USB&#039;s own GRUB directly via the MBR, which has zero dependency on the UEFI NVRAM and isn&#039;t affected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
Persistence works correctly and reliably via this path. The procedure itself—fdisk with an explicit sector, mkfs.ext4, persistence.conf—is valid. The only required change from most published guides is which boot entry you select in the firmware menu.&lt;br /&gt;
&lt;br /&gt;
== Clean the drive ==&lt;br /&gt;
If the USB has been used before, old partition signatures or bootloader data in the early sectors can cause problems—stale EFI entries or a leftover GRUB installation can interfere with the boot process even after a fresh ISO write. Clear them out first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;wipefs&#039;&#039;&#039; removes filesystem and partition table signatures. The &#039;&#039;&#039;dd&#039;&#039;&#039; zeros the first 200 MB, which covers the MBR, GPT header, and any EFI data that might otherwise survive a simple reformat. Then proceed with the ISO write.&lt;br /&gt;
&lt;br /&gt;
== Write the ISO to the USB drive ==&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The status=progress flag gives you a running transfer rate, otherwise you can&#039;t see it is working. The sync at the end flushes any remaining data from the write cache—don&#039;t pull the drive before it completes.&lt;br /&gt;
&lt;br /&gt;
This may take a few minutes depending on the speed of your drive, so be patient and don&#039;t be tempted to abort the process even if it appears to stall. When it finishes, the USB is bootable but stateless. The next steps add the persistence layer.&lt;br /&gt;
&lt;br /&gt;
Before continuing, verify the USB boots. Select the legacy (non-UEFI) entry for the USB in your firmware boot menu. This confirms the ISO write is clean and gives you a known-good baseline before you make any further changes. If it doesn&#039;t boot at this stage, stop and repeat Steps 1 and 2—don&#039;t proceed to the persistence steps until you have a confirmed working boot.&lt;br /&gt;
&lt;br /&gt;
== Create the persistence partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. You&#039;ll use fdisk to create a new partition there for persistence. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table—and the partition must be created with an explicit start sector to avoid corrupting that layout. Other partitioning tools (parted, gdisk) do not handle this correctly.&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once inside &#039;&#039;&#039;fdisk&#039;&#039;&#039;, print the current partition layout:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &#039;&#039;&#039;p&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll see two existing partitions—the main ISO partition (type 0 or Empty, which is normal for isohybrid) and a small 3.2 MB EFI partition.&lt;br /&gt;
&lt;br /&gt;
The persistence partition must start at the next sector after the last partition ends—on a Debian 13.4 live ISO this is sector 8176000, immediately after the ISO partition which ends at 8175999. &lt;br /&gt;
&lt;br /&gt;
Create the new partition:  &lt;br /&gt;
&lt;br /&gt;
Command (m for help): &#039;&#039;&#039;n&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
When prompted for the first sector, enter &#039;&#039;&#039;8176000&#039;&#039;&#039; rather than accepting the default.&lt;br /&gt;
&lt;br /&gt;
Accept the default for the last sector to use the remaining space.&lt;br /&gt;
&lt;br /&gt;
If &#039;&#039;&#039;fdisk&#039;&#039;&#039; asks whether to remove an existing ext4 signature, answer &#039;&#039;&#039;Y&#039;&#039;&#039;—this is a remnant from a previous attempt and should be cleared. &lt;br /&gt;
&lt;br /&gt;
Write the changes and exit: &lt;br /&gt;
&lt;br /&gt;
Command (m for help): &#039;&#039;&#039;w&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
If the system does not immediately recognize the new partition, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Format the persistence partition ==&lt;br /&gt;
Format the new partition as ext4 with the label &#039;&#039;&#039;persistence—the label is not&#039;&#039;&#039; a suggestion, the Debian live system looks for it by name at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdX3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace sdX3 with your actual partition identifier (for example, /dev/sdb3).&lt;br /&gt;
&lt;br /&gt;
== Create the persistence configuration file ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdX3 /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file that tells the live system what to persist:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;/ union&#039;&#039;&#039; directive mounts the entire filesystem as a union overlay—changes you make during a session are written to the persistence partition rather than lost when you shut down.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition cleanly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Boot with persistence ==&lt;br /&gt;
Boot your system from the USB drive, selecting the legacy &#039;&#039;&#039;(non-UEFI)&#039;&#039;&#039; entry in the firmware boot menu. At the Debian live GRUB menu, press the Tab key to edit the boot entry. Find the line beginning with linux and add persistence after boot=live components. Press Enter to boot into the live system.&lt;br /&gt;
&lt;br /&gt;
From this point on, any files you create, settings you change, or packages you install will survive across reboots—stored on the persistence partition rather than in the volatile live environment. The first boot with persistence active will be slower than a standard live session since the system is running entirely from the USB.&lt;br /&gt;
&lt;br /&gt;
== Verify persistence is working ==&lt;br /&gt;
After booting, check that the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see sdX3 mounted at /run/live/persistence/sdX3.&lt;br /&gt;
&lt;br /&gt;
Then create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot again with the persistence option enabled. If the file is there, persistence is working.&lt;br /&gt;
&lt;br /&gt;
Anonymity&lt;br /&gt;
&lt;br /&gt;
This is not a stealth tool. When used correctly, a Debian Live USB with persistence doesn&#039;t modify the host system—no files or logs are written to the internal disk unless you explicitly mount and use it. However, it does not provide anonymity or invisibility:&lt;br /&gt;
&lt;br /&gt;
* Boot events may be logged by firmware or enterprise systems&lt;br /&gt;
* USB usage may be detectable&lt;br /&gt;
* Network activity is visible to routers, ISPs, and organisations&lt;br /&gt;
* User actions can leave traces if internal drives are mounted&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A note on carrying data files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The persistence partition isn&#039;t just for system state. It&#039;s a practical place to keep working data—documents, scripts, utilities, configuration files—that you need available no matter which system you boot from. Think of it as your portable home directory. Anything you&#039;d normally keep in /Documents or /bin travels with the drive.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re working across machines with different hardware, keep in mind that installed packages persist but may have hardware-specific dependencies. For most desktop use this isn&#039;t an issue, but it&#039;s worth being aware of if you&#039;re installing drivers or kernel modules. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by distro-nix on Debian User Forums on 2026-04-06.&#039;&#039; Comments, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=222</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=222"/>
		<updated>2026-04-08T02:40:28Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: minir typos and headings&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created : 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Last Updated : 2026-04-07&lt;br /&gt;
&lt;br /&gt;
ID: 005146.10&lt;br /&gt;
&lt;br /&gt;
=== A persistent Debian live USB is one of those tools that can come in handy once you have it. Boot it on your own machine, a colleague&#039;s laptop, or a borrowed computer. It has your environment, your files, your settings, exactly where you left them. Nothing is written to the host machine, nothing left behind when you pull out the USB. ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The persistence layer is what makes all the difference: a standard live USB is stateless—helpful for recovery and installation, but each session starts fresh. By adding a persistence partition, you have a portable Debian installation: your shell configuration, your documents, your utilities, your scripts, your browser profile, all carried around in your pocket.&lt;br /&gt;
&lt;br /&gt;
This is also a practical solution when you&#039;re working across multiple machines but don&#039;t want to maintain separate installations on each. It&#039;s particularly useful for sysadmins who move between systems regularly, or anyone who needs a known-good Debian environment available on demand without depending on the host.&lt;br /&gt;
&lt;br /&gt;
== What you&#039;ll need ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum requirement is 4 GB, but that leaves you very little room for the persistence partition. The more you plan to store, the larger the drive should be. A 32 GB drive gives you a nice working space.&lt;br /&gt;
&lt;br /&gt;
Download the latest Debian Live ISO from the official Debian website at &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;.  Choose the release and desktop environment that suits you, or the minimal image if you want to keep it lean.&lt;br /&gt;
&lt;br /&gt;
you&#039;ll be working entirely in the terminal on a GNU/Linux system. The tools you need: &#039;&#039;&#039;dd, fdisk, and mkfs.ext4&#039;&#039;&#039;—are all standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Check first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They are small, standard packages and will be in the live session&#039;s apt cache without needing to add sources. Neither persists to the USB unless you&#039;re already booted with persistence active, so install them in the same session you&#039;re doing the setup.&lt;br /&gt;
&lt;br /&gt;
A word about dd before you start&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dd&#039;&#039;&#039; has the nickname of &amp;quot;disk destroyer&amp;quot; because whatever is in the of= (output file) if you mistype is gone. dd writes directly to block devices with no undo—confirm your device identifier before running the command.&lt;br /&gt;
&lt;br /&gt;
Plug in the USB drive, open the terminal, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look for your USB device in the output—it will appear as /dev/sdb, /dev/sdc, or similar depending on what else you have attached.&lt;br /&gt;
&lt;br /&gt;
Cross-reference the size to confirm you have the right device. In the commands that follow, /dev/sdX is a placeholder—replace it with your actual device identifier every time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the device itself (e.g. /dev/sdb), not a partition such as /dev/sdb1. &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Another trap worth knowing: if your shell has a sync alias defined—from an old backup script, for example—the &amp;amp;&amp;amp; sync at the end of the dd command will silently call that alias instead of /usr/bin/sync, leaving the write cache unflushed. You&#039;d never know from the output. Before running dd, confirm you&#039;re getting the real thing:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should return sync is /usr/bin/sync. If it returns an alias definition instead, either unalias it with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ unalias sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or call the binary directly with &#039;&#039;&#039;/usr/bin/sync&#039;&#039;&#039; at the end of your &#039;&#039;&#039;dd&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
== A note on UEFI ==&lt;br /&gt;
I found out the long, hard way that UEFI firmware causes persistent problems with live USB booting, particularly after the partition table on the USB has been modified. The symptom is consistent: the machine drops to a &#039;&#039;&#039;grub&amp;gt; prompt on boot, and the internal disk&#039;s filesystem is visible while the USB&#039;s live partition is&#039;&#039;&#039; unreachable. On some firmware implementations, adding a partition to the USB invalidates its EFI boot entry, causing the firmware to fall back to the internal drive&#039;s bootloader—even when you explicitly select the USB in the boot menu.&lt;br /&gt;
&lt;br /&gt;
This isn&#039;t a problem with the USB, the ISO, or the persistence setup. It is a firmware behavior that seems to affect a wide range of hardware.&lt;br /&gt;
&lt;br /&gt;
During testing, both parted and &#039;&#039;&#039;gdisk/sgdisk were&#039;&#039;&#039; used. parted misreported the USB capacity. sgdisk detected an invalid GPT with an overlapping secondary partition table and refused to proceed. &#039;&#039;&#039;fdisk with an explicit partition start sector is the only tool that works cleanly with the Debian live ISO&#039;s isohybrid layout.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When selecting your USB drive from the firmware boot menu, always choose the plain device entry—not the one prefixed with &amp;quot;UEFI:&amp;quot;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Most firmware boot menus show two entries for a USB device—one labelled simply with the device name (legacy MBR boot) and one prefixed with &amp;quot;UEFI:&amp;quot;.&#039;&#039;&#039; Most people choose the UEFI entry because they have modern hardware. But it is not the case here.&lt;br /&gt;
&lt;br /&gt;
When you think of &amp;quot;Legacy boot&amp;quot; in this context, it doesn&#039;t mean out of date or inferior. It means a different bootloader handoff mechanism—one that isn&#039;t broken by partition table changes. The Debian Live GRUB it loads is identical in any case. You&#039;re not giving anything up by choosing it over UEFI.&lt;br /&gt;
&lt;br /&gt;
Select the plain device entry. Persistence works correctly and reliably via this path. The first persistence-enabled boot will be noticeably slower than usual since the system is running entirely from the USB key—and that’s normal. A USB 3.0 drive was used in the physical testing for this paper.&lt;br /&gt;
&lt;br /&gt;
If your machine has no legacy boot option and UEFI is the only available path, the problem can potentially be resolved from within a booted live session by correcting the GRUB prefix—but this is an advanced recovery procedure, not the standard setup path.&lt;br /&gt;
&lt;br /&gt;
== What went wrong, and why ==&lt;br /&gt;
I wish this was a straightforward tutorial, but it didn&#039;t go as smoothly as I&#039;d hoped. The pitfalls and troubleshooting can serve as useful reference. This section documents the full troubleshooting process that led to finding a working procedure. If you&#039;ve already hit &#039;&#039;&#039;grub&amp;gt; and given up, welcome to the club. If you&#039;re wondering why the obvious approaches don&#039;t work, read this first—it might save you several hours.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039;The symptom many seem to run into&#039;&#039;&#039; ===&lt;br /&gt;
The most common failure mode is this: you write the ISO, verify it boots, add the persistence partition, reboot—and instead of the Debian live menu you get a bare grub&amp;gt; prompt. Nothing you type seems to help. Running ls shows your internal disk&#039;s filesystem, but the USB&#039;s live partition is nowhere to be found.&lt;br /&gt;
&lt;br /&gt;
This is the point where you conclude that persistence is broken, that the USB stick is faulty, or that the procedure is wrong. That&#039;s not where the problem lies.&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039;The host OS red herring&#039;&#039;&#039; ===&lt;br /&gt;
The first machine used for testing had Ubuntu Server 24.04 installed on the internal SSD. Ubuntu&#039;s GRUB had registered itself as the primary EFI bootloader in the UEFI NVRAM. When the USB was selected in the boot menu, the firmware handed control to Ubuntu&#039;s GRUB rather than the USB&#039;s own EFI bootloader—even when the USB was explicitly chosen.&lt;br /&gt;
&lt;br /&gt;
From the &#039;&#039;&#039;grub&amp;gt;&#039;&#039;&#039; prompt, running :&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;grub&amp;gt; ls hd0,gpt2/&#039;&#039;&#039; contained Ubuntu&#039;s /boot partition with vmlinuz-6.8.0-106-generic, and &#039;&#039;&#039;hd0,gpt3&#039;&#039;&#039; contained Ubuntu&#039;s root filesystem. The USB&#039;s live partition was accessible on &#039;&#039;&#039;hd2&#039;&#039;&#039;, but Ubuntu&#039;s GRUB could not read the iso9660 filesystem on it—the module reported &amp;quot;unknown filesystem&amp;quot; on every attempt, even after loading iso9660.mod. The live kernel and initrd were completely unreachable from that prompt.&lt;br /&gt;
&lt;br /&gt;
The theory was that installing Debian 13 on the test machine would fix the problem. It resolved the host OS interference, but not the &#039;&#039;&#039;grub&amp;gt;&#039;&#039;&#039; problem. The only thing &amp;quot;persistent&amp;quot; about this setup was that after adding the persistence partition it persistently went back to &#039;&#039;&#039;grub&amp;gt;&#039;&#039;&#039; showing that the Ubuntu machine was a red herring obscuring the real problem.&lt;br /&gt;
&lt;br /&gt;
=== The partitioning tool failures ===&lt;br /&gt;
The Debian live ISO uses an isohybrid layout—a hybrid partition table that is valid as both an MBR and a GPT. This is why a single ISO can boot on both legacy BIOS and UEFI systems. It&#039;s also what makes adding a persistence partition not so straightforward.&lt;br /&gt;
&lt;br /&gt;
=== Three tools I tried before getting something to work ===&lt;br /&gt;
parted was the first try. It misreported the USB capacity entirely by reporting my 32GB ad 125GB, making it impossible to determine where the free space began or how large the persistence partition would be. Next...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gdisk/sgdisk&#039;&#039;&#039; was the next candidate, specifically because it is &#039;&#039;GPT-aware&#039;&#039; and should in theory handle a hybrid partition table better than fdisk. The output told a different story: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt; &#039;&#039;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Warning! Secondary partition table overlaps the last partition by 33 blocks!&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Could not create partition 3 from 14580 to 8177663&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Non-GPT disk; not saving changes. Use -g to override.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Error encountered; not saving changes.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt; The isohybrid layout places the secondary GPT partition table in a location that overlaps the last partition. sgdisk correctly identifies this as invalid and refuses to go any further. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk cannot be used here.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;cp&#039;&#039;&#039; was a last resort alternative to &#039;&#039;&#039;dd&#039;&#039;&#039; for writing the ISO, based on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout to dd. cp is not a solution—it&#039;s just a slower version of the same write operation. &lt;br /&gt;
&lt;br /&gt;
fdisk with its default n command also caused problems on earlier attempts—it prompted to remove an existing ext4 signature from a previous attempt and placed the partition in a way that triggered the UEFI firmware issue. The fix was to specify the start sector explicitly as 8176000, the sector immediately following the end of the ISO partition. This places the persistence partition cleanly in the unallocated space without touching any part of the isohybrid structure.&lt;br /&gt;
&lt;br /&gt;
=== Why the grub&amp;gt; prompt had me stumped ===&lt;br /&gt;
After adding the persistence partition with fdisk and rebooting, the machine consistently dropped to grub&amp;gt;. The assumption at this point was that the USB&#039;s own GRUB was loading but failing to find its configuration file—which is what the prompt suggests. &lt;br /&gt;
&lt;br /&gt;
In reality, the USB&#039;s GRUB was loading briefly (visible as three rapid flashes on screen with a &amp;quot;no such...&amp;quot; error), then failing, and the firmware was falling back to the internal Debian installation&#039;s GRUB, which then presented its own grub&amp;gt; prompt. The ls output confirmed this—the internal drive&#039;s EFI partition was visible as hd0,gpt1, not the USB. &lt;br /&gt;
&lt;br /&gt;
The USB&#039;s GRUB fails after partition table modification because many UEFI firmware implementations invalidate or reorder EFI boot entries when they detect a change to the partition table on a device. The USB&#039;s EFI entry—pointing to EFI/boot/bootx64.efi was effectively orphaned. The firmware no longer saw it as a valid boot option and fell through to the next entry, which was the internal drive. At least that’s my theory.&lt;br /&gt;
&lt;br /&gt;
== The solution: legacy boot ==&lt;br /&gt;
The boot menu on the test machine showed two entries for the USB:&amp;lt;blockquote&amp;gt;Choose this → &#039;&#039;&#039;&#039;&#039;SanDisk Cruzer Glide (29812MB)&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Not this → UEFI: SanDisk Cruzer Glide (29812MB)&#039;&#039;&amp;lt;/blockquote&amp;gt;The UEFI entry is the one that breaks after partition table changes. The plain entry uses the legacy MBR boot path, which is not affected by EFI boot entry invalidation. Selecting the legacy entry boots the USB&#039;s own GRUB directly via the MBR, which has zero dependency on the UEFI NVRAM and isn&#039;t affected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
Persistence works correctly and reliably via this path. The procedure itself—fdisk with an explicit sector, mkfs.ext4, persistence.conf—is valid. The only required change from most published guides is which boot entry you select in the firmware menu.&lt;br /&gt;
&lt;br /&gt;
== Step 1—Clean the drive ==&lt;br /&gt;
If the USB has been used before, old partition signatures or bootloader data in the early sectors can cause problems—stale EFI entries or a leftover GRUB installation can interfere with the boot process even after a fresh ISO write. Clear them out first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;wipefs&#039;&#039;&#039; removes filesystem and partition table signatures. The &#039;&#039;&#039;dd&#039;&#039;&#039; zeros the first 200 MB, which covers the MBR, GPT header, and any EFI data that might otherwise survive a simple reformat. Then proceed with the ISO write.&lt;br /&gt;
&lt;br /&gt;
== Step 2—Write the ISO to the USB drive ==&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The status=progress flag gives you a running transfer rate, otherwise you can&#039;t see it is working. The sync at the end flushes any remaining data from the write cache—don&#039;t pull the drive before it completes.&lt;br /&gt;
&lt;br /&gt;
This may take a few minutes depending on the speed of your drive, so be patient and don&#039;t be tempted to abort the process even if it appears to stall. When it finishes, the USB is bootable but stateless. The next steps add the persistence layer.&lt;br /&gt;
&lt;br /&gt;
Before continuing, verify the USB boots. Select the legacy (non-UEFI) entry for the USB in your firmware boot menu. This confirms the ISO write is clean and gives you a known-good baseline before you make any further changes. If it doesn&#039;t boot at this stage, stop and repeat Steps 1 and 2—don&#039;t proceed to the persistence steps until you have a confirmed working boot.&lt;br /&gt;
&lt;br /&gt;
== Step 3—Create the persistence partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. You&#039;ll use fdisk to create a new partition there for persistence. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table—and the partition must be created with an explicit start sector to avoid corrupting that layout. Other partitioning tools (parted, gdisk) do not handle this correctly.&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once inside &#039;&#039;&#039;fdisk&#039;&#039;&#039;, print the current partition layout:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &#039;&#039;&#039;p&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll see two existing partitions—the main ISO partition (type 0 or Empty, which is normal for isohybrid) and a small 3.2 MB EFI partition.&lt;br /&gt;
&lt;br /&gt;
The persistence partition must start at the next sector after the last partition ends—on a Debian 13.4 live ISO this is sector 8176000, immediately after the ISO partition which ends at 8175999. &lt;br /&gt;
&lt;br /&gt;
Create the new partition:  &lt;br /&gt;
&lt;br /&gt;
Command (m for help): &#039;&#039;&#039;n&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
When prompted for the first sector, enter &#039;&#039;&#039;8176000&#039;&#039;&#039; rather than accepting the default.&lt;br /&gt;
&lt;br /&gt;
Accept the default for the last sector to use the remaining space.&lt;br /&gt;
&lt;br /&gt;
If &#039;&#039;&#039;fdisk&#039;&#039;&#039; asks whether to remove an existing ext4 signature, answer &#039;&#039;&#039;Y&#039;&#039;&#039;—this is a remnant from a previous attempt and should be cleared. &lt;br /&gt;
&lt;br /&gt;
Write the changes and exit: &lt;br /&gt;
&lt;br /&gt;
Command (m for help): &#039;&#039;&#039;w&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
If the system does not immediately recognize the new partition, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4—Format the persistence partition ==&lt;br /&gt;
Format the new partition as ext4 with the label &#039;&#039;&#039;persistence—the label is not&#039;&#039;&#039; a suggestion, the Debian live system looks for it by name at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdX3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace sdX3 with your actual partition identifier (for example, /dev/sdb3).&lt;br /&gt;
&lt;br /&gt;
== Step 5—Create the persistence configuration file ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdX3 /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file that tells the live system what to persist:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;/ union&#039;&#039;&#039; directive mounts the entire filesystem as a union overlay—changes you make during a session are written to the persistence partition rather than lost when you shut down.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition cleanly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 6—Boot with persistence ==&lt;br /&gt;
Boot your system from the USB drive, selecting the legacy &#039;&#039;&#039;(non-UEFI)&#039;&#039;&#039; entry in the firmware boot menu. At the Debian live GRUB menu, press the Tab key to edit the boot entry. Find the line beginning with linux and add persistence after boot=live components. Press Enter to boot into the live system.&lt;br /&gt;
&lt;br /&gt;
From this point on, any files you create, settings you change, or packages you install will survive across reboots—stored on the persistence partition rather than in the volatile live environment. The first boot with persistence active will be slower than a standard live session since the system is running entirely from the USB.&lt;br /&gt;
&lt;br /&gt;
== Step 7—Verify persistence is working ==&lt;br /&gt;
After booting, check that the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see sdX3 mounted at /run/live/persistence/sdX3.&lt;br /&gt;
&lt;br /&gt;
Then create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot again with the persistence option enabled. If the file is there, persistence is working.&lt;br /&gt;
&lt;br /&gt;
Anonymity&lt;br /&gt;
&lt;br /&gt;
This is not a stealth tool. When used correctly, a Debian Live USB with persistence doesn&#039;t modify the host system—no files or logs are written to the internal disk unless you explicitly mount and use it. However, it does not provide anonymity or invisibility:&lt;br /&gt;
&lt;br /&gt;
* Boot events may be logged by firmware or enterprise systems&lt;br /&gt;
* USB usage may be detectable&lt;br /&gt;
* Network activity is visible to routers, ISPs, and organisations&lt;br /&gt;
* User actions can leave traces if internal drives are mounted&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A note on carrying data files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The persistence partition isn&#039;t just for system state. It&#039;s a practical place to keep working data—documents, scripts, utilities, configuration files—that you need available no matter which system you boot from. Think of it as your portable home directory. Anything you&#039;d normally keep in /Documents or /bin travels with the drive.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re working across machines with different hardware, keep in mind that installed packages persist but may have hardware-specific dependencies. For most desktop use this isn&#039;t an issue, but it&#039;s worth being aware of if you&#039;re installing drivers or kernel modules. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by distro-nix on Debian User Forums on 2026-04-06.&#039;&#039; Comments, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=221</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=221"/>
		<updated>2026-04-08T02:25:01Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: Rewrite for new tools&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created : 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Last Updated : 2026-04-07&lt;br /&gt;
&lt;br /&gt;
ID: 005146.10&lt;br /&gt;
&lt;br /&gt;
=== A persistent Debian live USB is one of those tools that can come in handy once you have it. Boot it on your own machine, a colleague&#039;s laptop, or a borrowed computer. It has your environment, your files, your settings, exactly where you left them. Nothing is written to the host machine, nothing left behind when you pull out the USB. ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The persistence layer is what makes all the difference: a standard live USB is stateless—helpful for recovery and installation, but each session starts fresh. By adding a persistence partition, you have a portable Debian installation: your shell configuration, your documents, your utilities, your scripts, your browser profile, all carried around in your pocket.&lt;br /&gt;
&lt;br /&gt;
This is also a practical solution when you&#039;re working across multiple machines but don&#039;t want to maintain separate installations on each. It&#039;s particularly useful for sysadmins who move between systems regularly, or anyone who needs a known-good Debian environment available on demand without depending on the host.&lt;br /&gt;
&lt;br /&gt;
What you&#039;ll need&lt;br /&gt;
&lt;br /&gt;
A USB drive of at least 8 GB—the minimum requirement is 4 GB, but that leaves you very little room for the persistence partition. The more you plan to store, the larger the drive should be. A 32 GB drive gives you a nice working space.&lt;br /&gt;
&lt;br /&gt;
Download the latest Debian Live ISO from the official Debian website at &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt;.  Choose the release and desktop environment that suits you, or the minimal image if you want to keep it lean.&lt;br /&gt;
&lt;br /&gt;
you&#039;ll be working entirely in the terminal on a GNU/Linux system. The tools you need: &#039;&#039;&#039;dd, fdisk, and mkfs.ext4&#039;&#039;&#039;—are all standard on Debian. On a minimal live environment, fdisk and mkfs.ext4 may not be present. Check first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo apt install fdisk e2fsprogs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They are small, standard packages and will be in the live session&#039;s apt cache without needing to add sources. Neither persists to the USB unless you&#039;re already booted with persistence active, so install them in the same session you&#039;re doing the setup.&lt;br /&gt;
&lt;br /&gt;
A word about dd before you start&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dd&#039;&#039;&#039; has the nickname of &amp;quot;disk destroyer&amp;quot; because whatever is in the of= (output file) if you mistype is gone. dd writes directly to block devices with no undo—confirm your device identifier before running the command.&lt;br /&gt;
&lt;br /&gt;
Plug in the USB drive, open the terminal, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look for your USB device in the output—it will appear as /dev/sdb, /dev/sdc, or similar depending on what else you have attached.&lt;br /&gt;
&lt;br /&gt;
Cross-reference the size to confirm you have the right device. In the commands that follow, /dev/sdX is a placeholder—replace it with your actual device identifier every time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the device itself (e.g. /dev/sdb), not a partition such as /dev/sdb1. &#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Another trap worth knowing: if your shell has a sync alias defined—from an old backup script, for example—the &amp;amp;&amp;amp; sync at the end of the dd command will silently call that alias instead of /usr/bin/sync, leaving the write cache unflushed. You&#039;d never know from the output. Before running dd, confirm you&#039;re getting the real thing:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ type sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should return sync is /usr/bin/sync. If it returns an alias definition instead, either unalias it with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ unalias sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or call the binary directly with &#039;&#039;&#039;/usr/bin/sync&#039;&#039;&#039; at the end of your &#039;&#039;&#039;dd&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
== A note on UEFI ==&lt;br /&gt;
I found out the long, hard way that UEFI firmware causes persistent problems with live USB booting, particularly after the partition table on the USB has been modified. The symptom is consistent: the machine drops to a &#039;&#039;&#039;grub&amp;gt; prompt on boot, and the internal disk&#039;s filesystem is visible while the USB&#039;s live partition is&#039;&#039;&#039; unreachable. On some firmware implementations, adding a partition to the USB invalidates its EFI boot entry, causing the firmware to fall back to the internal drive&#039;s bootloader—even when you explicitly select the USB in the boot menu.&lt;br /&gt;
&lt;br /&gt;
This isn&#039;t a problem with the USB, the ISO, or the persistence setup. It is a firmware behavior that seems to affect a wide range of hardware.&lt;br /&gt;
&lt;br /&gt;
During testing, both parted and &#039;&#039;&#039;gdisk/sgdisk were&#039;&#039;&#039; used. parted misreported the USB capacity. sgdisk detected an invalid GPT with an overlapping secondary partition table and refused to proceed. &#039;&#039;&#039;fdisk with an explicit partition start sector is the only tool that works cleanly with the Debian live ISO&#039;s isohybrid layout.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When selecting your USB drive from the firmware boot menu, always choose the plain device entry—not the one prefixed with &amp;quot;UEFI:&amp;quot;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Most firmware boot menus show two entries for a USB device—one labelled simply with the device name (legacy MBR boot) and one prefixed with &amp;quot;UEFI:&amp;quot;.&#039;&#039;&#039; Most people choose the UEFI entry because they have modern hardware. But it is not the case here.&lt;br /&gt;
&lt;br /&gt;
When you think of &amp;quot;Legacy boot&amp;quot; in this context, it doesn&#039;t mean out of date or inferior. It means a different bootloader handoff mechanism—one that isn&#039;t broken by partition table changes. The Debian Live GRUB it loads is identical in any case. You&#039;re not giving anything up by choosing it over UEFI.&lt;br /&gt;
&lt;br /&gt;
Select the plain device entry. Persistence works correctly and reliably via this path. The first persistence-enabled boot will be noticeably slower than usual since the system is running entirely from the USB key—and that’s normal. A USB 3.0 drive was used in the physical testing for this paper.&lt;br /&gt;
&lt;br /&gt;
If your machine has no legacy boot option and UEFI is the only available path, the problem can potentially be resolved from within a booted live session by correcting the GRUB prefix—but this is an advanced recovery procedure, not the standard setup path.&lt;br /&gt;
&lt;br /&gt;
What went wrong, and why—a diagnostic record&lt;br /&gt;
&lt;br /&gt;
I wish this was a straightforward tutorial, but it didn&#039;t go as smoothly as I&#039;d hoped. The pitfalls and troubleshooting can serve as useful reference. This section documents the full troubleshooting process that led to finding a working procedure. If you&#039;ve already hit &#039;&#039;&#039;grub&amp;gt; and given up, welcome to the club. If you&#039;re wondering why the obvious approaches don&#039;t work, read this first—it might save you several hours.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039;The symptom everyone hits&#039;&#039;&#039; ===&lt;br /&gt;
The most common failure mode is this: you write the ISO, verify it boots, add the persistence partition, reboot—and instead of the Debian live menu you get a bare grub&amp;gt; prompt. Nothing you type seems to help. Running ls shows your internal disk&#039;s filesystem, but the USB&#039;s live partition is nowhere to be found.&lt;br /&gt;
&lt;br /&gt;
This is the point where you conclude that persistence is broken, that the USB stick is faulty, or that the procedure is wrong. That&#039;s not where the problem lies.&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039;The host OS red herring&#039;&#039;&#039; ===&lt;br /&gt;
The first machine used for testing had Ubuntu Server 24.04 installed on the internal SSD. Ubuntu&#039;s GRUB had registered itself as the primary EFI bootloader in the UEFI NVRAM. When the USB was selected in the boot menu, the firmware handed control to Ubuntu&#039;s GRUB rather than the USB&#039;s own EFI bootloader—even when the USB was explicitly chosen.&lt;br /&gt;
&lt;br /&gt;
From the &#039;&#039;&#039;grub&amp;gt;&#039;&#039;&#039; prompt, running :&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;grub&amp;gt; ls hd0,gpt2/&#039;&#039;&#039; contained Ubuntu&#039;s /boot partition with vmlinuz-6.8.0-106-generic, and &#039;&#039;&#039;hd0,gpt3&#039;&#039;&#039; contained Ubuntu&#039;s root filesystem. The USB&#039;s live partition was accessible on &#039;&#039;&#039;hd2&#039;&#039;&#039;, but Ubuntu&#039;s GRUB could not read the iso9660 filesystem on it—the module reported &amp;quot;unknown filesystem&amp;quot; on every attempt, even after loading iso9660.mod. The live kernel and initrd were completely unreachable from that prompt.&lt;br /&gt;
&lt;br /&gt;
The theory was that installing Debian 13 on the test machine would fix the problem. It resolved the host OS interference, but not the &#039;&#039;&#039;grub&amp;gt;&#039;&#039;&#039; problem. The only thing &amp;quot;persistent&amp;quot; about this setup was that after adding the persistence partition it persistently went back to &#039;&#039;&#039;grub&amp;gt;&#039;&#039;&#039; showing that the Ubuntu machine was a red herring obscuring the real problem.&lt;br /&gt;
&lt;br /&gt;
The partitioning tool failures&lt;br /&gt;
&lt;br /&gt;
The Debian live ISO uses an isohybrid layout—a hybrid partition table that is valid as both an MBR and a GPT. This is why a single ISO can boot on both legacy BIOS and UEFI systems. It&#039;s also what makes adding a persistence partition not so straightforward.&lt;br /&gt;
&lt;br /&gt;
Three tools were tried before getting something that worked.&lt;br /&gt;
&lt;br /&gt;
parted was the first try. It misreported the USB capacity entirely by reporting my 32GB ad 125GB, making it impossible to determine where the free space began or how large the persistence partition would be. Next...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;gdisk/sgdisk&#039;&#039;&#039; was the next candidate, specifically because it is &#039;&#039;GPT-aware&#039;&#039; and should in theory handle a hybrid partition table better than fdisk. The output told a different story: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt; &#039;&#039;Found invalid GPT and valid MBR; converting MBR to GPT format in memory.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Warning! Secondary partition table overlaps the last partition by 33 blocks!&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Could not create partition 3 from 14580 to 8177663&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Non-GPT disk; not saving changes. Use -g to override.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;Error encountered; not saving changes.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt; The isohybrid layout places the secondary GPT partition table in a location that overlaps the last partition. sgdisk correctly identifies this as invalid and refuses to go any further. Using -g to override would corrupt the hybrid layout and break the boot. sgdisk cannot be used here.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;cp&#039;&#039;&#039; was tried as a last resort alternative to &#039;&#039;&#039;dd&#039;&#039;&#039; for writing the ISO, based on the theory that it might handle the isohybrid structure differently. It produced an identical partition layout to dd. cp is not a solution—it&#039;s just a slower version of the same write operation. &lt;br /&gt;
&lt;br /&gt;
fdisk with its default n command also caused problems on earlier attempts—it prompted to remove an existing ext4 signature from a previous attempt and placed the partition in a way that triggered the UEFI firmware issue. The fix was to specify the start sector explicitly as 8176000, the sector immediately following the end of the ISO partition. This places the persistence partition cleanly in the unallocated space without touching any part of the isohybrid structure.&lt;br /&gt;
&lt;br /&gt;
Why the grub&amp;gt; prompt had me stumped&lt;br /&gt;
&lt;br /&gt;
After adding the persistence partition with fdisk and rebooting, the machine consistently dropped to grub&amp;gt;. The assumption at this point was that the USB&#039;s own GRUB was loading but failing to find its configuration file—which is what the prompt suggests. &lt;br /&gt;
&lt;br /&gt;
In reality, the USB&#039;s GRUB was loading briefly (visible as three rapid flashes on screen with a &amp;quot;no such...&amp;quot; error), then failing, and the firmware was falling back to the internal Debian installation&#039;s GRUB, which then presented its own grub&amp;gt; prompt. The ls output confirmed this—the internal drive&#039;s EFI partition was visible as hd0,gpt1, not the USB. &lt;br /&gt;
&lt;br /&gt;
The USB&#039;s GRUB fails after partition table modification because many UEFI firmware implementations invalidate or reorder EFI boot entries when they detect a change to the partition table on a device. The USB&#039;s EFI entry—pointing to EFI/boot/bootx64.efi was effectively orphaned. The firmware no longer saw it as a valid boot option and fell through to the next entry, which was the internal drive. At least that’s my theory.&lt;br /&gt;
&lt;br /&gt;
The solution: legacy boot&lt;br /&gt;
&lt;br /&gt;
The boot menu on the test machine showed two entries for the USB:&lt;br /&gt;
&lt;br /&gt;
Choose this → &#039;&#039;&#039;&#039;&#039;SanDisk Cruzer Glide (29812MB)&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Not this → UEFI: SanDisk Cruzer Glide (29812MB)&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The UEFI entry is the one that breaks after partition table changes. The plain entry uses the legacy MBR boot path, which is not affected by EFI boot entry invalidation. Selecting the legacy entry boots the USB&#039;s own GRUB directly via the MBR, which has zero dependency on the UEFI NVRAM and isn&#039;t affected by partition table changes.&lt;br /&gt;
&lt;br /&gt;
Persistence works correctly and reliably via this path. The procedure itself—fdisk with an explicit sector, mkfs.ext4, persistence.conf—is valid. The only required change from most published guides is which boot entry you select in the firmware menu.&lt;br /&gt;
&lt;br /&gt;
== Step 1—Clean the drive ==&lt;br /&gt;
If the USB has been used before, old partition signatures or bootloader data in the early sectors can cause problems—stale EFI entries or a leftover GRUB installation can interfere with the boot process even after a fresh ISO write. Clear them out first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo wipefs -a /dev/sdX  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/dev/zero of=/dev/sdX bs=1M count=200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;wipefs&#039;&#039;&#039; removes filesystem and partition table signatures. The &#039;&#039;&#039;dd&#039;&#039;&#039; zeros the first 200 MB, which covers the MBR, GPT header, and any EFI data that might otherwise survive a simple reformat. Then proceed with the ISO write.&lt;br /&gt;
&lt;br /&gt;
== Step 2—Write the ISO to the USB drive ==&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The status=progress flag gives you a running transfer rate, otherwise you can&#039;t see it is working. The sync at the end flushes any remaining data from the write cache—don&#039;t pull the drive before it completes.&lt;br /&gt;
&lt;br /&gt;
This may take a few minutes depending on the speed of your drive, so be patient and don&#039;t be tempted to abort the process even if it appears to stall. When it finishes, the USB is bootable but stateless. The next steps add the persistence layer.&lt;br /&gt;
&lt;br /&gt;
Before continuing, verify the USB boots. Select the legacy (non-UEFI) entry for the USB in your firmware boot menu. This confirms the ISO write is clean and gives you a known-good baseline before you make any further changes. If it doesn&#039;t boot at this stage, stop and repeat Steps 1 and 2—don&#039;t proceed to the persistence steps until you have a confirmed working boot.&lt;br /&gt;
&lt;br /&gt;
== Step 3—Create the persistence partition ==&lt;br /&gt;
The ISO write leaves unallocated space at the end of the drive. You&#039;ll use fdisk to create a new partition there for persistence. The Debian live ISO uses an isohybrid layout—a hybrid MBR/GPT partition table—and the partition must be created with an explicit start sector to avoid corrupting that layout. Other partitioning tools (parted, gdisk) do not handle this correctly.&lt;br /&gt;
&lt;br /&gt;
Launch fdisk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo fdisk /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once inside &#039;&#039;&#039;fdisk&#039;&#039;&#039;, print the current partition layout:&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &#039;&#039;&#039;p&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll see two existing partitions—the main ISO partition (type 0 or Empty, which is normal for isohybrid) and a small 3.2 MB EFI partition.&lt;br /&gt;
&lt;br /&gt;
The persistence partition must start at the next sector after the last partition ends—on a Debian 13.4 live ISO this is sector 8176000, immediately after the ISO partition which ends at 8175999. &lt;br /&gt;
&lt;br /&gt;
Create the new partition:  &lt;br /&gt;
&lt;br /&gt;
Command (m for help): &#039;&#039;&#039;n&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
When prompted for the first sector, enter &#039;&#039;&#039;8176000&#039;&#039;&#039; rather than accepting the default.&lt;br /&gt;
&lt;br /&gt;
Accept the default for the last sector to use the remaining space.&lt;br /&gt;
&lt;br /&gt;
If &#039;&#039;&#039;fdisk&#039;&#039;&#039; asks whether to remove an existing ext4 signature, answer &#039;&#039;&#039;Y&#039;&#039;&#039;—this is a remnant from a previous attempt and should be cleared. &lt;br /&gt;
&lt;br /&gt;
Write the changes and exit: &lt;br /&gt;
&lt;br /&gt;
Command (m for help): &#039;&#039;&#039;w&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
If the system does not immediately recognize the new partition, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo partprobe&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4—Format the persistence partition ==&lt;br /&gt;
Format the new partition as ext4 with the label &#039;&#039;&#039;persistence—the label is not&#039;&#039;&#039; a suggestion, the Debian live system looks for it by name at boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mkfs.ext4 -L persistence /dev/sdX3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace sdX3 with your actual partition identifier (for example, /dev/sdb3).&lt;br /&gt;
&lt;br /&gt;
== Step 5—Create the persistence configuration file ==&lt;br /&gt;
Mount the partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo mount /dev/sdX3 /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the configuration file that tells the live system what to persist:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;/ union&#039;&#039;&#039; directive mounts the entire filesystem as a union overlay—changes you make during a session are written to the persistence partition rather than lost when you shut down.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition cleanly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ sudo umount /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 6—Boot with persistence ==&lt;br /&gt;
Boot your system from the USB drive, selecting the legacy &#039;&#039;&#039;(non-UEFI)&#039;&#039;&#039; entry in the firmware boot menu. At the Debian live GRUB menu, press the Tab key to edit the boot entry. Find the line beginning with linux and add persistence after boot=live components. Press Enter to boot into the live system.&lt;br /&gt;
&lt;br /&gt;
From this point on, any files you create, settings you change, or packages you install will survive across reboots—stored on the persistence partition rather than in the volatile live environment. The first boot with persistence active will be slower than a standard live session since the system is running entirely from the USB.&lt;br /&gt;
&lt;br /&gt;
== Step 7—Verify persistence is working ==&lt;br /&gt;
After booting, check that the persistence partition is mounted:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lsblk -f&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see sdX3 mounted at /run/live/persistence/sdX3.&lt;br /&gt;
&lt;br /&gt;
Then create a test file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ touch ~/persistence-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot again with the persistence option enabled. If the file is there, persistence is working.&lt;br /&gt;
&lt;br /&gt;
Anonymity&lt;br /&gt;
&lt;br /&gt;
This is not a stealth tool. When used correctly, a Debian Live USB with persistence doesn&#039;t modify the host system—no files or logs are written to the internal disk unless you explicitly mount and use it. However, it does not provide anonymity or invisibility:&lt;br /&gt;
&lt;br /&gt;
* Boot events may be logged by firmware or enterprise systems&lt;br /&gt;
* USB usage may be detectable&lt;br /&gt;
* Network activity is visible to routers, ISPs, and organisations&lt;br /&gt;
* User actions can leave traces if internal drives are mounted&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A note on carrying data files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The persistence partition isn&#039;t just for system state. It&#039;s a practical place to keep working data—documents, scripts, utilities, configuration files—that you need available no matter which system you boot from. Think of it as your portable home directory. Anything you&#039;d normally keep in /Documents or /bin travels with the drive.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re working across machines with different hardware, keep in mind that installed packages persist but may have hardware-specific dependencies. For most desktop use this isn&#039;t an issue, but it&#039;s worth being aware of if you&#039;re installing drivers or kernel modules. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by distro-nix on Debian User Forums on 2026-04-06.&#039;&#039; Comments, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=220</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=220"/>
		<updated>2026-04-06T22:09:04Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: changed typo creation date&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created : 2026-04-04&lt;br /&gt;
&lt;br /&gt;
Last Updated : 2026-04-06&lt;br /&gt;
&lt;br /&gt;
ID: 005146.8&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A persistent Debian live USB can come in handy once you have prepared it. Boot it on your own machine, a colleague’s laptop, or a borrowed computer. It has your environment, your files, your settings, exactly where you left them.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The persistence layer is what makes all the difference: a standard live USB is stateless—helpful for recovery and installation, but each session starts fresh. By adding a persistence partition, you have a portable Debian installation: your shell configuration, your documents, your utilities, your scripts, your browser profile, all carried around in your pocket.&lt;br /&gt;
&lt;br /&gt;
This is also a practical solution when you’re working across multiple machines but don’t want to maintain separate installations on each. It’s particularly useful for sysadmins who move between systems regularly, or anyone who needs a known-good Debian environment available on demand without depending on the host.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;What you’ll need&#039;&#039; ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum requirement is 4GB, but that leaves you very little room for the persistence partition. The more you plan to store, the larger the drive should be. A 32 GB drive gives you more comfortable working space.&lt;br /&gt;
&lt;br /&gt;
Download the latest Debian Live ISO from the official Debian website at &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt; Choose the release and desktop environment that suits you, or the standard image if you prefer a lean setup.&lt;br /&gt;
&lt;br /&gt;
Verify the authenticity of the image &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/verify&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You’ll be working entirely in the terminal on a GNU/Linux system. The tools you need: &lt;br /&gt;
&lt;br /&gt;
* dd&lt;br /&gt;
* parted&lt;br /&gt;
* mkfs.ext4 &lt;br /&gt;
&lt;br /&gt;
These are standard utilities in Debian systems *.&lt;br /&gt;
&lt;br /&gt;
dd is part of GNU coreutils package&lt;br /&gt;
&lt;br /&gt;
mkfs.ext4 is part of the e2fsprogs package.* &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; usually present on full Debian installations, but on a standard live environment it may not be present.&lt;br /&gt;
 $ sudo apt install e2fsprogs parted&lt;br /&gt;
These are small, standard packages available in the Debian repositories. In a live session, they don’t persist unless you have persistence already enabled, so install them in the same session you do the setup.&lt;br /&gt;
&lt;br /&gt;
== A word about dd before you start ==&lt;br /&gt;
The dd package has earned the nickname &amp;quot;disk destroyer&amp;quot; because it destroys whatever you specify as the output (of=) without warning if you make a mistake. dd writes directly to block devices with no undo. Double-check your device identifier carefully before running any command.&lt;br /&gt;
&lt;br /&gt;
Plug in the USB drive and open the terminal and run:&lt;br /&gt;
 $ lsblk&lt;br /&gt;
Look for your USB device in the output—it will appear as /dev/sdb, /dev/sdc, or similar depending on what else is attached. Check that you have the right device.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; use the device itself (e.g., /dev/sdb), not a partition such as /dev/sdb1.&lt;br /&gt;
&lt;br /&gt;
In the commands that follow, /dev/sdX is a placeholder—replace it with your actual device identifier every time. &lt;br /&gt;
&lt;br /&gt;
== Step 1—Write the ISO to the USB drive ==&lt;br /&gt;
 $ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&lt;br /&gt;
The status=progress flag gives you a running transfer rate, otherwise you can’t see it is working. The sync at the end flushes any remaining data from the write cache—don’t pull the drive before it completes.&lt;br /&gt;
&lt;br /&gt;
This will take a few minutes depending on the drive speed. When it finishes, the USB is bootable but stateless. The next steps add the persistence layer. &lt;br /&gt;
&lt;br /&gt;
== Step 2—Create the persistence partition ==&lt;br /&gt;
After writing the ISO to the USB drive, only a portion of the disk is used. The remaining space is left unallocated. You’ll create a new partition in that space for &#039;&#039;persistence&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Make sure the USB device isn’t mounted, then start parted:&lt;br /&gt;
 $ sudo parted /dev/sdX&lt;br /&gt;
Inside, parted display the current layout:&lt;br /&gt;
 (parted) print free&lt;br /&gt;
You should see existing partitions followed by a region labeled &#039;&#039;&#039;Free Space&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Example layout ===&lt;br /&gt;
Your output may look similar to this:&lt;br /&gt;
&lt;br /&gt;
Number  Start    End      Size    File system  Flags&lt;br /&gt;
&lt;br /&gt;
1      1049kB   3500MB   3499MB  fat32        boot, esp&lt;br /&gt;
&lt;br /&gt;
2      3500MB   3600MB   100MB&lt;br /&gt;
&lt;br /&gt;
       3600MB   32.1GB   ~28GB   Free Space &lt;br /&gt;
&lt;br /&gt;
The important part is the &#039;&#039;&#039;free space at the end&#039;&#039;&#039; of the disk. This is where the persistence partition will go.&lt;br /&gt;
&lt;br /&gt;
=== Create the new partition ===&lt;br /&gt;
Instead of calculating start and end points manually, let parted use the available space:&lt;br /&gt;
 (parted) mkpart primary ext4 100%&lt;br /&gt;
This creates a new partition using all remaining free space.&lt;br /&gt;
&lt;br /&gt;
Set the persistence flag (replace N with the partition number shown in print):&lt;br /&gt;
&lt;br /&gt;
(parted) set N persistence on&lt;br /&gt;
 (parted) quit&lt;br /&gt;
Note: The persistence flag is not strictly required in all cases, but setting it won’t harm it, and may improve compatibility.&lt;br /&gt;
&lt;br /&gt;
If the system does not immediately recognize the new partition, run:&lt;br /&gt;
&lt;br /&gt;
sudo partprobe &lt;br /&gt;
&lt;br /&gt;
== Step 3—Format the persistence partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence—the Debian live system looks for it by name at boot:&lt;br /&gt;
 $ sudo mkfs.ext4 -L persistence /dev/sdXN&lt;br /&gt;
Replace sdXN with your actual partition (for example, /dev/sdb3 ). &lt;br /&gt;
&lt;br /&gt;
== Step 4—Create the persistence configuration file ==&lt;br /&gt;
Mount the new partition:&lt;br /&gt;
 $ sudo mount /dev/sdXN /mnt&lt;br /&gt;
Create the configuration file that tells the live system what to persist:&lt;br /&gt;
 $ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&lt;br /&gt;
This tells the system to use the entire filesystem as a writable overlay, preserving changes across reboots.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition cleanly:&lt;br /&gt;
 $ sudo umount /mnt&lt;br /&gt;
&lt;br /&gt;
== Step 5—Boot with persistence ==&lt;br /&gt;
Boot your system from the USB drive.&lt;br /&gt;
&lt;br /&gt;
At the Debian live boot menu:&lt;br /&gt;
&lt;br /&gt;
* Press Tab (on BIOS systems), or&lt;br /&gt;
* Press e (on UEFI/GRUB systems)&lt;br /&gt;
&lt;br /&gt;
Find the line beginning with linux and add: &lt;br /&gt;
 persistence&lt;br /&gt;
to the end of that line. Then boot the system. &lt;br /&gt;
&lt;br /&gt;
== Step 6—Verify persistence is working ==&lt;br /&gt;
After booting, create a test file:&lt;br /&gt;
 $ touch ~/persistence-test&lt;br /&gt;
Reboot again with the persistence option enabled. If the file is there, persistence is working. Good job!&lt;br /&gt;
&lt;br /&gt;
This is NOT a stealth tool. When used correctly, a Debian Live USB Persistent setup doesn’t modify the host system. No files or logs are written to the internal disk unless you explicitly mount and use it.&lt;br /&gt;
&lt;br /&gt;
It does not provide anonymity or invisibility:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Boot events may be logged (firmware / enterprise systems)&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;USB usage may be detectable&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;Network activity is visible to routers, ISPs, and organizations&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;User actions can leave traces if internal drives are mounted&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The persistence partition is a convenient place to store working data such as documents, scripts, and configuration files. Think of it as a portable home directory stored in your portable USB drive.&lt;br /&gt;
&lt;br /&gt;
If you’re working across machines with different hardware, most software will work without any issues. However, certain hardware-specific packages such as drivers or kernel modules) may not work on different systems.  &lt;br /&gt;
&lt;br /&gt;
---  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by distro-nix on Debian User Forums on 2026-04-06.&#039;&#039; Comments, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=219</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=219"/>
		<updated>2026-04-06T22:00:47Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created : 2026-05-04&lt;br /&gt;
&lt;br /&gt;
Last Updated : 2026-05-04&lt;br /&gt;
&lt;br /&gt;
ID: 005146.8&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A persistent Debian live USB can come in handy once you have prepared it. Boot it on your own machine, a colleague’s laptop, or a borrowed computer. It has your environment, your files, your settings, exactly where you left them.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The persistence layer is what makes all the difference: a standard live USB is stateless—helpful for recovery and installation, but each session starts fresh. By adding a persistence partition, you have a portable Debian installation: your shell configuration, your documents, your utilities, your scripts, your browser profile, all carried around in your pocket.&lt;br /&gt;
&lt;br /&gt;
This is also a practical solution when you’re working across multiple machines but don’t want to maintain separate installations on each. It’s particularly useful for sysadmins who move between systems regularly, or anyone who needs a known-good Debian environment available on demand without depending on the host.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;What you’ll need&#039;&#039; ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum requirement is 4GB, but that leaves you very little room for the persistence partition. The more you plan to store, the larger the drive should be. A 32 GB drive gives you more comfortable working space.&lt;br /&gt;
&lt;br /&gt;
Download the latest Debian Live ISO from the official Debian website at &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt; Choose the release and desktop environment that suits you, or the standard image if you prefer a lean setup.&lt;br /&gt;
&lt;br /&gt;
Verify the authenticity of the image &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/verify&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You’ll be working entirely in the terminal on a GNU/Linux system. The tools you need: &lt;br /&gt;
&lt;br /&gt;
* dd&lt;br /&gt;
* parted&lt;br /&gt;
* mkfs.ext4 &lt;br /&gt;
&lt;br /&gt;
These are standard utilities in Debian systems *.&lt;br /&gt;
&lt;br /&gt;
dd is part of GNU coreutils package&lt;br /&gt;
&lt;br /&gt;
mkfs.ext4 is part of the e2fsprogs package.* &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; usually present on full Debian installations, but on a standard live environment it may not be present.&lt;br /&gt;
 $ sudo apt install e2fsprogs parted&lt;br /&gt;
These are small, standard packages available in the Debian repositories. In a live session, they don’t persist unless you have persistence already enabled, so install them in the same session you do the setup.&lt;br /&gt;
&lt;br /&gt;
== A word about dd before you start ==&lt;br /&gt;
The dd package has earned the nickname &amp;quot;disk destroyer&amp;quot; because it destroys whatever you specify as the output (of=) without warning if you make a mistake. dd writes directly to block devices with no undo. Double-check your device identifier carefully before running any command.&lt;br /&gt;
&lt;br /&gt;
Plug in the USB drive and open the terminal and run:&lt;br /&gt;
 $ lsblk&lt;br /&gt;
Look for your USB device in the output—it will appear as /dev/sdb, /dev/sdc, or similar depending on what else is attached. Check that you have the right device.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; use the device itself (e.g., /dev/sdb), not a partition such as /dev/sdb1.&lt;br /&gt;
&lt;br /&gt;
In the commands that follow, /dev/sdX is a placeholder—replace it with your actual device identifier every time. &lt;br /&gt;
&lt;br /&gt;
== Step 1—Write the ISO to the USB drive ==&lt;br /&gt;
 $ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&lt;br /&gt;
The status=progress flag gives you a running transfer rate, otherwise you can’t see it is working. The sync at the end flushes any remaining data from the write cache—don’t pull the drive before it completes.&lt;br /&gt;
&lt;br /&gt;
This will take a few minutes depending on the drive speed. When it finishes, the USB is bootable but stateless. The next steps add the persistence layer. &lt;br /&gt;
&lt;br /&gt;
== Step 2—Create the persistence partition ==&lt;br /&gt;
After writing the ISO to the USB drive, only a portion of the disk is used. The remaining space is left unallocated. You’ll create a new partition in that space for &#039;&#039;persistence&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Make sure the USB device isn’t mounted, then start parted:&lt;br /&gt;
 $ sudo parted /dev/sdX&lt;br /&gt;
Inside, parted display the current layout:&lt;br /&gt;
 (parted) print free&lt;br /&gt;
You should see existing partitions followed by a region labeled &#039;&#039;&#039;Free Space&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Example layout ===&lt;br /&gt;
Your output may look similar to this:&lt;br /&gt;
&lt;br /&gt;
Number  Start    End      Size    File system  Flags&lt;br /&gt;
&lt;br /&gt;
1      1049kB   3500MB   3499MB  fat32        boot, esp&lt;br /&gt;
&lt;br /&gt;
2      3500MB   3600MB   100MB&lt;br /&gt;
&lt;br /&gt;
       3600MB   32.1GB   ~28GB   Free Space &lt;br /&gt;
&lt;br /&gt;
The important part is the &#039;&#039;&#039;free space at the end&#039;&#039;&#039; of the disk. This is where the persistence partition will go.&lt;br /&gt;
&lt;br /&gt;
=== Create the new partition ===&lt;br /&gt;
Instead of calculating start and end points manually, let parted use the available space:&lt;br /&gt;
 (parted) mkpart primary ext4 100%&lt;br /&gt;
This creates a new partition using all remaining free space.&lt;br /&gt;
&lt;br /&gt;
Set the persistence flag (replace N with the partition number shown in print):&lt;br /&gt;
&lt;br /&gt;
(parted) set N persistence on&lt;br /&gt;
 (parted) quit&lt;br /&gt;
Note: The persistence flag is not strictly required in all cases, but setting it won’t harm it, and may improve compatibility.&lt;br /&gt;
&lt;br /&gt;
If the system does not immediately recognize the new partition, run:&lt;br /&gt;
&lt;br /&gt;
sudo partprobe &lt;br /&gt;
&lt;br /&gt;
== Step 3—Format the persistence partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence—the Debian live system looks for it by name at boot:&lt;br /&gt;
 $ sudo mkfs.ext4 -L persistence /dev/sdXN&lt;br /&gt;
Replace sdXN with your actual partition (for example, /dev/sdb3 ). &lt;br /&gt;
&lt;br /&gt;
== Step 4—Create the persistence configuration file ==&lt;br /&gt;
Mount the new partition:&lt;br /&gt;
 $ sudo mount /dev/sdXN /mnt&lt;br /&gt;
Create the configuration file that tells the live system what to persist:&lt;br /&gt;
 $ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&lt;br /&gt;
This tells the system to use the entire filesystem as a writable overlay, preserving changes across reboots.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition cleanly:&lt;br /&gt;
 $ sudo umount /mnt&lt;br /&gt;
&lt;br /&gt;
== Step 5—Boot with persistence ==&lt;br /&gt;
Boot your system from the USB drive.&lt;br /&gt;
&lt;br /&gt;
At the Debian live boot menu:&lt;br /&gt;
&lt;br /&gt;
* Press Tab (on BIOS systems), or&lt;br /&gt;
* Press e (on UEFI/GRUB systems)&lt;br /&gt;
&lt;br /&gt;
Find the line beginning with linux and add: &lt;br /&gt;
 persistence&lt;br /&gt;
to the end of that line. Then boot the system. &lt;br /&gt;
&lt;br /&gt;
== Step 6—Verify persistence is working ==&lt;br /&gt;
After booting, create a test file:&lt;br /&gt;
 $ touch ~/persistence-test&lt;br /&gt;
Reboot again with the persistence option enabled. If the file is there, persistence is working. Good job!&lt;br /&gt;
&lt;br /&gt;
This is NOT a stealth tool. When used correctly, a Debian Live USB Persistent setup doesn’t modify the host system. No files or logs are written to the internal disk unless you explicitly mount and use it.&lt;br /&gt;
&lt;br /&gt;
It does not provide anonymity or invisibility:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Boot events may be logged (firmware / enterprise systems)&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;USB usage may be detectable&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;Network activity is visible to routers, ISPs, and organizations&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;User actions can leave traces if internal drives are mounted&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The persistence partition is a convenient place to store working data such as documents, scripts, and configuration files. Think of it as a portable home directory stored in your portable USB drive.&lt;br /&gt;
&lt;br /&gt;
If you’re working across machines with different hardware, most software will work without any issues. However, certain hardware-specific packages such as drivers or kernel modules) may not work on different systems.  &lt;br /&gt;
&lt;br /&gt;
---  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by distro-nix on Debian User Forums on 2026-04-05.&#039;&#039; Comments, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=218</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=218"/>
		<updated>2026-04-06T20:06:42Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: /* A word about dd before you start */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created : 2026-05-04&lt;br /&gt;
&lt;br /&gt;
Last Updated : 2026-04-05&lt;br /&gt;
&lt;br /&gt;
ID: 005146.7&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A persistent Debian live USB can come in handy once you have prepared it. Boot it on your own machine, a colleague’s laptop, or a borrowed computer. It has your environment, your files, your settings, exactly where you left them.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The persistence layer is what makes all the difference: a standard live USB is stateless—helpful for recovery and installation, but each session starts fresh. By adding a persistence partition, you have a portable Debian installation: your shell configuration, your documents, your utilities, your scripts, your browser profile, all carried around in your pocket.&lt;br /&gt;
&lt;br /&gt;
This is also a practical solution when you’re working across multiple machines but don’t want to maintain separate installations on each. It’s particularly useful for sysadmins who move between systems regularly, or anyone who needs a known-good Debian environment available on demand without depending on the host.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;What you’ll need&#039;&#039; ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum requirement is 4GB, but that leaves you very little room for the persistence partition. The more you plan to store, the larger the drive should be. A 32 GB drive gives you more comfortable working space.&lt;br /&gt;
&lt;br /&gt;
Download the latest Debian Live ISO from the official Debian website at &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt; Choose the release and desktop environment that suits you, or the standard image if you prefer a lean setup.&lt;br /&gt;
&lt;br /&gt;
Verify the authenticity of the image &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/verify&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You’ll be working entirely in the terminal on a GNU/Linux system. The tools you need: &lt;br /&gt;
&lt;br /&gt;
* dd&lt;br /&gt;
* parted&lt;br /&gt;
* mkfs.ext4 &lt;br /&gt;
&lt;br /&gt;
These are standard utilities in Debian systems *.&lt;br /&gt;
&lt;br /&gt;
dd is part of GNU coreutils package&lt;br /&gt;
&lt;br /&gt;
mkfs.ext4 is part of the e2fsprogs package.* &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; usually present on full Debian installations, but on a standard live environment it may not be present.&lt;br /&gt;
 $ sudo apt install e2fsprogs parted&lt;br /&gt;
These are small, standard packages available in the Debian repositories. In a live session, they don’t persist unless you have persistence already enabled, so install them in the same session you do the setup.&lt;br /&gt;
&lt;br /&gt;
== A word about dd before you start ==&lt;br /&gt;
The dd package has earned the nickname &amp;quot;disk destroyer&amp;quot; because it destroys whatever you specify as the output (of=) without warning if you make a mistake. dd writes directly to block devices with no undo. Double-check your device identifier carefully before running any command.&lt;br /&gt;
&lt;br /&gt;
Plug in the USB drive and open the terminal and run:&lt;br /&gt;
 $ lsblk&lt;br /&gt;
Look for your USB device in the output—it will appear as /dev/sdb, /dev/sdc, or similar depending on what else is attached. Check that you have the right device.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; use the device itself (e.g., /dev/sdb), not a partition such as /dev/sdb1.&lt;br /&gt;
&lt;br /&gt;
In the commands that follow, /dev/sdX is a placeholder—replace it with your actual device identifier every time. &lt;br /&gt;
&lt;br /&gt;
== Step 1—Write the ISO to the USB drive ==&lt;br /&gt;
 $ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&lt;br /&gt;
The status=progress flag gives you a running transfer rate, otherwise you can’t see it is working. The sync at the end flushes any remaining data from the write cache—don’t pull the drive before it completes.&lt;br /&gt;
&lt;br /&gt;
This will take a few minutes depending on the drive speed. When it finishes, the USB is bootable but stateless. The next steps add the persistence layer. &lt;br /&gt;
&lt;br /&gt;
== Step 2—Create the persistence partition ==&lt;br /&gt;
After writing the ISO to the USB drive, only a portion of the disk is used. The remaining space is left unallocated. You’ll create a new partition in that space for &#039;&#039;persistence&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Make sure the USB device isn’t mounted, then start parted:&lt;br /&gt;
 $ sudo parted /dev/sdX&lt;br /&gt;
Inside, parted display the current layout:&lt;br /&gt;
 (parted) print free&lt;br /&gt;
You should see existing partitions followed by a region labeled &#039;&#039;&#039;Free Space&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Example layout ===&lt;br /&gt;
Your output may look similar to this:&lt;br /&gt;
&lt;br /&gt;
Number  Start    End      Size    File system  Flags&lt;br /&gt;
&lt;br /&gt;
1      1049kB   3500MB   3499MB  fat32        boot, esp&lt;br /&gt;
&lt;br /&gt;
2      3500MB   3600MB   100MB&lt;br /&gt;
&lt;br /&gt;
       3600MB   32.1GB   ~28GB   Free Space &lt;br /&gt;
&lt;br /&gt;
The important part is the &#039;&#039;&#039;free space at the end&#039;&#039;&#039; of the disk. This is where the persistence partition will go.&lt;br /&gt;
&lt;br /&gt;
=== Create the new partition ===&lt;br /&gt;
Instead of calculating start and end points manually, let parted use the available space:&lt;br /&gt;
 (parted) mkpart primary ext4 100%&lt;br /&gt;
This creates a new partition using all remaining free space.&lt;br /&gt;
&lt;br /&gt;
Set the persistence flag (replace N with the partition number shown in print):&lt;br /&gt;
&lt;br /&gt;
(parted) set N persistence on&lt;br /&gt;
 (parted) quit&lt;br /&gt;
Note: The persistence flag is not strictly required in all cases, but setting it won’t harm it, and may improve compatibility.&lt;br /&gt;
&lt;br /&gt;
If the system does not immediately recognize the new partition, run:&lt;br /&gt;
&lt;br /&gt;
sudo partprobe &lt;br /&gt;
&lt;br /&gt;
== Step 3—Format the persistence partition ==&lt;br /&gt;
Format the new partition as ext4 with the label persistence—the Debian live system looks for it by name at boot:&lt;br /&gt;
 $ sudo mkfs.ext4 -L persistence /dev/sdXN&lt;br /&gt;
Replace sdXN with your actual partition (for example, /dev/sdb3 ). &lt;br /&gt;
&lt;br /&gt;
== Step 4—Create the persistence configuration file ==&lt;br /&gt;
Mount the new partition:&lt;br /&gt;
 $ sudo mount /dev/sdXN /mnt&lt;br /&gt;
Create the configuration file that tells the live system what to persist:&lt;br /&gt;
 $ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&lt;br /&gt;
This tells the system to use the entire filesystem as a writable overlay, preserving changes across reboots.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition cleanly:&lt;br /&gt;
 $ sudo umount /mnt&lt;br /&gt;
&lt;br /&gt;
== Step 5—Boot with persistence ==&lt;br /&gt;
Boot your system from the USB drive.&lt;br /&gt;
&lt;br /&gt;
At the Debian live boot menu:&lt;br /&gt;
&lt;br /&gt;
* Press Tab (on BIOS systems), or&lt;br /&gt;
* Press e (on UEFI/GRUB systems)&lt;br /&gt;
&lt;br /&gt;
Find the line beginning with linux and add: &lt;br /&gt;
 persistence&lt;br /&gt;
to the end of that line. Then boot the system. &lt;br /&gt;
&lt;br /&gt;
== Step 6—Verify persistence is working ==&lt;br /&gt;
After booting, create a test file:&lt;br /&gt;
 $ touch ~/persistence-test&lt;br /&gt;
Reboot again with the persistence option enabled. If the file is there, persistence is working. Good job!&lt;br /&gt;
&lt;br /&gt;
This is NOT a stealth tool. When used correctly, a Debian Live USB Persistent setup doesn’t modify the host system. No files or logs are written to the internal disk unless you explicitly mount and use it.&lt;br /&gt;
&lt;br /&gt;
It does not provide anonymity or invisibility:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Boot events may be logged (firmware / enterprise systems)&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;USB usage may be detectable&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;Network activity is visible to routers, ISPs, and organizations&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;User actions can leave traces if internal drives are mounted&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The persistence partition is a convenient place to store working data such as documents, scripts, and configuration files. Think of it as a portable home directory stored in your portable USB drive.&lt;br /&gt;
&lt;br /&gt;
If you’re working across machines with different hardware, most software will work without any issues. However, certain hardware-specific packages ‘such as drivers or kernel modules) may not work on different systems.  &lt;br /&gt;
&lt;br /&gt;
---  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by distro-nix on Debian User Forums on 2026-05-05.&#039;&#039; Comments, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=217</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=217"/>
		<updated>2026-04-06T19:56:21Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created : 2026-05-04&lt;br /&gt;
&lt;br /&gt;
Last Updated : 2026-04-05&lt;br /&gt;
&lt;br /&gt;
ID: 005146.7&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A persistent Debian live USB can come in handy once you have prepared it. Boot it on your own machine, a colleague’s laptop, or a borrowed computer. It has your environment, your files, your settings, exactly where you left them.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The persistence layer is what makes all the difference: a standard live USB is stateless—helpful for recovery and installation, but each session starts fresh. By adding a persistence partition, you have a portable Debian installation: your shell configuration, your documents, your utilities, your scripts, your browser profile, all carried around in your pocket.&lt;br /&gt;
&lt;br /&gt;
This is also a practical solution when you’re working across multiple machines but don’t want to maintain separate installations on each. It’s particularly useful for sysadmins who move between systems regularly, or anyone who needs a known-good Debian environment available on demand without depending on the host.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;What you’ll need&#039;&#039; ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum requirement is 4GB, but that leaves you very little room for the persistence partition. The more you plan to store, the larger the drive should be. A 32 GB drive gives you more comfortable working space.&lt;br /&gt;
&lt;br /&gt;
Download the latest Debian Live ISO from the official Debian website at &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt; Choose the release and desktop environment that suits you, or the standard image if you prefer a lean setup.&lt;br /&gt;
&lt;br /&gt;
Verify the authenticity of the image &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/verify&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You’ll be working entirely in the terminal on a GNU/Linux system. The tools you need: &lt;br /&gt;
&lt;br /&gt;
* dd&lt;br /&gt;
* parted&lt;br /&gt;
* mkfs.ext4 &lt;br /&gt;
&lt;br /&gt;
These are standard utilities in Debian systems *.&lt;br /&gt;
&lt;br /&gt;
dd is part of GNU coreutils package&lt;br /&gt;
&lt;br /&gt;
mkfs.ext4 is part of the e2fsprogs package.* &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; usually present on full Debian installations, but on a standard live environment it may not be present.&lt;br /&gt;
&lt;br /&gt;
$ sudo apt install e2fsprogs parted&lt;br /&gt;
&lt;br /&gt;
These are small, standard packages available in the Debian repositories. In a live session, they don’t persist unless you have persistence already enabled, so install them in the same session you do the setup.&lt;br /&gt;
&lt;br /&gt;
== A word about dd before you start ==&lt;br /&gt;
The dd package has earned the nickname &amp;quot;disk destroyer&amp;quot; because it destroys whatever you specify as the output (of=) without warning if you make a mistake. dd writes directly to block devices with no undo. Double-check your device identifier carefully before running any command.&lt;br /&gt;
&lt;br /&gt;
Plug in the USB drive and open the terminal and run:&lt;br /&gt;
&lt;br /&gt;
$ lsblk&lt;br /&gt;
&lt;br /&gt;
Look for your USB device in the output—it will appear as /dev/sdb, /dev/sdc, or similar depending on what else is attached. Check that you have the right device.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; use the device itself (e.g., /dev/sdb), not a partition such as /dev/sdb1.&lt;br /&gt;
&lt;br /&gt;
In the commands that follow, /dev/sdX is a placeholder—replace it with your actual device identifier every time. &lt;br /&gt;
&lt;br /&gt;
Step 1—Write the ISO to the USB drive&lt;br /&gt;
&lt;br /&gt;
$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&lt;br /&gt;
&lt;br /&gt;
The status=progress flag gives you a running transfer rate, otherwise you can’t see it is working. The sync at the end flushes any remaining data from the write cache—don’t pull the drive before it completes.&lt;br /&gt;
&lt;br /&gt;
This will take a few minutes depending on the drive speed. When it finishes, the USB is bootable but stateless. The next steps add the persistence layer. &lt;br /&gt;
&lt;br /&gt;
Step 2—Create the persistence partition&lt;br /&gt;
&lt;br /&gt;
After writing the ISO to the USB drive, only a portion of the disk is used. The remaining space is left unallocated. You’ll create a new partition in that space for &#039;&#039;persistence&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Make sure the USB device isn’t mounted, then start parted:&lt;br /&gt;
&lt;br /&gt;
$ sudo parted /dev/sdX&lt;br /&gt;
&lt;br /&gt;
Inside, parted display the current layout:&lt;br /&gt;
&lt;br /&gt;
(parted) print free&lt;br /&gt;
&lt;br /&gt;
You should see existing partitions followed by a region labeled &#039;&#039;&#039;Free Space&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Example layout ===&lt;br /&gt;
Your output may look similar to this:&lt;br /&gt;
&lt;br /&gt;
Number  Start    End      Size    File system  Flags&lt;br /&gt;
&lt;br /&gt;
1      1049kB   3500MB   3499MB  fat32        boot, esp&lt;br /&gt;
&lt;br /&gt;
2      3500MB   3600MB   100MB&lt;br /&gt;
&lt;br /&gt;
       3600MB   32.1GB   ~28GB   Free Space &lt;br /&gt;
&lt;br /&gt;
The important part is the &#039;&#039;&#039;free space at the end&#039;&#039;&#039; of the disk. This is where the persistence partition will go.&lt;br /&gt;
&lt;br /&gt;
=== Create the new partition ===&lt;br /&gt;
Instead of calculating start and end points manually, let parted use the available space:&lt;br /&gt;
&lt;br /&gt;
(parted) mkpart primary ext4 100%&lt;br /&gt;
&lt;br /&gt;
This creates a new partition using all remaining free space.&lt;br /&gt;
&lt;br /&gt;
Set the persistence flag (replace N with the partition number shown in print):&lt;br /&gt;
&lt;br /&gt;
(parted) set N persistence on&lt;br /&gt;
&lt;br /&gt;
(parted) quit&lt;br /&gt;
&lt;br /&gt;
Note: The persistence flag is not strictly required in all cases, but setting it won’t harm it, and may improve compatibility.&lt;br /&gt;
&lt;br /&gt;
If the system does not immediately recognize the new partition, run:&lt;br /&gt;
&lt;br /&gt;
sudo partprobe &lt;br /&gt;
&lt;br /&gt;
Step 3—Format the persistence partition&lt;br /&gt;
&lt;br /&gt;
Format the new partition as ext4 with the label persistence—the Debian live system looks for it by name at boot:&lt;br /&gt;
&lt;br /&gt;
$ sudo mkfs.ext4 -L persistence /dev/sdXN&lt;br /&gt;
&lt;br /&gt;
Replace sdXN with your actual partition (for example, /dev/sdb3 ). &lt;br /&gt;
&lt;br /&gt;
Step 4—Create the persistence configuration file&lt;br /&gt;
&lt;br /&gt;
Mount the new partition:&lt;br /&gt;
&lt;br /&gt;
$ sudo mount /dev/sdXN /mnt&lt;br /&gt;
&lt;br /&gt;
Create the configuration file that tells the live system what to persist:&lt;br /&gt;
&lt;br /&gt;
$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&lt;br /&gt;
&lt;br /&gt;
This tells the system to use the entire filesystem as a writable overlay, preserving changes across reboots.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition cleanly:&lt;br /&gt;
&lt;br /&gt;
$ sudo umount /mnt &lt;br /&gt;
&lt;br /&gt;
Step 5—Boot with persistence&lt;br /&gt;
&lt;br /&gt;
Boot your system from the USB drive.&lt;br /&gt;
&lt;br /&gt;
At the Debian live boot menu:&lt;br /&gt;
&lt;br /&gt;
* Press Tab (on BIOS systems), or&lt;br /&gt;
* Press e (on UEFI/GRUB systems)&lt;br /&gt;
&lt;br /&gt;
Find the line beginning with linux and add: &lt;br /&gt;
&lt;br /&gt;
persistence&lt;br /&gt;
&lt;br /&gt;
to the end of that line. Then boot the system. &lt;br /&gt;
&lt;br /&gt;
== Step 6—Verify persistence is working ==&lt;br /&gt;
After booting, create a test file:&lt;br /&gt;
&lt;br /&gt;
$ touch ~/persistence-test &lt;br /&gt;
&lt;br /&gt;
Reboot again with the persistence option enabled. If the file is there, persistence is working. Good job!&lt;br /&gt;
&lt;br /&gt;
This is NOT a stealth tool. When used correctly, a Debian Live USB Persistent setup doesn’t modify the host system. No files or logs are written to the internal disk unless you explicitly mount and use it.&lt;br /&gt;
&lt;br /&gt;
It does not provide anonymity or invisibility:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Boot events may be logged (firmware / enterprise systems)&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;USB usage may be detectable&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;Network activity is visible to routers, ISPs, and organizations&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;User actions can leave traces if internal drives are mounted&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The persistence partition is a convenient place to store working data such as documents, scripts, and configuration files. Think of it as a portable home directory stored in your portable USB drive.&lt;br /&gt;
&lt;br /&gt;
If you’re working across machines with different hardware, most software will work without any issues. However, certain hardware-specific packages ‘such as drivers or kernel modules) may not work on different systems.  &lt;br /&gt;
&lt;br /&gt;
---  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by distro-nix on Debian User Forums on 2026-05-05.&#039;&#039; Comments, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=216</id>
		<title>Debian Live USB with Persistence</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_Live_USB_with_Persistence&amp;diff=216"/>
		<updated>2026-04-06T19:50:48Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: Created page with &amp;quot;* &amp;#039;&amp;#039;&amp;#039;Debian Live USB with Persistence&amp;#039;&amp;#039;&amp;#039;  All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64  Created : 2026-05-04  Last Updated : 2026-04-05  ID: 005146.7  &amp;#039;&amp;#039;A persistent Debian live USB can come in handy once you have prepared it. Boot it on your own machine, a colleague’s laptop, or a borrowed computer. It has your environment, your files, your settings, exactly where you left them.&amp;#039;&amp;#039;   The persistence layer is what makes all the difference: a...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* &#039;&#039;&#039;Debian Live USB with Persistence&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
All commands are verified on Debian 13.4 (Trixie) / 6.12.74+deb13+1-amd64&lt;br /&gt;
&lt;br /&gt;
Created : 2026-05-04&lt;br /&gt;
&lt;br /&gt;
Last Updated : 2026-04-05&lt;br /&gt;
&lt;br /&gt;
ID: 005146.7&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A persistent Debian live USB can come in handy once you have prepared it. Boot it on your own machine, a colleague’s laptop, or a borrowed computer. It has your environment, your files, your settings, exactly where you left them.&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The persistence layer is what makes all the difference: a standard live USB is stateless—helpful for recovery and installation, but each session starts fresh. By adding a persistence partition, you have a portable Debian installation: your shell configuration, your documents, your utilities, your scripts, your browser profile, all carried around in your pocket.&lt;br /&gt;
&lt;br /&gt;
This is also a practical solution when you’re working across multiple machines but don’t want to maintain separate installations on each. It’s particularly useful for sysadmins who move between systems regularly, or anyone who needs a known-good Debian environment available on demand without depending on the host.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;What you’ll need&#039;&#039; ==&lt;br /&gt;
A USB drive of at least 8 GB—the minimum requirement is 4GB, but that leaves you very little room for the persistence partition. The more you plan to store, the larger the drive should be. A 32 GB drive gives you more comfortable working space.&lt;br /&gt;
&lt;br /&gt;
Download the latest Debian Live ISO from the official Debian website at &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/live&amp;lt;/nowiki&amp;gt; Choose the release and desktop environment that suits you, or the standard image if you prefer a lean setup.&lt;br /&gt;
&lt;br /&gt;
Verify the authenticity of the image &amp;lt;nowiki&amp;gt;https://www.debian.org/CD/verify&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You’ll be working entirely in the terminal on a GNU/Linux system. The tools you need: &lt;br /&gt;
&lt;br /&gt;
* dd&lt;br /&gt;
* parted&lt;br /&gt;
* mkfs.ext4 &lt;br /&gt;
&lt;br /&gt;
These are standard utilities in Debian systems *.&lt;br /&gt;
&lt;br /&gt;
dd is part of GNU coreutils package&lt;br /&gt;
&lt;br /&gt;
mkfs.ext4 is part of the e2fsprogs package.* &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; usually present on full Debian installations, but on a standard live environment it may not be present.&lt;br /&gt;
&lt;br /&gt;
$ sudo apt install e2fsprogs parted&lt;br /&gt;
&lt;br /&gt;
These are small, standard packages available in the Debian repositories. In a live session, they don’t persist unless you have persistence already enabled, so install them in the same session you do the setup.&lt;br /&gt;
&lt;br /&gt;
== A word about dd before you start ==&lt;br /&gt;
The dd package has earned the nickname &amp;quot;disk destroyer&amp;quot; because it destroys whatever you specify as the output (of=) without warning if you make a mistake. dd writes directly to block devices with no undo. Double-check your device identifier carefully before running any command.&lt;br /&gt;
&lt;br /&gt;
Plug in the USB drive and open the terminal and run:&lt;br /&gt;
&lt;br /&gt;
$ lsblk&lt;br /&gt;
&lt;br /&gt;
Look for your USB device in the output—it will appear as /dev/sdb, /dev/sdc, or similar depending on what else is attached. Check that you have the right device.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; use the device itself (e.g., /dev/sdb), not a partition such as /dev/sdb1.&lt;br /&gt;
&lt;br /&gt;
In the commands that follow, /dev/sdX is a placeholder—replace it with your actual device identifier every time. &lt;br /&gt;
&lt;br /&gt;
Step 1—Write the ISO to the USB drive&lt;br /&gt;
&lt;br /&gt;
$ sudo dd if=/path/to/debian-live-13.4.0-amd64-kde.iso of=/dev/sdX bs=4M status=progress &amp;amp;&amp;amp; sync&lt;br /&gt;
&lt;br /&gt;
The status=progress flag gives you a running transfer rate, otherwise you can’t see it is working. The sync at the end flushes any remaining data from the write cache—don’t pull the drive before it completes.&lt;br /&gt;
&lt;br /&gt;
This will take a few minutes depending on the drive speed. When it finishes, the USB is bootable but stateless. The next steps add the persistence layer. &lt;br /&gt;
&lt;br /&gt;
Step 2—Create the persistence partition&lt;br /&gt;
&lt;br /&gt;
After writing the ISO to the USB drive, only a portion of the disk is used. The remaining space is left unallocated. You’ll create a new partition in that space for &#039;&#039;persistence&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Make sure the USB device isn’t mounted, then start parted:&lt;br /&gt;
&lt;br /&gt;
$ sudo parted /dev/sdX&lt;br /&gt;
&lt;br /&gt;
Inside, parted display the current layout:&lt;br /&gt;
&lt;br /&gt;
(parted) print free&lt;br /&gt;
&lt;br /&gt;
You should see existing partitions followed by a region labeled &#039;&#039;&#039;Free Space&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Example layout ===&lt;br /&gt;
Your output may look similar to this:&lt;br /&gt;
&lt;br /&gt;
Number  Start    End      Size    File system  Flags&lt;br /&gt;
&lt;br /&gt;
1      1049kB   3500MB   3499MB  fat32        boot, esp&lt;br /&gt;
&lt;br /&gt;
2      3500MB   3600MB   100MB&lt;br /&gt;
&lt;br /&gt;
       3600MB   32.1GB   ~28GB   Free Space &lt;br /&gt;
&lt;br /&gt;
The important part is the &#039;&#039;&#039;free space at the end&#039;&#039;&#039; of the disk. This is where the persistence partition will go.&lt;br /&gt;
&lt;br /&gt;
=== Create the new partition ===&lt;br /&gt;
Instead of calculating start and end points manually, let parted use the available space:&lt;br /&gt;
&lt;br /&gt;
(parted) mkpart primary ext4 100%&lt;br /&gt;
&lt;br /&gt;
This creates a new partition using all remaining free space.&lt;br /&gt;
&lt;br /&gt;
Set the persistence flag (replace N with the partition number shown in print):&lt;br /&gt;
&lt;br /&gt;
(parted) set N persistence on&lt;br /&gt;
&lt;br /&gt;
(parted) quit&lt;br /&gt;
&lt;br /&gt;
Note: The persistence flag is not strictly required in all cases, but setting it won’t harm it, and may improve compatibility.&lt;br /&gt;
&lt;br /&gt;
If the system does not immediately recognize the new partition, run:&lt;br /&gt;
&lt;br /&gt;
sudo partprobe &lt;br /&gt;
&lt;br /&gt;
Step 3—Format the persistence partition&lt;br /&gt;
&lt;br /&gt;
Format the new partition as ext4 with the label persistence—the Debian live system looks for it by name at boot:&lt;br /&gt;
&lt;br /&gt;
$ sudo mkfs.ext4 -L persistence /dev/sdXN&lt;br /&gt;
&lt;br /&gt;
Replace sdXN with your actual partition (for example, /dev/sdb3 ). &lt;br /&gt;
&lt;br /&gt;
Step 4—Create the persistence configuration file&lt;br /&gt;
&lt;br /&gt;
Mount the new partition:&lt;br /&gt;
&lt;br /&gt;
$ sudo mount /dev/sdXN /mnt&lt;br /&gt;
&lt;br /&gt;
Create the configuration file that tells the live system what to persist:&lt;br /&gt;
&lt;br /&gt;
$ echo &amp;quot;/ union&amp;quot; | sudo tee /mnt/persistence.conf&lt;br /&gt;
&lt;br /&gt;
This tells the system to use the entire filesystem as a writable overlay, preserving changes across reboots.&lt;br /&gt;
&lt;br /&gt;
Unmount the partition cleanly:&lt;br /&gt;
&lt;br /&gt;
$ sudo umount /mnt &lt;br /&gt;
&lt;br /&gt;
Step 5—Boot with persistence&lt;br /&gt;
&lt;br /&gt;
Boot your system from the USB drive.&lt;br /&gt;
&lt;br /&gt;
At the Debian live boot menu:&lt;br /&gt;
&lt;br /&gt;
* Press Tab (on BIOS systems), or&lt;br /&gt;
* Press e (on UEFI/GRUB systems)&lt;br /&gt;
&lt;br /&gt;
Find the line beginning with linux and add: &lt;br /&gt;
&lt;br /&gt;
persistence&lt;br /&gt;
&lt;br /&gt;
to the end of that line. Then boot the system. &lt;br /&gt;
&lt;br /&gt;
== Step 6—Verify persistence is working ==&lt;br /&gt;
After booting, create a test file:&lt;br /&gt;
&lt;br /&gt;
$ touch ~/persistence-test &lt;br /&gt;
&lt;br /&gt;
Reboot again with the persistence option enabled. If the file is there, persistence is working. Good job!&lt;br /&gt;
&lt;br /&gt;
This is NOT a stealth tool. When used correctly, a Debian Live USB Persistent setup doesn’t modify the host system. No files or logs are written to the internal disk unless you explicitly mount and use it.&lt;br /&gt;
&lt;br /&gt;
It does not provide anonymity or invisibility:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Boot events may be logged (firmware / enterprise systems)&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;USB usage may be detectable&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;Network activity is visible to routers, ISPs, and organizations&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;User actions can leave traces if internal drives are mounted&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The persistence partition is a convenient place to store working data such as documents, scripts, and configuration files. Think of it as a portable home directory stored in your portable USB drive.&lt;br /&gt;
&lt;br /&gt;
If you’re working across machines with different hardware, most software will work without any issues. However, certain hardware-specific packages ‘such as drivers or kernel modules) may not work on different systems.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This work was contributed by distro-nix on Debian User Forums on 2026-05-05.&#039;&#039; Comments, suggestions or resources are welcome.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Main_Page&amp;diff=215</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Main_Page&amp;diff=215"/>
		<updated>2026-04-06T19:21:08Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: /* HowTo (guides) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Welcome to the Debian User Forum Archives. =&lt;br /&gt;
&lt;br /&gt;
This wiki is dedicated specific member solutions from the [https://forums.debian.net Debian User Forums] and not to be confused with the larger man style documentation driven official [https://wiki.debian.org Debian Project Wiki].&lt;br /&gt;
&lt;br /&gt;
Our works here are citable formats of some of our best threads, member contributions, guides, and information that can provide assistance on or offline. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About ==&lt;br /&gt;
About:&lt;br /&gt;
* [[Archive Debian Forums:About|Archive Debian Forums]]&lt;br /&gt;
* [[Debian User Forums]]&lt;br /&gt;
* [[The Debian Project]]&lt;br /&gt;
* [[Forum jokes, lingo, and memorable quotes]]&lt;br /&gt;
&lt;br /&gt;
== Guides (reference) ==&lt;br /&gt;
&lt;br /&gt;
* [[Root, Sudo, and SU|Root, sudo, su, and su -]] &amp;lt;small&amp;gt;(forum archive)&amp;lt;/small&amp;gt;&lt;br /&gt;
* [[Debian First Aid Kit]] &amp;lt;small&amp;gt;(full paper)&amp;lt;/small&amp;gt;&lt;br /&gt;
* [[Fonts and Themes in Cinnamon Desktop]] &amp;lt;small&amp;gt;(full paper)&amp;lt;/small&amp;gt;&lt;br /&gt;
* [[To install Firefox from Mozilla repo|Installing Firefox from the Mozilla repository]] &amp;lt;small&amp;gt;(forum archive)&amp;lt;/small&amp;gt;&lt;br /&gt;
* [[Security Hardening for Debian Users: Protecting Against Targeted Attacks]] &amp;lt;small&amp;gt;(full paper)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HowTo (guides) == &lt;br /&gt;
* [[MTR Network Diagnostics]]  &amp;lt;small&amp;gt;(full paper)&amp;lt;/small&amp;gt;&lt;br /&gt;
* [[WiFi Signal Strength and Sharing]] &amp;lt;small&amp;gt;(forum archive)&amp;lt;/small&amp;gt;&lt;br /&gt;
* [[REFInd USB Drive (for emergency boot)]] &amp;lt;small&amp;gt;(forum archive)&amp;lt;/small&amp;gt;&lt;br /&gt;
* [[Trixie iwd]] &amp;lt;small&amp;gt;(forum archive)&amp;lt;/small&amp;gt;&lt;br /&gt;
* [[Debian Live USB with Persistence]] &amp;lt;small&amp;gt;(full paper)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Licensing and Use ==&lt;br /&gt;
Licensing:&lt;br /&gt;
* [[Publish using CC International licencing and your Forum name]].&lt;br /&gt;
* [[Archive AI Use]]&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=File:Debian_USB_Persistent_Setup-005146.odt&amp;diff=214</id>
		<title>File:Debian USB Persistent Setup-005146.odt</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=File:Debian_USB_Persistent_Setup-005146.odt&amp;diff=214"/>
		<updated>2026-04-06T18:52:44Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: A persistent Debian live USB. By adding a persistence partition, you have a portable Debian installation: your shell configuration, your documents, your utilities, your scripts, your browser profile, all carried around in your pocket.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
A persistent Debian live USB. By adding a persistence partition, you have a portable Debian installation: your shell configuration, your documents, your utilities, your scripts, your browser profile, all carried around in your pocket.&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=MTR_Network_Diagnostics&amp;diff=209</id>
		<title>MTR Network Diagnostics</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=MTR_Network_Diagnostics&amp;diff=209"/>
		<updated>2026-03-28T23:50:00Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: /* Permission Note */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= MTR: Network Path Diagnostics =&lt;br /&gt;
&lt;br /&gt;
MTR combines the functionality of ping and traceroute into a single tool that monitors every hop along a network path continuously, producing statistical output that identifies where latency and packet loss actually occur. When basic connectivity tools confirm a problem exists but don’t locate it, MTR provides the data needed to isolate it.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt install mtr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MTR is available in the Debian main repository and requires no additional sources. It is maintained across all current Debian releases and installs without external dependencies. The package name is mtr, which includes both the command-line interface and mtr-packet, the helper binary responsible for sending and receiving network packets.&lt;br /&gt;
&lt;br /&gt;
=== Basic Usage ===&lt;br /&gt;
MTR operates in two modes: interactive, which displays a live updating view of the network path, and report mode, which runs a fixed number of cycles and prints a summary.&lt;br /&gt;
&lt;br /&gt;
* Interactive mode&lt;br /&gt;
&amp;lt;code&amp;gt;mtr example.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Report mode — 50 cycles, no DNS resolution&lt;br /&gt;
&amp;lt;code&amp;gt;mtr --report --report-cycles 50 --no-dns example.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* TCP mode — useful when ICMP is filtered&lt;br /&gt;
&amp;lt;code&amp;gt;sudo mtr --tcp --port 443 example.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Save report to file&lt;br /&gt;
&amp;lt;code&amp;gt;mtr --report --report-cycles 100 --no-dns example.com &amp;gt; mtr-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Output Example&lt;br /&gt;
|-&lt;br /&gt;
! Host !! hostname !! Loss% !! Snt !! Last !! Ave !! Best !! Wrst !! StDEV&lt;br /&gt;
|-&lt;br /&gt;
| 1. || 192.168.1.1 || 0.0% || 50 || 1.2 || 1.5 || 1.0 || 2.3 || 0.4 &lt;br /&gt;
|-&lt;br /&gt;
| 2.  || 10.0.0.1    || 0.0% || 50 || 8.5 || 9.2 || 7.8 || 12.1 || 1.3 &lt;br /&gt;
|-&lt;br /&gt;
| 3.  || isp-gateway.net ||  0.0% || 50 || 15.3 || 16.1 || 14.2 || 19.8 || 1.8 &lt;br /&gt;
|-&lt;br /&gt;
| 4.  || ??? || 100.0% || 50 || 0.0 || 0.0 || 0.0 || 0.0 || 0.0 &lt;br /&gt;
|-&lt;br /&gt;
| 5.  || destination.com || 0.0%||    50||   25.4||  26.8||  24.1|| 32.5||   2.4&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
Each row represents one hop. The columns report packet loss percentage, packets sent, and latency values in milliseconds — last, average, best, worst, and standard deviation. Standard deviation measures consistency: a low value indicates stable latency, a high value indicates jitter.&lt;br /&gt;
&lt;br /&gt;
==== Interpreting Results ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Packet loss at an intermediate hop that does not persist to subsequent hops&#039;&#039;&#039; is typically not a network problem. Many routers deprioritise or rate-limit ICMP responses while forwarding traffic normally. If hop 4 shows 100% loss but hop 5 responds cleanly, traffic is flowing through hop 4 — it simply isn’t generating diagnostic replies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Packet loss that begins at a hop and continues through to the destination&#039;&#039;&#039; indicates a genuine problem at or beyond that hop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A sudden increase in latency at a specific hop that persists to all subsequent hops&#039;&#039;&#039; points to a congested or slow link at that point in the path.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;High standard deviation&#039;&#039;&#039; indicates unstable latency, which affects real-time applications such as VoIP and video conferencing even when average latency appears acceptable.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A large latency increase with stable standard deviation and no packet loss&#039;&#039;&#039; reflects geographic distance or a slower interconnect, not a fault.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problems confined to the first hop&#039;&#039;&#039; — your local router — and absent from all subsequent hops point to a local network issue: wireless interference, a misconfigured interface, or a problem with the router itself.&lt;br /&gt;
&lt;br /&gt;
==== Practical Scenarios ====&lt;br /&gt;
===== Isolating a problem for an ISP or hosting provider =====&lt;br /&gt;
&lt;br /&gt;
Run an extended report against a known external address and save the output:&lt;br /&gt;
&amp;lt;code&amp;gt;mtr --report-cycles 100 --no-dns 8.8.8.8 &amp;gt; isp-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The report shows exactly where in the path packet loss or latency appears, which hop belongs to which network, and whether the problem is within the provider’s infrastructure or beyond it.&lt;br /&gt;
&lt;br /&gt;
===== Testing when ICMP is filtered =====&lt;br /&gt;
Some paths block ICMP but pass TCP traffic. Testing with TCP against a specific port confirms whether a service is reachable end-to-end:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo mtr --tcp --port 22 --report-cycles 50 remote-server.com&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo mtr --tcp --port 443 --report-cycles 50 remote-server.com&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
===== Diagnosing jitter for real-time applications =====&lt;br /&gt;
Run a longer test and focus on the StDev column:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mtr --report-cycles 200 game-server.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values above 5ms in the StDev column at any hop that persists to the destination will affect latency-sensitive applications.&lt;br /&gt;
&lt;br /&gt;
==== Catching intermittent problems ====&lt;br /&gt;
Intermittent issues require longer observation windows than a standard report provides:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mtr --report-cycles 500 --interval 1 target.com &amp;gt; long-test.txt&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Protocol Selection =====&lt;br /&gt;
&lt;br /&gt;
MTR supports ICMP (default), UDP, and TCP. When one protocol appears to show loss or filtering, testing with another confirms whether the issue is protocol-specific or affects all traffic:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Icmp&#039;&#039;&lt;br /&gt;
 mtr example.com &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;UDP&#039;&#039;&lt;br /&gt;
 mtr --udp example.com &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;TCP on port 80&#039;&#039;&lt;br /&gt;
 sudo mtr --tcp --port 80 example.com &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Output Formats =====&lt;br /&gt;
MTR can produce machine-readable output for logging or automated analysis:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
mtr --report --csv example.com&lt;br /&gt;
&lt;br /&gt;
mtr --report --json example.com&lt;br /&gt;
&lt;br /&gt;
mtr --report --xml example.com&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Additional Options =====&lt;br /&gt;
* Show both hostname and IP address&lt;br /&gt;
&amp;lt;code&amp;gt;mtr --show-ips example.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Display Autonomous System numbers&lt;br /&gt;
&amp;lt;code&amp;gt;mtr --aslookup example.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Limit maximum hops&lt;br /&gt;
&amp;lt;code&amp;gt;mtr --max-ttl 20 example.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Specify source address on systems with multiple interfaces&lt;br /&gt;
&amp;lt;code&amp;gt;mtr --address 192.168.1.100 example.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Force IPv4 or IPv6&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
mtr -4 example.com&lt;br /&gt;
&lt;br /&gt;
mtr -6 example.com&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Interactive Mode Key Bindings =====&lt;br /&gt;
In interactive mode, the following keys are available:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Available keys&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Action&lt;br /&gt;
|-&lt;br /&gt;
| d || Toggle display mode&lt;br /&gt;
|-&lt;br /&gt;
| n || Toggle between hostnames and IP addresses&lt;br /&gt;
|-&lt;br /&gt;
| r || Reset statistics&lt;br /&gt;
|-&lt;br /&gt;
| p || Pause and resume&lt;br /&gt;
|-&lt;br /&gt;
| u || Cycle between ICMP, UDP, and TCP&lt;br /&gt;
|-&lt;br /&gt;
| y || Toggle between IPv4 and IPv6&lt;br /&gt;
|-&lt;br /&gt;
| q || Quit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Useful Aliases =====&lt;br /&gt;
These aliases cover the most common diagnostic tasks. Add them to ~/.bashrc and reload with source ~/.bashrc:&lt;br /&gt;
&lt;br /&gt;
* Standard report — 50 cycles, no DNS&lt;br /&gt;
&amp;lt;code&amp;gt;alias mtrreport=&#039;mtr --report --report-cycles 50 --no-dns&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Extended report — 100 cycles&lt;br /&gt;
&amp;lt;code&amp;gt;alias mtrlong=&#039;mtr --report --report-cycles 100 --no-dns&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* HTTPS path test&lt;br /&gt;
&amp;lt;code&amp;gt;alias mtrhttps=&#039;sudo mtr --tcp --port 443 --report-cycles 50&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Permission Note =====&lt;br /&gt;
TCP mode on privileged ports requires either sudo or the cap_net_raw capability set on the mtr-packet binary:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo setcap cap_net_raw+ep /usr/bin/mtr-packet&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the capability, TCP tests run without sudo.&lt;br /&gt;
&lt;br /&gt;
Remember: If in doubt, search for the specific error message along with &amp;quot;Debian&amp;quot; and the version number. e.g. Debian 13 or point release if needed, Debian 13,1&lt;br /&gt;
&lt;br /&gt;
This work was contributed by distro-nix on Debian User Forums on 2025-10-27 23:38:22&lt;br /&gt;
&lt;br /&gt;
Further resources are available at https://www.debianfirstaid.org&lt;br /&gt;
[[index.php?title=Category:HowTo]]&lt;br /&gt;
[[index.php?title=Category:Networking]]&lt;br /&gt;
[[index.php?title=Category:Full Paper]]&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Fonts_and_Themes_in_Cinnamon_Desktop&amp;diff=208</id>
		<title>Fonts and Themes in Cinnamon Desktop</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Fonts_and_Themes_in_Cinnamon_Desktop&amp;diff=208"/>
		<updated>2026-03-28T23:45:53Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: /* Additional Resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fonts and Themes in Cinnamon Desktop ==&lt;br /&gt;
&lt;br /&gt;
* Verified on Debian 13.1 (Trixie) / 6.12.43+deb13-amd64 x64_64&lt;br /&gt;
* Created : 28/10/2025 21:09:21&lt;br /&gt;
* Last Updated : 27/10/2025 23:42:45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A comprehensive reference for managing console fonts, GUI fonts, and theme customization in Debian with Cinnamon DE.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;table-of-contents&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Table of Contents ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;[https://claude.ai/chat/6986fa74-5020-47a2-8736-f9eaf474bfc0#understanding-font-types Understanding Font Types]&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;[https://claude.ai/chat/6986fa74-5020-47a2-8736-f9eaf474bfc0#console-fonts-tty Console Fonts (TTY)]&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;[https://claude.ai/chat/6986fa74-5020-47a2-8736-f9eaf474bfc0#gui-fonts GUI Fonts]&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;[https://claude.ai/chat/6986fa74-5020-47a2-8736-f9eaf474bfc0#cinnamon-system-fonts Cinnamon System Fonts]&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;[https://claude.ai/chat/6986fa74-5020-47a2-8736-f9eaf474bfc0#theme-customization-with-css Theme Customization with CSS]&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;[https://claude.ai/chat/6986fa74-5020-47a2-8736-f9eaf474bfc0#accessibility-and-scaling Accessibility and Scaling]&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;[https://claude.ai/chat/6986fa74-5020-47a2-8736-f9eaf474bfc0#troubleshooting Troubleshooting]&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;understanding-font-types&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Understanding Font Types ==&lt;br /&gt;
&lt;br /&gt;
Linux uses different font systems depending on where text appears:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;console-fonts-tty&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Console Fonts (TTY) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Format&#039;&#039;&#039;: PSF (PC Screen Font) - .psf or .psf.gz&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Location&#039;&#039;&#039;: /usr/share/consolefonts/&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Used by&#039;&#039;&#039;: Text-based virtual consoles (Ctrl+Alt+F2 through F6)&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Loaded&#039;&#039;&#039;: Before graphical system starts&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Limitations&#039;&#039;&#039;: No anti-aliasing, fixed character grid&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;gui-fonts&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== GUI Fonts ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Formats&#039;&#039;&#039;: TrueType (.ttf), OpenType (.otf)&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Location&#039;&#039;&#039;: /usr/share/fonts/truetype/, /usr/share/fonts/opentype/&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Used by&#039;&#039;&#039;: All graphical applications&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Features&#039;&#039;&#039;: Anti-aliasing, scalability, subpixel rendering&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;why-two-systems&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Why Two Systems? ===&lt;br /&gt;
&lt;br /&gt;
The Linux console operates at a lower level than the graphical interface. It needs to display text even if the GUI fails to load, so it uses simpler font formats that don&#039;t require graphics libraries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;console-fonts-tty-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Console Fonts (TTY) ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;installing-console-fonts&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Installing Console Fonts ===&lt;br /&gt;
&lt;br /&gt;
Install Terminus (popular monospace console font):&lt;br /&gt;
&lt;br /&gt;
sudo apt update&lt;br /&gt;
&lt;br /&gt;
sudo apt install console-setup xfonts-terminus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;configuring-console-fonts&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Configuring Console Fonts ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;method-1-interactive-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Method 1: Interactive Configuration ====&lt;br /&gt;
&lt;br /&gt;
sudo dpkg-reconfigure console-setup&lt;br /&gt;
&lt;br /&gt;
Follow the prompts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Encoding&#039;&#039;&#039;: UTF-8&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Character set&#039;&#039;&#039;: Guess optimal character set&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Font&#039;&#039;&#039;: Terminus&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Font size&#039;&#039;&#039;: Choose from available sizes&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Available Terminus sizes: 8x14, 8x16, 10x20, 12x24, 14x28, 16x32&lt;br /&gt;
&lt;br /&gt;
Recommendation: 16x32 for good readability&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;method-2-direct-configuration-file-editing&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Method 2: Direct Configuration File Editing ====&lt;br /&gt;
&lt;br /&gt;
Edit /etc/default/console-setup:&lt;br /&gt;
&lt;br /&gt;
sudo nano /etc/default/console-setup&lt;br /&gt;
&lt;br /&gt;
Add or modify these lines:&lt;br /&gt;
&lt;br /&gt;
FONTFACE=&amp;amp;quot;Terminus&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
FONTSIZE=&amp;amp;quot;16x32&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
Other useful settings you might find:&lt;br /&gt;
&lt;br /&gt;
CHARMAP=&amp;amp;quot;UTF-8&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
CODESET=&amp;amp;quot;guess&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;applying-console-font-changes&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Applying Console Font Changes ===&lt;br /&gt;
&lt;br /&gt;
The changes take effect on boot, but to apply immediately on all consoles:&lt;br /&gt;
&lt;br /&gt;
sudo setupcon&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This command only works when run from an actual TTY console, not from a terminal emulator in the GUI. If you get &amp;amp;quot;not on the console&amp;amp;quot; error, that&#039;s normal - the configuration is saved and will apply on next boot or when you switch to a TTY.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;testing-console-fonts&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Testing Console Fonts ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Switch to virtual console: Ctrl + Alt + F2&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Log in with your credentials&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Check the font - you should see Terminus&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Return to GUI: Ctrl + Alt + F1 or Ctrl + Alt + F7&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;viewing-available-console-fonts&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Viewing Available Console Fonts ===&lt;br /&gt;
&lt;br /&gt;
List all available console fonts:&lt;br /&gt;
&lt;br /&gt;
ls /usr/share/consolefonts/&lt;br /&gt;
&lt;br /&gt;
Filter for Terminus fonts:&lt;br /&gt;
&lt;br /&gt;
ls /usr/share/consolefonts/ | grep -i ter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;temporarily-testing-console-fonts&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Temporarily Testing Console Fonts ===&lt;br /&gt;
&lt;br /&gt;
To test a font before making it permanent:&lt;br /&gt;
&lt;br /&gt;
setfont /usr/share/consolefonts/Ter16x32n.psf.gz&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: setfont only works when run from a TTY console (Ctrl+Alt+F2), not from GUI terminals.&lt;br /&gt;
&lt;br /&gt;
To check current console font (from TTY):&lt;br /&gt;
&lt;br /&gt;
setfont -v&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;gui-fonts-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== GUI Fonts ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;installing-gui-fonts&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Installing GUI Fonts ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;system-wide-installation&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== System-wide Installation ====&lt;br /&gt;
&lt;br /&gt;
Install Terminus for graphical applications:&lt;br /&gt;
&lt;br /&gt;
sudo apt install fonts-terminus&lt;br /&gt;
&lt;br /&gt;
Install other popular fonts:&lt;br /&gt;
&lt;br /&gt;
# Programming fonts&lt;br /&gt;
&lt;br /&gt;
sudo apt install fonts-firacode fonts-hack fonts-jetbrains-mono&lt;br /&gt;
&lt;br /&gt;
# General purpose fonts&lt;br /&gt;
&lt;br /&gt;
sudo apt install fonts-liberation fonts-dejavu fonts-noto&lt;br /&gt;
&lt;br /&gt;
# More options&lt;br /&gt;
&lt;br /&gt;
sudo apt install fonts-ubuntu fonts-roboto&lt;br /&gt;
&lt;br /&gt;
After installing, log out and back in, or rebuild font cache:&lt;br /&gt;
&lt;br /&gt;
fc-cache -fv&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;user-only-installation&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== User-only Installation ====&lt;br /&gt;
&lt;br /&gt;
To install fonts just for your user account:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Create fonts directory:&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
mkdir -p ~/.local/share/fonts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;2&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Copy font files (.ttf or .otf) to this directory:&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
cp /path/to/your/font.ttf ~/.local/share/fonts/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;3&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Rebuild font cache:&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
fc-cache -fv&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;font-locations&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Font Locations ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;System-wide fonts&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
/usr/share/fonts/truetype/&lt;br /&gt;
&lt;br /&gt;
/usr/share/fonts/opentype/&lt;br /&gt;
&lt;br /&gt;
/usr/share/fonts/X11/&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;User-specific fonts&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
~/.local/share/fonts/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;listing-available-fonts&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Listing Available Fonts ===&lt;br /&gt;
&lt;br /&gt;
List all fonts available to GUI applications:&lt;br /&gt;
&lt;br /&gt;
fc-list&lt;br /&gt;
&lt;br /&gt;
Search for specific font:&lt;br /&gt;
&lt;br /&gt;
fc-list | grep -i terminus&lt;br /&gt;
&lt;br /&gt;
fc-list | grep -i dejavu&lt;br /&gt;
&lt;br /&gt;
List fonts with details:&lt;br /&gt;
&lt;br /&gt;
fc-list : family style file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;configuring-terminal-emulator-fonts&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Configuring Terminal Emulator Fonts ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;gnome-terminal-default-in-cinnamon&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== GNOME Terminal (default in Cinnamon) ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Open GNOME Terminal&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Menu → Preferences&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Select your profile&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Go to &#039;&#039;&#039;Text&#039;&#039;&#039; tab&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Uncheck &amp;amp;quot;Use the system fixed-width font&amp;amp;quot;&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Click font button and select Terminus (or other font)&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Choose size (12, 14, or 16 recommended)&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;guake-drop-down-terminal&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Guake (Drop-down Terminal) ====&lt;br /&gt;
&lt;br /&gt;
Install GUI version of Terminus first:&lt;br /&gt;
&lt;br /&gt;
sudo apt install fonts-terminus&lt;br /&gt;
&lt;br /&gt;
guake --quit&lt;br /&gt;
&lt;br /&gt;
guake &amp;amp;amp;&lt;br /&gt;
&lt;br /&gt;
Configure via GUI:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Open Guake (F12)&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Right-click → Preferences&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Go to &#039;&#039;&#039;Appearance&#039;&#039;&#039; tab&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Uncheck &amp;amp;quot;Use the system fixed width font&amp;amp;quot;&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Select Terminus and size&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure via command line:&lt;br /&gt;
&lt;br /&gt;
gsettings set org.guake.style.font use-system-font false&lt;br /&gt;
&lt;br /&gt;
gsettings set org.guake.style.font font-name &#039;Terminus 12&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;cinnamon-system-fonts&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Cinnamon System Fonts ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;quick-font-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Quick Font Configuration ===&lt;br /&gt;
&lt;br /&gt;
Open &#039;&#039;&#039;System Settings&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
cinnamon-settings&lt;br /&gt;
&lt;br /&gt;
Navigate to: &#039;&#039;&#039;Font Selection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll see these options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Default font&#039;&#039;&#039;: Used for menus, buttons, dialogs (recommended: 10-12pt)&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Desktop font&#039;&#039;&#039;: Used for desktop icon labels (recommended: 10-11pt)&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Document font&#039;&#039;&#039;: Used in document viewers (recommended: 11pt)&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Monospace font&#039;&#039;&#039;: Used in terminals and code editors (recommended: Terminus 12pt)&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;&#039;&#039;&#039;Window title font&#039;&#039;&#039;: Used in window title bars (recommended: 10-11pt bold)&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;recommended-configuration-for-better-readability&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Recommended Configuration for Better Readability ===&lt;br /&gt;
&lt;br /&gt;
Default font: Sans 11 or 12&lt;br /&gt;
&lt;br /&gt;
Desktop font: Sans 10 or 11&lt;br /&gt;
&lt;br /&gt;
Document font: Sans 11&lt;br /&gt;
&lt;br /&gt;
Monospace font: Terminus 12 or 14&lt;br /&gt;
&lt;br /&gt;
Window title font: Sans Bold 10 or 11&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;using-command-line-to-change-fonts&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Using Command Line to Change Fonts ===&lt;br /&gt;
&lt;br /&gt;
View current settings:&lt;br /&gt;
&lt;br /&gt;
gsettings get org.cinnamon.desktop.interface font-name&lt;br /&gt;
&lt;br /&gt;
gsettings get org.gnome.desktop.interface monospace-font-name&lt;br /&gt;
&lt;br /&gt;
Change default font:&lt;br /&gt;
&lt;br /&gt;
gsettings set org.cinnamon.desktop.interface font-name &#039;Sans 12&#039;&lt;br /&gt;
&lt;br /&gt;
Change monospace font:&lt;br /&gt;
&lt;br /&gt;
gsettings set org.gnome.desktop.interface monospace-font-name &#039;Terminus 12&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;font-recommendations-by-use-case&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Font Recommendations by Use Case ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For general readability&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Default: DejaVu Sans 11-12&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Monospace: Terminus 12 or DejaVu Sans Mono 11&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For programming&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Monospace: Fira Code 11, JetBrains Mono 11, or Hack 11&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For visually impaired users&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Default: Sans 13-14&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Monospace: Terminus 14-16&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Consider UI scaling (see Accessibility section)&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;theme-customization-with-css&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Theme Customization with CSS ==&lt;br /&gt;
&lt;br /&gt;
Cinnamon themes use CSS for styling. You can customize any theme to change fonts, colors, spacing, and more.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;finding-your-current-theme&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Finding Your Current Theme ===&lt;br /&gt;
&lt;br /&gt;
Check which theme you&#039;re using:&lt;br /&gt;
&lt;br /&gt;
gsettings get org.cinnamon.theme name&lt;br /&gt;
&lt;br /&gt;
List available themes:&lt;br /&gt;
&lt;br /&gt;
ls /usr/share/themes/&lt;br /&gt;
&lt;br /&gt;
ls ~/.themes/&lt;br /&gt;
&lt;br /&gt;
View your theme in System Settings: &#039;&#039;&#039;System Settings → Themes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;creating-a-custom-theme-copy&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Creating a Custom Theme Copy ===&lt;br /&gt;
&lt;br /&gt;
Always work on a copy to avoid breaking your system:&lt;br /&gt;
&lt;br /&gt;
# Copy system theme to your user directory&lt;br /&gt;
&lt;br /&gt;
cp -r /usr/share/themes/YOUR-THEME-NAME ~/.themes/&lt;br /&gt;
&lt;br /&gt;
# Example:&lt;br /&gt;
&lt;br /&gt;
cp -r /usr/share/themes/Mint-Y ~/.themes/&lt;br /&gt;
&lt;br /&gt;
cp -r /usr/share/themes/Green-Submarine ~/.themes/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;theme-structure&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Theme Structure ===&lt;br /&gt;
&lt;br /&gt;
A typical Cinnamon theme:&lt;br /&gt;
&lt;br /&gt;
~/.themes/YOUR-THEME-NAME/&lt;br /&gt;
&lt;br /&gt;
├── cinnamon/&lt;br /&gt;
&lt;br /&gt;
│ ├── cinnamon.css # Main styling file&lt;br /&gt;
&lt;br /&gt;
│ ├── thumbnail.png&lt;br /&gt;
&lt;br /&gt;
│ └── assets/ # Images, icons&lt;br /&gt;
&lt;br /&gt;
├── gtk-3.0/ # GTK3 application styling&lt;br /&gt;
&lt;br /&gt;
├── gtk-2.0/ # GTK2 application styling&lt;br /&gt;
&lt;br /&gt;
├── metacity-1/ # Window decorations&lt;br /&gt;
&lt;br /&gt;
└── index.theme # Theme metadata&lt;br /&gt;
&lt;br /&gt;
The file you&#039;ll edit most: cinnamon/cinnamon.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;editing-theme-css&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Editing Theme CSS ===&lt;br /&gt;
&lt;br /&gt;
Open the CSS file:&lt;br /&gt;
&lt;br /&gt;
nano ~/.themes/YOUR-THEME-NAME/cinnamon/cinnamon.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;common-css-selectors&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Common CSS Selectors ====&lt;br /&gt;
&lt;br /&gt;
/* Overall stage - affects most UI elements */&lt;br /&gt;
&lt;br /&gt;
stage {&lt;br /&gt;
&lt;br /&gt;
font-size: 10pt;&lt;br /&gt;
&lt;br /&gt;
font-family: sans-serif;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Main menu */&lt;br /&gt;
&lt;br /&gt;
.menu {&lt;br /&gt;
&lt;br /&gt;
font-size: 10pt;&lt;br /&gt;
&lt;br /&gt;
background-color: rgba(48, 48, 48, 0.95);&lt;br /&gt;
&lt;br /&gt;
border-radius: 8px;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Menu application buttons */&lt;br /&gt;
&lt;br /&gt;
.menu-application-button-label {&lt;br /&gt;
&lt;br /&gt;
font-size: 9pt;&lt;br /&gt;
&lt;br /&gt;
padding-left: 10px;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Panel (taskbar) */&lt;br /&gt;
&lt;br /&gt;
.panel {&lt;br /&gt;
&lt;br /&gt;
font-size: 9pt;&lt;br /&gt;
&lt;br /&gt;
background-color: #2b2b2b;&lt;br /&gt;
&lt;br /&gt;
height: 32px;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Panel applet labels */&lt;br /&gt;
&lt;br /&gt;
.panel-button {&lt;br /&gt;
&lt;br /&gt;
font-size: 9pt;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Notifications */&lt;br /&gt;
&lt;br /&gt;
.notification {&lt;br /&gt;
&lt;br /&gt;
font-size: 10pt;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Window list buttons */&lt;br /&gt;
&lt;br /&gt;
.window-list-item-box {&lt;br /&gt;
&lt;br /&gt;
font-size: 9pt;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Tooltips */&lt;br /&gt;
&lt;br /&gt;
.tooltip {&lt;br /&gt;
&lt;br /&gt;
font-size: 9pt;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-increasing-menu-font-size&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: Increasing Menu Font Size ===&lt;br /&gt;
&lt;br /&gt;
Find the menu section and modify:&lt;br /&gt;
&lt;br /&gt;
.menu {&lt;br /&gt;
&lt;br /&gt;
font-size: 14pt; /* Increase from default 9-10pt */&lt;br /&gt;
&lt;br /&gt;
background-color: rgba(48, 48, 48, 0.95);&lt;br /&gt;
&lt;br /&gt;
border-radius: 8px;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.menu-application-button-label {&lt;br /&gt;
&lt;br /&gt;
font-size: 13pt; /* Increase menu item text */&lt;br /&gt;
&lt;br /&gt;
padding-left: 10px;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Also increase category labels */&lt;br /&gt;
&lt;br /&gt;
.menu-category-button-label {&lt;br /&gt;
&lt;br /&gt;
font-size: 13pt;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-changing-font-family&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: Changing Font Family ===&lt;br /&gt;
&lt;br /&gt;
stage {&lt;br /&gt;
&lt;br /&gt;
font-family: &amp;amp;quot;DejaVu Sans&amp;amp;quot;, sans-serif;&lt;br /&gt;
&lt;br /&gt;
font-size: 11pt;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Use monospace for specific elements */&lt;br /&gt;
&lt;br /&gt;
.some-element {&lt;br /&gt;
&lt;br /&gt;
font-family: &amp;amp;quot;Terminus&amp;amp;quot;, &amp;amp;quot;DejaVu Sans Mono&amp;amp;quot;, monospace;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;applying-css-changes&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Applying CSS Changes ===&lt;br /&gt;
&lt;br /&gt;
After editing the CSS file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Save the file: Ctrl+O then Enter (in nano)&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Exit: Ctrl+X (in nano)&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Restart Cinnamon: Press Alt+F2, type r, press Enter&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or reload from command line:&lt;br /&gt;
&lt;br /&gt;
# Ensure theme is set&lt;br /&gt;
&lt;br /&gt;
gsettings set org.cinnamon.theme name &#039;YOUR-THEME-NAME&#039;&lt;br /&gt;
&lt;br /&gt;
# Restart Cinnamon&lt;br /&gt;
&lt;br /&gt;
cinnamon --replace &amp;amp;amp;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;css-tips-and-tricks&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== CSS Tips and Tricks ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finding the right selector&#039;&#039;&#039;: Use Cinnamon&#039;s Looking Glass debugger&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Press Alt+F2&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Type lg and press Enter&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Go to &#039;&#039;&#039;Picker&#039;&#039;&#039; tab&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Click on UI elements to see their CSS classes&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Testing changes quickly&#039;&#039;&#039;: Keep the CSS file open in one workspace, test in another, and use Alt+F2 → r to reload.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Backup before editing&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
cp ~/.themes/YOUR-THEME-NAME/cinnamon/cinnamon.css ~/.themes/YOUR-THEME-NAME/cinnamon/cinnamon.css.backup&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restore backup if needed&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
cp ~/.themes/YOUR-THEME-NAME/cinnamon/cinnamon.css.backup ~/.themes/YOUR-THEME-NAME/cinnamon/cinnamon.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;common-css-properties&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Common CSS Properties ===&lt;br /&gt;
&lt;br /&gt;
/* Fonts */&lt;br /&gt;
&lt;br /&gt;
font-family: &amp;amp;quot;Font Name&amp;amp;quot;, fallback;&lt;br /&gt;
&lt;br /&gt;
font-size: 10pt; /* or 12px, 1.2em */&lt;br /&gt;
&lt;br /&gt;
font-weight: bold; /* or normal, 600 */&lt;br /&gt;
&lt;br /&gt;
font-style: italic;&lt;br /&gt;
&lt;br /&gt;
/* Colors */&lt;br /&gt;
&lt;br /&gt;
color: #ffffff;&lt;br /&gt;
&lt;br /&gt;
background-color: rgba(48, 48, 48, 0.95);&lt;br /&gt;
&lt;br /&gt;
border-color: #444444;&lt;br /&gt;
&lt;br /&gt;
/* Spacing */&lt;br /&gt;
&lt;br /&gt;
padding: 10px;&lt;br /&gt;
&lt;br /&gt;
margin: 5px;&lt;br /&gt;
&lt;br /&gt;
padding-left: 10px;&lt;br /&gt;
&lt;br /&gt;
/* Borders */&lt;br /&gt;
&lt;br /&gt;
border: 1px solid #444444;&lt;br /&gt;
&lt;br /&gt;
border-radius: 8px;&lt;br /&gt;
&lt;br /&gt;
/* Sizing */&lt;br /&gt;
&lt;br /&gt;
width: 300px;&lt;br /&gt;
&lt;br /&gt;
height: 40px;&lt;br /&gt;
&lt;br /&gt;
min-width: 200px;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;accessibility-and-scaling&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Accessibility and Scaling ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;ui-scaling-recommended-for-visual-impairment&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== UI Scaling (Recommended for Visual Impairment) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;via-system-settings&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Via System Settings ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;System Settings → Display → UI Scale&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Options typically: 100%, 125%, 150%, 200%&lt;br /&gt;
&lt;br /&gt;
Start with 125% and adjust as needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;via-command-line&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Via Command Line ====&lt;br /&gt;
&lt;br /&gt;
# Check current scaling&lt;br /&gt;
&lt;br /&gt;
gsettings get org.cinnamon.desktop.interface scaling-factor&lt;br /&gt;
&lt;br /&gt;
# Set scaling (1 = 100%, 2 = 200%)&lt;br /&gt;
&lt;br /&gt;
gsettings set org.cinnamon.desktop.interface scaling-factor 2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Fractional scaling (1.25, 1.5) may not be available on all systems.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;text-scaling-only&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Text Scaling Only ===&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t want to scale everything, increase text size:&lt;br /&gt;
&lt;br /&gt;
# Increase text scaling factor&lt;br /&gt;
&lt;br /&gt;
gsettings set org.gnome.desktop.interface text-scaling-factor 1.25&lt;br /&gt;
&lt;br /&gt;
Values: 1.0 = 100%, 1.25 = 125%, 1.5 = 150%&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;high-contrast-themes&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== High Contrast Themes ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;System Settings → Themes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Look for high-contrast themes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;HighContrast (if available)&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;HighContrastInverse&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or install:&lt;br /&gt;
&lt;br /&gt;
sudo apt install gnome-themes-extra&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;large-cursor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Large Cursor ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;System Settings → Mouse and Touchpad → Cursor&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Select a larger cursor size (32px or 48px).&lt;br /&gt;
&lt;br /&gt;
Or via command line:&lt;br /&gt;
&lt;br /&gt;
gsettings set org.cinnamon.desktop.interface cursor-size 32&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;desktop-zoom-magnifier&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Desktop Zoom (Magnifier) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;System Settings → Accessibility → Zoom&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Enable desktop magnification. Typical shortcut: Alt + Super + 8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;font-smoothing&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Font Smoothing ===&lt;br /&gt;
&lt;br /&gt;
Ensure font smoothing is enabled for better readability:&lt;br /&gt;
&lt;br /&gt;
gsettings set org.cinnamon.settings-daemon.plugins.xsettings antialiasing &#039;rgba&#039;&lt;br /&gt;
&lt;br /&gt;
gsettings set org.cinnamon.settings-daemon.plugins.xsettings hinting &#039;slight&#039;&lt;br /&gt;
&lt;br /&gt;
Options for antialiasing: none, grayscale, rgba Options for hinting: none, slight, medium, full&lt;br /&gt;
&lt;br /&gt;
Recommended: rgba with slight hinting&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;troubleshooting&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;console-font-issues&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Console Font Issues ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problem&#039;&#039;&#039;: setupcon says &amp;amp;quot;not on the console&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solution&#039;&#039;&#039;: This is normal when running from GUI. The configuration is saved. Test by switching to TTY with Ctrl+Alt+F2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problem&#039;&#039;&#039;: Font changes don&#039;t persist after reboot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solution&#039;&#039;&#039;: Verify /etc/default/console-setup has correct settings. Run sudo dpkg-reconfigure console-setup again.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problem&#039;&#039;&#039;: setfont gives &amp;amp;quot;couldn&#039;t get file descriptor&amp;amp;quot; error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solution&#039;&#039;&#039;: setfont only works from actual TTY console, not GUI terminal emulators.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;gui-font-issues&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== GUI Font Issues ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problem&#039;&#039;&#039;: Installed font doesn&#039;t appear in applications&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solution&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
# Rebuild font cache&lt;br /&gt;
&lt;br /&gt;
fc-cache -fv&lt;br /&gt;
&lt;br /&gt;
# Log out and back in&lt;br /&gt;
&lt;br /&gt;
# Or restart the application&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problem&#039;&#039;&#039;: Font looks pixelated or ugly&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solution&#039;&#039;&#039;: Check antialiasing settings:&lt;br /&gt;
&lt;br /&gt;
gsettings set org.cinnamon.settings-daemon.plugins.xsettings antialiasing &#039;rgba&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problem&#039;&#039;&#039;: Terminus not showing in Guake&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solution&#039;&#039;&#039;: Install the TrueType version:&lt;br /&gt;
&lt;br /&gt;
sudo apt install fonts-terminus&lt;br /&gt;
&lt;br /&gt;
guake --quit&lt;br /&gt;
&lt;br /&gt;
guake &amp;amp;amp;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;theme-css-issues&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Theme CSS Issues ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problem&#039;&#039;&#039;: CSS changes don&#039;t take effect&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solution&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Save the CSS file&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Restart Cinnamon: Alt+F2 → r&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Verify you&#039;re editing the active theme&#039;s CSS&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Check for CSS syntax errors&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problem&#039;&#039;&#039;: Cinnamon crashes after CSS edit&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solution&#039;&#039;&#039;: Boot to TTY (Ctrl+Alt+F2), restore backup:&lt;br /&gt;
&lt;br /&gt;
cp ~/.themes/YOUR-THEME/cinnamon/cinnamon.css.backup ~/.themes/YOUR-THEME/cinnamon/cinnamon.css&lt;br /&gt;
&lt;br /&gt;
Then switch back to GUI and restart Cinnamon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problem&#039;&#039;&#039;: Can&#039;t find the right CSS selector&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solution&#039;&#039;&#039;: Use Looking Glass:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Alt+F2 → type lg → Enter&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Go to Picker tab&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Click UI element to see its classes&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;scaling-issues&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Scaling Issues ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problem&#039;&#039;&#039;: UI scaling makes everything blurry&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solution&#039;&#039;&#039;: Some applications don&#039;t handle scaling well. Try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Integer scaling only (100%, 200%) instead of fractional&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Increase font sizes instead of UI scaling&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Update graphics drivers&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problem&#039;&#039;&#039;: Some applications ignore scaling&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solution&#039;&#039;&#039;: Set scaling per-application (for X11 apps):&lt;br /&gt;
&lt;br /&gt;
GDK_SCALE=2 application-name&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;quick-reference-commands&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Quick Reference Commands ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;console-fonts&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Console Fonts ===&lt;br /&gt;
&lt;br /&gt;
# Configure interactively&lt;br /&gt;
&lt;br /&gt;
sudo dpkg-reconfigure console-setup&lt;br /&gt;
&lt;br /&gt;
# Apply changes&lt;br /&gt;
&lt;br /&gt;
sudo setupcon&lt;br /&gt;
&lt;br /&gt;
# List console fonts&lt;br /&gt;
&lt;br /&gt;
ls /usr/share/consolefonts/&lt;br /&gt;
&lt;br /&gt;
# Test font (from TTY only)&lt;br /&gt;
&lt;br /&gt;
setfont /usr/share/consolefonts/Ter16x32n.psf.gz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;gui-fonts-2&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== GUI Fonts ===&lt;br /&gt;
&lt;br /&gt;
# Install fonts&lt;br /&gt;
&lt;br /&gt;
sudo apt install fonts-terminus fonts-firacode&lt;br /&gt;
&lt;br /&gt;
# Rebuild font cache&lt;br /&gt;
&lt;br /&gt;
fc-cache -fv&lt;br /&gt;
&lt;br /&gt;
# List all fonts&lt;br /&gt;
&lt;br /&gt;
fc-list&lt;br /&gt;
&lt;br /&gt;
# Search for specific font&lt;br /&gt;
&lt;br /&gt;
fc-list | grep -i terminus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;cinnamon-settings&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Cinnamon Settings ===&lt;br /&gt;
&lt;br /&gt;
# Open settings&lt;br /&gt;
&lt;br /&gt;
cinnamon-settings&lt;br /&gt;
&lt;br /&gt;
# Check current theme&lt;br /&gt;
&lt;br /&gt;
gsettings get org.cinnamon.theme name&lt;br /&gt;
&lt;br /&gt;
# Set theme&lt;br /&gt;
&lt;br /&gt;
gsettings set org.cinnamon.theme name &#039;YOUR-THEME&#039;&lt;br /&gt;
&lt;br /&gt;
# UI scaling&lt;br /&gt;
&lt;br /&gt;
gsettings set org.cinnamon.desktop.interface scaling-factor 2&lt;br /&gt;
&lt;br /&gt;
# Restart Cinnamon&lt;br /&gt;
&lt;br /&gt;
Alt+F2 → r&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;theme-editing&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Theme Editing ===&lt;br /&gt;
&lt;br /&gt;
# Copy theme&lt;br /&gt;
&lt;br /&gt;
cp -r /usr/share/themes/THEME-NAME ~/.themes/&lt;br /&gt;
&lt;br /&gt;
# Edit CSS&lt;br /&gt;
&lt;br /&gt;
nano ~/.themes/THEME-NAME/cinnamon/cinnamon.css&lt;br /&gt;
&lt;br /&gt;
# Backup CSS&lt;br /&gt;
&lt;br /&gt;
cp ~/.themes/THEME-NAME/cinnamon/cinnamon.css{,.backup}&lt;br /&gt;
&lt;br /&gt;
# Restore backup&lt;br /&gt;
&lt;br /&gt;
cp ~/.themes/THEME-NAME/cinnamon/cinnamon.css{.backup,}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;additional-resources&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Additional Resources ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Official Cinnamon Documentation&#039;&#039;&#039;: https://cinnamon-spices.linuxmint.com/&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cinnamon GitHub&#039;&#039;&#039;: https://github.com/linuxmint/cinnamon&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Theme Development Guide&#039;&#039;&#039;: Available in Cinnamon documentation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Font Configuration&#039;&#039;&#039;: man fonts-conf or man fc-cache&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Console Setup&#039;&#039;&#039;: man console-setup or man setupcon&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last Updated&#039;&#039;&#039;: October 2025&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Compatible with&#039;&#039;&#039;: Debian 13, Linux Mint 21+, any distribution using Cinnamon DE&lt;br /&gt;
&lt;br /&gt;
=== Credits &amp;amp; Comments ===&lt;br /&gt;
This work was contributed by distro-nix on Debian User Forums on 2026-03-28 19:43:50&lt;br /&gt;
&lt;br /&gt;
I welcome comments, suggestions or resources : dev@divsmart.com . or visit https://www.debianfirstaid.org for more resources.&lt;br /&gt;
&lt;br /&gt;
[[index.php?title=Category:Fonts]]&lt;br /&gt;
[[index.php?title=Category:Themes]]&lt;br /&gt;
[[index.php?title=Category:Desktop]]&lt;br /&gt;
[[index.php?title=Category:Full Paper]]&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=206</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=206"/>
		<updated>2026-03-12T02:39:20Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: /* Debian First Aid Kit */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Debian First Aid Kit =&lt;br /&gt;
&#039;&#039;&#039;All commands are verified on Debian 13.1 (Trixie) / 6.12.73+deb13-amd64 and&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6.16.3+deb13-amd64 x64_64&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Created : 2025-10-27 15:54:21&lt;br /&gt;
&lt;br /&gt;
Last Updated : 2026-03-11 22:18:41 &#039;&#039;&#039;ID : 544000.5&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This guide is preserved in its original form. For updated content and the forthcoming Debian book, visit www.debianfirstaid.org .&lt;br /&gt;
&lt;br /&gt;
== Table of Contents ==&lt;br /&gt;
&lt;br /&gt;
# Issues&lt;br /&gt;
# Package Management Issues&lt;br /&gt;
# Disk &amp;amp; Filesystem Issues&lt;br /&gt;
# Performance Issues&lt;br /&gt;
# Service &amp;amp; Application Errors&lt;br /&gt;
# Permission &amp;amp; Access Issues&lt;br /&gt;
# Hardware IssuesSystem Freezes &amp;amp; Crashes&lt;br /&gt;
# Boot Problems&lt;br /&gt;
# Network&lt;br /&gt;
# Quick Diagnostic Commands&lt;br /&gt;
# Useful Aliases &amp;amp; Shortcuts&lt;br /&gt;
# Tips for Effective Troubleshooting&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 1. System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# View logs from previous boot (after freeze/crash)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;journalctl -b -1&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# List all available boots&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;journalctl --list-boots&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Show only kernel messages from previous boot&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;journalctl -b -1 -k&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Show errors and critical messages only&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;journalctl -b -1 -p err&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Save logs to file for analysis&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;journalctl -b -1 &amp;gt; ~/crash-log.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics&#039;&#039;&#039;: Search for &amp;quot;kernel panic&amp;quot; or &amp;quot;Oops&amp;quot;&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM)&#039;&#039;&#039;: Search for &amp;quot;Out of memory&amp;quot; or &amp;quot;oom-killer&amp;quot;&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors&#039;&#039;&#039;: Look for &amp;quot;MCE&amp;quot; (Machine Check Exception) or &amp;quot;hardware error&amp;quot;&lt;br /&gt;
* &#039;&#039;&#039;Driver issues&#039;&#039;&#039;: Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating&#039;&#039;&#039;: Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# View memory usage&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;free -h&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check disk space&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;df -h&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Monitor system resources in real-time&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;htop&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# or&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;top&amp;lt;/code&amp;gt;&lt;br /&gt;
 (I prefer btop for better presentation)&lt;br /&gt;
 You would need to install it. sudo apt install btop&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check for disk errors&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo dmesg | grep -i error&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;These are permanent errors due to incomplete/buggy ACPI tables in the BIOS, but they are harmless :&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 2. Boot Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Check Boot Process ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# View systemd boot analysis&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;systemd-analyze blame&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# See what failed during boot&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;systemctl --failed&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check specific service status&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;systemctl status &amp;lt;service-name&amp;gt; e.g NetworkManager.service&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
&lt;br /&gt;
# Reboot and hold &amp;lt;code&amp;gt;Shift&amp;lt;/code&amp;gt; to access GRUB menu (depending on your grub timing settings)&lt;br /&gt;
# Select &amp;quot;Advanced options&amp;quot;&lt;br /&gt;
# Choose recovery mode&lt;br /&gt;
# Select &amp;quot;root&amp;quot; for root shell access&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Repair filesystem errors&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;Once you identify a device with lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo fsck /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Reinstall GRUB bootloader&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo grub-install /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo update-grub&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check fstab for mount errors&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;cat /etc/fstab&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 3. Network Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose Network Connection ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Check network interfaces&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ip addr show&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Test connectivity&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ping -c 4 8.8.8.8&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ping -c 6 2a00:1450:4007:809::200e&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check DNS resolution&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;nslookup google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# View routing table&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ip route show&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check active connections&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ss -tuln&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Restart Network Service ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# For systems with NetworkManager&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo systemctl restart NetworkManager&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# For systems with networking service&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo systemctl restart networking&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Bring interface down and up&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo ip link set eth0 down&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo ip link set eth0 up&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;If you need to prove to your server host something that is beyond your control, you can always get out the big guns with MTR.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;MTR (It’s Traceroute on Steroids)&amp;lt;/code&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== What is MTR? ==&lt;br /&gt;
MTR combines the functionality of &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;traceroute&amp;lt;/code&amp;gt; into a single real-time network diagnostic tool. It continuously monitors the path between your system and a destination, providing detailed statistics about latency and packet loss at each hop.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo apt install mtr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
 &amp;lt;code&amp;gt;# Basic MTR (interactive mode)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Report mode (run 10 cycles and exit)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Specify number of pings&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 50 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Use TCP instead of ICMP&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --tcp google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Use UDP&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --udp google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# No DNS resolution (faster, shows IPs only)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --no-dns google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Show both hostnames and IPs&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --show-ips google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Understanding MTR Output ==&lt;br /&gt;
&lt;br /&gt;
=== Sample Output ===&lt;br /&gt;
 &amp;lt;code&amp;gt;HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;3.|-- isp-gateway.net            0.0%    10   15.3  16.1  14.2  19.8   1.8&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;5.|-- google.com                 0.0%    10   25.4  26.8  24.1  32.5   2.4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Column Meanings ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;HOST&#039;&#039;&#039;: Hostname or IP address of each hop in the route&lt;br /&gt;
* &#039;&#039;&#039;Loss%&#039;&#039;&#039;: Percentage of packets lost at this hop&lt;br /&gt;
* &#039;&#039;&#039;Snt&#039;&#039;&#039;: Number of packets sent to this hop&lt;br /&gt;
* &#039;&#039;&#039;Last&#039;&#039;&#039;: Latency of the most recent packet (milliseconds)&lt;br /&gt;
* &#039;&#039;&#039;Avg&#039;&#039;&#039;: Average latency across all packets (milliseconds)&lt;br /&gt;
* &#039;&#039;&#039;Best&#039;&#039;&#039;: Lowest latency recorded (milliseconds)&lt;br /&gt;
* &#039;&#039;&#039;Wrst&#039;&#039;&#039;: Highest latency recorded (milliseconds)&lt;br /&gt;
* &#039;&#039;&#039;StDev&#039;&#039;&#039;: Standard deviation - measures latency consistency (lower is better)&lt;br /&gt;
&lt;br /&gt;
== Interpreting Results ==&lt;br /&gt;
&lt;br /&gt;
=== Healthy Network ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Loss% = 0%&#039;&#039;&#039; on all hops&lt;br /&gt;
* &#039;&#039;&#039;Stable latency&#039;&#039;&#039; (low StDev values)&lt;br /&gt;
* &#039;&#039;&#039;Gradual latency increase&#039;&#039;&#039; as hop count increases&lt;br /&gt;
* &#039;&#039;&#039;Consistent response times&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Problem Indicators ===&lt;br /&gt;
&lt;br /&gt;
==== 1. High Packet Loss at Specific Hop ====&lt;br /&gt;
 &amp;lt;code&amp;gt;5.|-- problem-router.net        25.0%    10   45.3  48.2  42.1  65.8  8.4&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Analysis:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If loss continues to destination: Real problem at this router&lt;br /&gt;
* If loss only at this hop but NOT beyond: Router may be rate-limiting ICMP (false positive, not a real problem)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rule of thumb:&#039;&#039;&#039; If packet loss appears at hop N but hops N+1, N+2, etc. show 0% loss, it&#039;s usually just ICMP rate limiting.&lt;br /&gt;
&lt;br /&gt;
==== 2. High Latency at Specific Hop ====&lt;br /&gt;
 &amp;lt;code&amp;gt;3.|-- slow-link.net              0.0%    10  150.3 155.2 148.1 165.8  5.4&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Indicates:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Network bottleneck or congested link&lt;br /&gt;
* Geographical distance (intercontinental hops)&lt;br /&gt;
* Slow routing equipment&lt;br /&gt;
&lt;br /&gt;
==== 3. No Response (???) ====&lt;br /&gt;
 &amp;lt;code&amp;gt;4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Possible causes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Router configured to not respond to ICMP/traceroute packets&lt;br /&gt;
* Firewall blocking diagnostic packets&lt;br /&gt;
* &#039;&#039;&#039;Not necessarily a problem&#039;&#039;&#039; if later hops respond normally&lt;br /&gt;
&lt;br /&gt;
==== 4. High Jitter (StDev) ====&lt;br /&gt;
 &amp;lt;code&amp;gt;6.|-- unstable.net               0.0%    10   35.3  52.8  28.1  95.2  24.7&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Indicates:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Inconsistent latency (high StDev of 24.7ms)&lt;br /&gt;
* Network congestion or instability&lt;br /&gt;
* Poor for real-time applications (VoIP, gaming, video calls)&lt;br /&gt;
&lt;br /&gt;
==== 5. Sudden Latency Spike ====&lt;br /&gt;
 &amp;lt;code&amp;gt;1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;3.|-- problematic-hop.net        0.0%    10  180.5 185.2 178.1 195.8  6.4&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;4.|-- next-hop.net               0.0%    10  182.3 187.8 180.5 198.2  6.8&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Problem identified:&#039;&#039;&#039; Hop 3 introduces ~170ms of latency (jump from 9ms to 180ms)&lt;br /&gt;
&lt;br /&gt;
== Advanced Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Report Mode with Different Output Formats ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# CSV format for logging and analysis&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report --csv google.com &amp;gt; network-report.csv&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# JSON output for parsing&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report --json google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# XML format&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report --xml google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Wide report (no abbreviations)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-wide google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Protocol Selection ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Use ICMP (default, requires no special permissions)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Use UDP (alternative to ICMP)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --udp google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Use TCP (useful for firewall testing)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --tcp google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Test specific TCP port&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo mtr --tcp --port 443 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo mtr --tcp --port 22 remote-server.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Timing and Duration ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Specify interval between pings (default 1 second)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --interval 0.5 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Extended test with 100 cycles&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 100 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Continuous monitoring (Ctrl+C to stop)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Quick 10-cycle report&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 10 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Advanced Options ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Show Autonomous System (AS) numbers&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --aslookup google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Set maximum number of hops&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --max-ttl 20 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Set packet size&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --psize 1000 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Show both IP and hostname&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --show-ips google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Specify source address (multiple network interfaces)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --address 192.168.1.100 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# IPv4 only&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr -4 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# IPv6 only&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr -6 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interactive Mode Commands ==&lt;br /&gt;
When running MTR in interactive mode (just &amp;lt;code&amp;gt;mtr hostname&amp;lt;/code&amp;gt;), use these keys:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Key&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
|Display help&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;d&#039;&#039;&#039;&lt;br /&gt;
|Toggle display mode (cycle through different views)&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
|Toggle between hostnames and IP addresses&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;r&#039;&#039;&#039;&lt;br /&gt;
|Reset all statistics&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;p&#039;&#039;&#039;&lt;br /&gt;
|Pause/unpause the display&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
|Quit MTR&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;u&#039;&#039;&#039;&lt;br /&gt;
|Switch between ICMP, UDP, and TCP modes&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;y&#039;&#039;&#039;&lt;br /&gt;
|Switch between IPv4 and IPv6&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;o&#039;&#039;&#039;&lt;br /&gt;
|Toggle field display options&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;j&#039;&#039;&#039;&lt;br /&gt;
|Toggle latency display&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Practical Troubleshooting Scenarios ==&lt;br /&gt;
&lt;br /&gt;
=== Scenario 1: Diagnosing Slow Website ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Run extended test to get accurate statistics&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 100 --no-dns example.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Look for:&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# - High average latency at specific hops&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# - Packet loss at destination&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# - High StDev values (jitter)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scenario 2: Testing if Firewall Blocks SSH ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Test SSH port (22) connectivity&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo mtr --tcp --port 22 --report-cycles 50 remote-server.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# If last hop shows 100% loss but earlier hops are fine:&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# - Port 22 might be filtered&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# - Try standard ICMP test for comparison&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scenario 3: ISP Performance Issues ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Test path to reliable external server&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 100 8.8.8.8&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Compare with another DNS server&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 100 1.1.1.1&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# If issues appear in first 3-4 hops: likely ISP problem&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# If issues appear later: problem is beyond your ISP&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scenario 4: VPN Troubleshooting ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Test before connecting to VPN&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 50 --no-dns google.com &amp;gt; before-vpn.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Test after connecting to VPN&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 50 --no-dns google.com &amp;gt; after-vpn.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Compare the two files to see VPN impact&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;diff before-vpn.txt after-vpn.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scenario 5: Gaming/Streaming Performance ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Test for jitter (important for real-time applications)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 200 game-server.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Look for:&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# - Low average latency (&amp;lt; 50ms for gaming)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# - Low StDev (&amp;lt; 5ms preferred)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# - Zero packet loss&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scenario 6: Intermittent Connectivity ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Long-running test to catch intermittent issues&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 500 --interval 1 target.com &amp;gt; long-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Monitor in real-time for several minutes&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr target.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# Watch for sudden spikes in Loss% or latency&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Continuous Monitoring ==&lt;br /&gt;
&lt;br /&gt;
=== Log Network Performance Over Time ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Create timestamped reports every hour&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;while true; do&amp;lt;/code&amp;gt;&lt;br /&gt;
     &amp;lt;code&amp;gt;timestamp=$(date +%Y%m%d-%H%M%S)&amp;lt;/code&amp;gt;&lt;br /&gt;
     &amp;lt;code&amp;gt;mtr --report --report-cycles 50 google.com &amp;gt; &amp;quot;mtr-$timestamp.txt&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
     &amp;lt;code&amp;gt;sleep 3600&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;done&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Monitor Multiple Destinations ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Create a simple monitoring script&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;echo &amp;quot;=== MTR Report $(date) ===&amp;quot; &amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;echo &amp;quot;Google DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report --report-cycles 50 --no-dns 8.8.8.8 &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;echo &amp;quot;Cloudflare DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report --report-cycles 50 --no-dns 1.1.1.1 &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;echo &amp;quot;Your Server:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report --report-cycles 50 your-server.com &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Useful Aliases for .bashrc ==&lt;br /&gt;
 &amp;lt;code&amp;gt;# Quick network path analysis&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias mtrreport=&#039;mtr --report --report-cycles 50 --no-dns&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Monitor connection to Google DNS&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias netcheck=&#039;mtr --report-cycles 20 8.8.8.8&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Extended network test&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias mtrlong=&#039;mtr --report-cycles 100&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# TCP port 443 test (HTTPS)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias mtrhttps=&#039;sudo mtr --tcp --port 443 --report-cycles 30&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Quick comparison of major DNS providers&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias dnstest=&#039;echo &amp;quot;Google:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 8.8.8.8 &amp;amp;&amp;amp; echo -e &amp;quot;\nCloudflare:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 1.1.1.1&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
After adding to &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;:&lt;br /&gt;
 &amp;lt;code&amp;gt;source ~/.bashrc&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting Tips ==&lt;br /&gt;
&lt;br /&gt;
=== 1. Permission Issues ===&lt;br /&gt;
If you get permission errors with TCP mode:&lt;br /&gt;
 &amp;lt;code&amp;gt;# Use sudo for TCP on privileged ports&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo mtr --tcp --port 443 example.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Or set capabilities (one-time setup)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo setcap cap_net_raw+ep /usr/bin/mtr-packet&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 2. False Positives ===&lt;br /&gt;
&#039;&#039;&#039;Common false positive:&#039;&#039;&#039; Packet loss at intermediate hops but NOT at the destination.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;3.|-- router.isp.net            20.0%    50   15.3  16.1  14.2  19.8   1.8&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;4.|-- next-hop.net               0.0%    50   18.5  19.2  17.8  22.1   1.3&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;5.|-- destination.com            0.0%    50   25.4  26.8  24.1  32.5   2.4&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;This is OK!&#039;&#039;&#039; Hop 3 shows 20% loss, but hops 4 and 5 show 0% loss. The router at hop 3 is rate-limiting ICMP responses, but actual traffic flows normally.&lt;br /&gt;
&lt;br /&gt;
=== 3. DNS Resolution Delays ===&lt;br /&gt;
If MTR seems slow to start:&lt;br /&gt;
 &amp;lt;code&amp;gt;# Skip DNS resolution for faster results&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --no-dns target.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Resolve names afterward if needed&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;host 203.0.113.1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 4. Comparing Results ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Run multiple tests and compare&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report --report-cycles 50 example.com &amp;gt; test1.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sleep 60&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report --report-cycles 50 example.com &amp;gt; test2.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;diff test1.txt test2.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== When to Use MTR vs Other Tools ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Tool&lt;br /&gt;
!Best For&lt;br /&gt;
!Limitations&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;MTR&#039;&#039;&#039;&lt;br /&gt;
|Continuous monitoring, identifying problem hops, detailed statistics&lt;br /&gt;
|Requires installation&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;ping&#039;&#039;&#039;&lt;br /&gt;
|Quick connectivity test, simple latency check&lt;br /&gt;
|Only tests endpoint&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;traceroute&#039;&#039;&#039;&lt;br /&gt;
|One-time path discovery&lt;br /&gt;
|No continuous monitoring&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;ss/netstat&#039;&#039;&#039;&lt;br /&gt;
|Local connection status&lt;br /&gt;
|Doesn&#039;t test remote paths&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Best Practices ==&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Run enough cycles&#039;&#039;&#039;: Use at least 50-100 cycles for accurate statistics&lt;br /&gt;
# &#039;&#039;&#039;Use --no-dns&#039;&#039;&#039;: Faster and avoids DNS resolution issues during testing&lt;br /&gt;
# &#039;&#039;&#039;Check multiple times&#039;&#039;&#039;: Network conditions vary; test at different times&lt;br /&gt;
# &#039;&#039;&#039;Compare protocols&#039;&#039;&#039;: Try ICMP, UDP, and TCP if one shows issues&lt;br /&gt;
# &#039;&#039;&#039;Document findings&#039;&#039;&#039;: Save reports with timestamps for trend analysis&lt;br /&gt;
# &#039;&#039;&#039;Test known-good hosts&#039;&#039;&#039;: Use 8.8.8.8 or 1.1.1.1 to verify your network first&lt;br /&gt;
# &#039;&#039;&#039;Be patient&#039;&#039;&#039;: Let MTR run for at least 30-60 seconds before drawing conclusions&lt;br /&gt;
&lt;br /&gt;
== Reading Between the Lines ==&lt;br /&gt;
&lt;br /&gt;
=== Good Network Health Example ===&lt;br /&gt;
 &amp;lt;code&amp;gt;HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;1.|-- 192.168.1.1                0.0%    50    1.1   1.2   0.9   2.1   0.2&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;2.|-- 10.0.0.1                   0.0%    50    8.2   8.5   7.5  10.2   0.5&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;3.|-- isp-gateway.net            0.0%    50   15.1  15.5  14.0  18.3   0.8&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;4.|-- google.com                 0.0%    50   24.8  25.2  23.5  28.1   1.1&amp;lt;/code&amp;gt;&lt;br /&gt;
✅ No packet loss, consistent latency, low jitter&lt;br /&gt;
&lt;br /&gt;
=== Problem Network Example ===&lt;br /&gt;
 &amp;lt;code&amp;gt;HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;1.|-- 192.168.1.1                0.0%    50    1.2   1.5   1.0   2.3   0.3&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;2.|-- 10.0.0.1                   5.0%    50   45.3  52.8  8.1  245.2  45.7&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;3.|-- ???                       100.0%   50    0.0   0.0   0.0   0.0   0.0&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;4.|-- destination.com           15.0%    50   95.4 125.8  48.2 385.5  78.2&amp;lt;/code&amp;gt;&lt;br /&gt;
❌ Packet loss at hop 2 and destination, high jitter, very high worst-case latency&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
MTR is your Swiss Army knife for network diagnostics. Key takeaways:&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;code&amp;gt;--report-cycles 50+&amp;lt;/code&amp;gt; for reliable data&lt;br /&gt;
* Watch for packet loss at the &#039;&#039;&#039;destination&#039;&#039;&#039; (intermediate losses may be false positives)&lt;br /&gt;
* High &#039;&#039;&#039;StDev&#039;&#039;&#039; indicates unstable connection&lt;br /&gt;
* High &#039;&#039;&#039;Avg&#039;&#039;&#039; latency shows slow links&lt;br /&gt;
* Use &amp;lt;code&amp;gt;--no-dns&amp;lt;/code&amp;gt; for faster results&lt;br /&gt;
* Compare &#039;&#039;&#039;ICMP&#039;&#039;&#039;, &#039;&#039;&#039;UDP&#039;&#039;&#039;, and &#039;&#039;&#039;TCP&#039;&#039;&#039; modes if issues appear&lt;br /&gt;
* Test at different times of day for comprehensive analysis&lt;br /&gt;
&lt;br /&gt;
== 4. Package Management Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Fix Broken Packages ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Update package lists&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Fix broken dependencies&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo apt --fix-broken install&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Reconfigure packages&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo dpkg --configure -a&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;(if no output, there is nothing to do)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Clean package cache&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo apt clean&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo apt autoclean&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Remove unused packages&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo apt autoremove&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# If apt is locked, find the process&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo lsof /var/lib/dpkg/lock-frontend&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Force remove lock (use carefully)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo rm /var/lib/dpkg/lock-frontend&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo rm /var/lib/apt/lists/lock&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Reconfigure dpkg&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo dpkg --configure -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 5. Disk &amp;amp; Filesystem Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Check disk space&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;df -h&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check inode usage&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;df -i&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# View disk I/O statistics&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;iostat -x 1&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;(Make sure you have sysstat which includes useful performance monitoring tools other than iostat - disk I/O statistics&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;mpstat&amp;lt;/code&amp;gt; - CPU statistics&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;sar&amp;lt;/code&amp;gt; - system activity reporter&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;pidstat&amp;lt;/code&amp;gt; - process statistics&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;cifsiostat&amp;lt;/code&amp;gt; - CIFS statistics&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&#039;&#039;# Show stats in MB instead of KB&#039;&#039; iostat -xm 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&#039;&#039;# Monitor specific device&#039;&#039; iostat -x sda 1&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# Check for disk errors in dmesg&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# SMART disk health (if smartmontools installed)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo smartctl -a /dev/sda&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Repair Filesystem ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Unmount the partition first&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo umount /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Run filesystem check&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo fsck /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# For ext4 specifically&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo e2fsck -f /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 6. Performance Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Identify Resource Hogs ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# CPU usage by process&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;top -o %CPU&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Memory usage by process&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;top -o %MEM&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Disk usage by directory&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;du -sh /* | sort -h&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Find large files&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;find / -type f -size +100M 2&amp;gt;/dev/null&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check running processes&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ps aux --sort=-%mem | head -20&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== System Temperature Monitoring ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Install sensors (if not installed)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo apt install lm-sensors&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo sensors-detect&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# View temperatures&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sensors&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Real-time temperature monitoring&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;watch -n 2 sensors&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;&#039;&#039;I have it as an alias in ~/.bashrc&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;&#039;&#039;Go to 11. Useful Aliases &amp;amp; Shortcuts&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 7. Service &amp;amp; Application Errors ==&lt;br /&gt;
&lt;br /&gt;
=== Debug Service Problems ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Check service status&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo systemctl status service-name&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# View service logs&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo journalctl -u service-name&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Restart a service&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo systemctl restart service-name&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Enable service at boot&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo systemctl enable service-name&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# View recent service failures&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;journalctl -p err -b&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Application Crash Investigation ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Check for core dumps&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ls -lh /var/crash/&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# View application-specific logs&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ls /var/log/&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check syslog for application errors&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo tail -f /var/log/syslog&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 8. Permission &amp;amp; Access Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Fix Common Permission Problems ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Check file ownership&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ls -l /path/to/file&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Change ownership&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo chown michael:michael /path/to/file&amp;lt;/code&amp;gt;&lt;br /&gt;
 user:group&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Change permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo chmod 644 /path/to/file&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Recursively fix permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo chown -R user:group /path/to/directory&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== User &amp;amp; Authentication Issues ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Check user information&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;id username&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# View user login history&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;last -a&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check failed login attempts&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo journalctl | grep &amp;quot;authentication failure&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Reset user password&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo passwd username&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 9. Hardware Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Identify Hardware ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# List all hardware&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo lshw -short&amp;lt;/code&amp;gt;&lt;br /&gt;
 (May not be installed by default)&lt;br /&gt;
 sudo apt install lshw&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# PCI devices&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;lspci -v&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# USB devices&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;lsusb -v&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# CPU information&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;lscpu&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Memory information&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo dmidecode --type memory&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Check Hardware Errors ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Kernel ring buffer (hardware messages)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;dmesg | less&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;(If no output, good, no errors)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;q to quit&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Search for specific hardware issues&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;dmesg | grep -i &amp;quot;error\|fail\|warn&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check for USB issues&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;dmesg | grep -i usb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 10. Quick Diagnostic Commands ==&lt;br /&gt;
&lt;br /&gt;
=== System Information at a Glance ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Uptime and load average&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;uptime&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Kernel version&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;uname -r&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Debian version&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;cat /etc/debian_version&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# System summary&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo inxi -Fxz&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emergency Toolkit ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Create a diagnostic report&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo journalctl -b &amp;gt; ~/system-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;dmesg &amp;gt;&amp;gt; ~/system-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;systemctl --failed &amp;gt;&amp;gt; ~/system-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;df -h &amp;gt;&amp;gt; ~/system-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;free -h &amp;gt;&amp;gt; ~/system-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Watch logs in real-time&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo journalctl -f&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Monitor system resources continuously&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;watch -n 1 &#039;free -h &amp;amp;&amp;amp; df -h&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 11. Useful Aliases &amp;amp; Shortcuts ==&lt;br /&gt;
Add these to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; for quick access to common troubleshooting commands:&lt;br /&gt;
 &amp;lt;code&amp;gt;# Monitor system temperatures in real-time&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias temps=&amp;quot;watch -n 2 &#039;for i in /sys/class/hwmon/hwmon*/; do echo -n \&amp;quot;\$(cat \${i}name): \&amp;quot;; cat \${i}temp*_input 2&amp;gt;/dev/null | while read temp; do echo \&amp;quot;scale=1; \$temp/1000\&amp;quot; | bc; done | tr \&amp;quot;\n\&amp;quot; \&amp;quot; \&amp;quot;; echo \&amp;quot;°C\&amp;quot;; done&#039;&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;&#039;&#039;or run the watch command in the shell without the opening and closing double quotes.&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Quick system status&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias sysstat=&#039;echo &amp;quot;=== CPU ===&amp;quot; &amp;amp;&amp;amp; uptime &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Memory ===&amp;quot; &amp;amp;&amp;amp; free -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Disk ===&amp;quot; &amp;amp;&amp;amp; df -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Top Processes ===&amp;quot; &amp;amp;&amp;amp; ps aux --sort=-%mem | head -10&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;(It’s a messy mayout, but I’m terrible with awk. Feel free to improve the layoput for me)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# View last boot logs&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias lastboot=&#039;journalctl -b -1&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check failed services&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias failedservices=&#039;systemctl --failed&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Monitor logs in real-time&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias watchlog=&#039;sudo journalctl -f&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Quick network status&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias netstat=&#039;ip addr show &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Routes ===&amp;quot; &amp;amp;&amp;amp; ip route show&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
After adding these, run:&lt;br /&gt;
 &amp;lt;code&amp;gt;source ~/.bashrc&amp;lt;/code&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tips for Your Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;First check logs&#039;&#039;&#039;: &amp;lt;code&amp;gt;journalctl&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;dmesg&amp;lt;/code&amp;gt; are your best friends&lt;br /&gt;
# &#039;&#039;&#039;Work through the sections&#039;&#039;&#039;: Change one thing at a time&lt;br /&gt;
# &#039;&#039;&#039;Document changes&#039;&#039;&#039;: Keep notes on what you&#039;ve tried&lt;br /&gt;
# &#039;&#039;&#039;Search for error messages&#039;&#039;&#039;: Copy exact error messages into search engines or AI&lt;br /&gt;
# &#039;&#039;&#039;Check recent changes&#039;&#039;&#039;: What you did before it happened? Install something, update packages, kernel?&lt;br /&gt;
# &#039;&#039;&#039;Make backups&#039;&#039;&#039;: Before major changes, backup important data&lt;br /&gt;
# &#039;&#039;&#039;Use verbose mode&#039;&#039;&#039;: Add &amp;lt;code&amp;gt;-v&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-vv&amp;lt;/code&amp;gt; flags to commands for more detail&lt;br /&gt;
# &#039;&#039;&#039;Check forums&#039;&#039;&#039;: Debian forum, Reddit, Stack Exchange, and mailing lists&lt;br /&gt;
&lt;br /&gt;
----&#039;&#039;&#039;Remember&#039;&#039;&#039;: If in doubt, search for the specific error message along with &amp;quot;Debian&amp;quot; and the version number. e.g. Debian 13 or point release if needed, Debian 13.1&lt;br /&gt;
&lt;br /&gt;
This work was contributed by distro-nix on Debian User Forums on 2025-10-27 23:38:22&lt;br /&gt;
&lt;br /&gt;
I welcome comments, suggestions or resources : dev@divsmart.com .&lt;br /&gt;
&lt;br /&gt;
[[index.php?title=Category:Troubleshooting]]&lt;br /&gt;
[[index.php?title=Category:Guides]]&lt;br /&gt;
[[index.php?title=Category:Administration]]&lt;br /&gt;
[[index.php?title=Category:Guides]]&lt;br /&gt;
[[index.php?title=Category:Full Paper]]&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
	<entry>
		<id>https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=200</id>
		<title>Debian First Aid Kit</title>
		<link rel="alternate" type="text/html" href="https://cache.forums.debian.net/index.php?title=Debian_First_Aid_Kit&amp;diff=200"/>
		<updated>2026-03-10T11:27:00Z</updated>

		<summary type="html">&lt;p&gt;Distro-nix: /* Debian First Aid Kit */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Debian First Aid Kit =&lt;br /&gt;
&#039;&#039;&#039;All commands are verified on Debian 13.1 (Trixie) / 6.16.3+deb13-amd64 x64_64&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Created : 2025-10-27 15:54:21&lt;br /&gt;
&lt;br /&gt;
Last Updated : 2026-03-10 07:10:53 &#039;&#039;&#039;ID : 544000.4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Table of Contents ==&lt;br /&gt;
&lt;br /&gt;
# Issues&lt;br /&gt;
# Package Management Issues&lt;br /&gt;
# Disk &amp;amp; Filesystem Issues&lt;br /&gt;
# Performance Issues&lt;br /&gt;
# Service &amp;amp; Application Errors&lt;br /&gt;
# Permission &amp;amp; Access Issues&lt;br /&gt;
# Hardware IssuesSystem Freezes &amp;amp; Crashes&lt;br /&gt;
# Boot Problems&lt;br /&gt;
# Network&lt;br /&gt;
# Quick Diagnostic Commands&lt;br /&gt;
# Useful Aliases &amp;amp; Shortcuts&lt;br /&gt;
# Tips for Effective Troubleshooting&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== 1. System Freezes &amp;amp; Crashes ==&lt;br /&gt;
&lt;br /&gt;
=== Check System Logs ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# View logs from previous boot (after freeze/crash)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;journalctl -b -1&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# List all available boots&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;journalctl --list-boots&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Show only kernel messages from previous boot&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;journalctl -b -1 -k&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Show errors and critical messages only&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;journalctl -b -1 -p err&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Save logs to file for analysis&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;journalctl -b -1 &amp;gt; ~/crash-log.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Common Freeze Causes to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Kernel panics&#039;&#039;&#039;: Search for &amp;quot;kernel panic&amp;quot; or &amp;quot;Oops&amp;quot;&lt;br /&gt;
* &#039;&#039;&#039;Out of Memory (OOM)&#039;&#039;&#039;: Search for &amp;quot;Out of memory&amp;quot; or &amp;quot;oom-killer&amp;quot;&lt;br /&gt;
* &#039;&#039;&#039;Hardware errors&#039;&#039;&#039;: Look for &amp;quot;MCE&amp;quot; (Machine Check Exception) or &amp;quot;hardware error&amp;quot;&lt;br /&gt;
* &#039;&#039;&#039;Driver issues&#039;&#039;&#039;: Check for module/driver failures&lt;br /&gt;
* &#039;&#039;&#039;Overheating&#039;&#039;&#039;: Check system temperatures&lt;br /&gt;
&lt;br /&gt;
=== Check System Resources ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# View memory usage&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;free -h&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check disk space&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;df -h&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Monitor system resources in real-time&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;htop&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# or&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;top&amp;lt;/code&amp;gt;&lt;br /&gt;
 (I prefer btop for better presentation)&lt;br /&gt;
 You would need to install it. sudo apt install btop&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check for disk errors&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo dmesg | grep -i error&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;These are permanent errors due to incomplete/buggy ACPI tables in the BIOS, but they are harmless :&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;0.686554] ACPI Error: No handler for Region [ECRM] (00000000201accc4) [EmbeddedControl] (20250404/evregion-131)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;0.686577] ACPI Error: Region EmbeddedControl (ID=3) has no handler (20250404/exfldio-261)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;0.686594] ACPI Error: Aborting method \_SB.GPIO._EVT due to previous error (AE_NOT_EXIST) (20250404/psparse-529)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 2. Boot Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Check Boot Process ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# View systemd boot analysis&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;systemd-analyze blame&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# See what failed during boot&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;systemctl --failed&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check specific service status&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;systemctl status &amp;lt;service-name&amp;gt; e.g NetworkManager.service&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Access Recovery Mode ===&lt;br /&gt;
&lt;br /&gt;
# Reboot and hold &amp;lt;code&amp;gt;Shift&amp;lt;/code&amp;gt; to access GRUB menu (depending on your grub timing settings)&lt;br /&gt;
# Select &amp;quot;Advanced options&amp;quot;&lt;br /&gt;
# Choose recovery mode&lt;br /&gt;
# Select &amp;quot;root&amp;quot; for root shell access&lt;br /&gt;
&lt;br /&gt;
=== Common Boot Fixes ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Repair filesystem errors&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;Once you identify a device with lsblk&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo fsck /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Reinstall GRUB bootloader&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo grub-install /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo update-grub&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check fstab for mount errors&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;cat /etc/fstab&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 3. Network Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose Network Connection ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Check network interfaces&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ip addr show&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Test connectivity&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ping -c 4 8.8.8.8&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ping -c 6 2a00:1450:4007:809::200e&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check DNS resolution&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;nslookup google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# View routing table&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ip route show&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check active connections&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ss -tuln&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Restart Network Service ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# For systems with NetworkManager&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo systemctl restart NetworkManager&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# For systems with networking service&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo systemctl restart networking&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Bring interface down and up&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo ip link set eth0 down&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo ip link set eth0 up&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;If you need to prove to your server host something that is beyond your control, you can always get out the big guns with MTR.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;MTR (It’s Traceroute on Steroids)&amp;lt;/code&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== What is MTR? ==&lt;br /&gt;
MTR combines the functionality of &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;traceroute&amp;lt;/code&amp;gt; into a single real-time network diagnostic tool. It continuously monitors the path between your system and a destination, providing detailed statistics about latency and packet loss at each hop.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo apt install mtr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
 &amp;lt;code&amp;gt;# Basic MTR (interactive mode)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Report mode (run 10 cycles and exit)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Specify number of pings&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 50 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Use TCP instead of ICMP&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --tcp google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Use UDP&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --udp google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# No DNS resolution (faster, shows IPs only)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --no-dns google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Show both hostnames and IPs&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --show-ips google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Understanding MTR Output ==&lt;br /&gt;
&lt;br /&gt;
=== Sample Output ===&lt;br /&gt;
 &amp;lt;code&amp;gt;HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;3.|-- isp-gateway.net            0.0%    10   15.3  16.1  14.2  19.8   1.8&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;5.|-- google.com                 0.0%    10   25.4  26.8  24.1  32.5   2.4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Column Meanings ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;HOST&#039;&#039;&#039;: Hostname or IP address of each hop in the route&lt;br /&gt;
* &#039;&#039;&#039;Loss%&#039;&#039;&#039;: Percentage of packets lost at this hop&lt;br /&gt;
* &#039;&#039;&#039;Snt&#039;&#039;&#039;: Number of packets sent to this hop&lt;br /&gt;
* &#039;&#039;&#039;Last&#039;&#039;&#039;: Latency of the most recent packet (milliseconds)&lt;br /&gt;
* &#039;&#039;&#039;Avg&#039;&#039;&#039;: Average latency across all packets (milliseconds)&lt;br /&gt;
* &#039;&#039;&#039;Best&#039;&#039;&#039;: Lowest latency recorded (milliseconds)&lt;br /&gt;
* &#039;&#039;&#039;Wrst&#039;&#039;&#039;: Highest latency recorded (milliseconds)&lt;br /&gt;
* &#039;&#039;&#039;StDev&#039;&#039;&#039;: Standard deviation - measures latency consistency (lower is better)&lt;br /&gt;
&lt;br /&gt;
== Interpreting Results ==&lt;br /&gt;
&lt;br /&gt;
=== Healthy Network ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Loss% = 0%&#039;&#039;&#039; on all hops&lt;br /&gt;
* &#039;&#039;&#039;Stable latency&#039;&#039;&#039; (low StDev values)&lt;br /&gt;
* &#039;&#039;&#039;Gradual latency increase&#039;&#039;&#039; as hop count increases&lt;br /&gt;
* &#039;&#039;&#039;Consistent response times&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Problem Indicators ===&lt;br /&gt;
&lt;br /&gt;
==== 1. High Packet Loss at Specific Hop ====&lt;br /&gt;
 &amp;lt;code&amp;gt;5.|-- problem-router.net        25.0%    10   45.3  48.2  42.1  65.8  8.4&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Analysis:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If loss continues to destination: Real problem at this router&lt;br /&gt;
* If loss only at this hop but NOT beyond: Router may be rate-limiting ICMP (false positive, not a real problem)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rule of thumb:&#039;&#039;&#039; If packet loss appears at hop N but hops N+1, N+2, etc. show 0% loss, it&#039;s usually just ICMP rate limiting.&lt;br /&gt;
&lt;br /&gt;
==== 2. High Latency at Specific Hop ====&lt;br /&gt;
 &amp;lt;code&amp;gt;3.|-- slow-link.net              0.0%    10  150.3 155.2 148.1 165.8  5.4&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Indicates:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Network bottleneck or congested link&lt;br /&gt;
* Geographical distance (intercontinental hops)&lt;br /&gt;
* Slow routing equipment&lt;br /&gt;
&lt;br /&gt;
==== 3. No Response (???) ====&lt;br /&gt;
 &amp;lt;code&amp;gt;4.|-- ???                       100.0%   10    0.0   0.0   0.0   0.0   0.0&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Possible causes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Router configured to not respond to ICMP/traceroute packets&lt;br /&gt;
* Firewall blocking diagnostic packets&lt;br /&gt;
* &#039;&#039;&#039;Not necessarily a problem&#039;&#039;&#039; if later hops respond normally&lt;br /&gt;
&lt;br /&gt;
==== 4. High Jitter (StDev) ====&lt;br /&gt;
 &amp;lt;code&amp;gt;6.|-- unstable.net               0.0%    10   35.3  52.8  28.1  95.2  24.7&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Indicates:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Inconsistent latency (high StDev of 24.7ms)&lt;br /&gt;
* Network congestion or instability&lt;br /&gt;
* Poor for real-time applications (VoIP, gaming, video calls)&lt;br /&gt;
&lt;br /&gt;
==== 5. Sudden Latency Spike ====&lt;br /&gt;
 &amp;lt;code&amp;gt;1.|-- 192.168.1.1                0.0%    10    1.2   1.5   1.0   2.3   0.4&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;2.|-- 10.0.0.1                   0.0%    10    8.5   9.2   7.8  12.1   1.3&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;3.|-- problematic-hop.net        0.0%    10  180.5 185.2 178.1 195.8  6.4&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;4.|-- next-hop.net               0.0%    10  182.3 187.8 180.5 198.2  6.8&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Problem identified:&#039;&#039;&#039; Hop 3 introduces ~170ms of latency (jump from 9ms to 180ms)&lt;br /&gt;
&lt;br /&gt;
== Advanced Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Report Mode with Different Output Formats ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# CSV format for logging and analysis&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report --csv google.com &amp;gt; network-report.csv&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# JSON output for parsing&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report --json google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# XML format&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report --xml google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Wide report (no abbreviations)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-wide google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Protocol Selection ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Use ICMP (default, requires no special permissions)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Use UDP (alternative to ICMP)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --udp google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Use TCP (useful for firewall testing)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --tcp google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Test specific TCP port&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo mtr --tcp --port 443 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo mtr --tcp --port 22 remote-server.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Timing and Duration ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Specify interval between pings (default 1 second)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --interval 0.5 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Extended test with 100 cycles&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 100 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Continuous monitoring (Ctrl+C to stop)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Quick 10-cycle report&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 10 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Advanced Options ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Show Autonomous System (AS) numbers&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --aslookup google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Set maximum number of hops&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --max-ttl 20 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Set packet size&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --psize 1000 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Show both IP and hostname&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --show-ips google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Specify source address (multiple network interfaces)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --address 192.168.1.100 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# IPv4 only&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr -4 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# IPv6 only&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr -6 google.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interactive Mode Commands ==&lt;br /&gt;
When running MTR in interactive mode (just &amp;lt;code&amp;gt;mtr hostname&amp;lt;/code&amp;gt;), use these keys:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Key&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;h&#039;&#039;&#039;&lt;br /&gt;
|Display help&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;d&#039;&#039;&#039;&lt;br /&gt;
|Toggle display mode (cycle through different views)&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;n&#039;&#039;&#039;&lt;br /&gt;
|Toggle between hostnames and IP addresses&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;r&#039;&#039;&#039;&lt;br /&gt;
|Reset all statistics&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;p&#039;&#039;&#039;&lt;br /&gt;
|Pause/unpause the display&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;q&#039;&#039;&#039;&lt;br /&gt;
|Quit MTR&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;u&#039;&#039;&#039;&lt;br /&gt;
|Switch between ICMP, UDP, and TCP modes&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;y&#039;&#039;&#039;&lt;br /&gt;
|Switch between IPv4 and IPv6&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;o&#039;&#039;&#039;&lt;br /&gt;
|Toggle field display options&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;j&#039;&#039;&#039;&lt;br /&gt;
|Toggle latency display&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Practical Troubleshooting Scenarios ==&lt;br /&gt;
&lt;br /&gt;
=== Scenario 1: Diagnosing Slow Website ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Run extended test to get accurate statistics&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 100 --no-dns example.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Look for:&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# - High average latency at specific hops&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# - Packet loss at destination&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# - High StDev values (jitter)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scenario 2: Testing if Firewall Blocks SSH ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Test SSH port (22) connectivity&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo mtr --tcp --port 22 --report-cycles 50 remote-server.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# If last hop shows 100% loss but earlier hops are fine:&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# - Port 22 might be filtered&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# - Try standard ICMP test for comparison&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scenario 3: ISP Performance Issues ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Test path to reliable external server&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 100 8.8.8.8&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Compare with another DNS server&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 100 1.1.1.1&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# If issues appear in first 3-4 hops: likely ISP problem&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# If issues appear later: problem is beyond your ISP&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scenario 4: VPN Troubleshooting ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Test before connecting to VPN&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 50 --no-dns google.com &amp;gt; before-vpn.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Test after connecting to VPN&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 50 --no-dns google.com &amp;gt; after-vpn.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Compare the two files to see VPN impact&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;diff before-vpn.txt after-vpn.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scenario 5: Gaming/Streaming Performance ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Test for jitter (important for real-time applications)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 200 game-server.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Look for:&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# - Low average latency (&amp;lt; 50ms for gaming)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# - Low StDev (&amp;lt; 5ms preferred)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# - Zero packet loss&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scenario 6: Intermittent Connectivity ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Long-running test to catch intermittent issues&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report-cycles 500 --interval 1 target.com &amp;gt; long-test.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Monitor in real-time for several minutes&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr target.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# Watch for sudden spikes in Loss% or latency&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Continuous Monitoring ==&lt;br /&gt;
&lt;br /&gt;
=== Log Network Performance Over Time ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Create timestamped reports every hour&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;while true; do&amp;lt;/code&amp;gt;&lt;br /&gt;
     &amp;lt;code&amp;gt;timestamp=$(date +%Y%m%d-%H%M%S)&amp;lt;/code&amp;gt;&lt;br /&gt;
     &amp;lt;code&amp;gt;mtr --report --report-cycles 50 google.com &amp;gt; &amp;quot;mtr-$timestamp.txt&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
     &amp;lt;code&amp;gt;sleep 3600&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;done&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Monitor Multiple Destinations ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Create a simple monitoring script&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;#!/bin/bash&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;echo &amp;quot;=== MTR Report $(date) ===&amp;quot; &amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;echo &amp;quot;Google DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report --report-cycles 50 --no-dns 8.8.8.8 &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;echo &amp;quot;Cloudflare DNS:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report --report-cycles 50 --no-dns 1.1.1.1 &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;echo &amp;quot;Your Server:&amp;quot; &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report --report-cycles 50 your-server.com &amp;gt;&amp;gt; daily-network-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Useful Aliases for .bashrc ==&lt;br /&gt;
 &amp;lt;code&amp;gt;# Quick network path analysis&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias mtrreport=&#039;mtr --report --report-cycles 50 --no-dns&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Monitor connection to Google DNS&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias netcheck=&#039;mtr --report-cycles 20 8.8.8.8&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Extended network test&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias mtrlong=&#039;mtr --report-cycles 100&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# TCP port 443 test (HTTPS)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias mtrhttps=&#039;sudo mtr --tcp --port 443 --report-cycles 30&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Quick comparison of major DNS providers&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias dnstest=&#039;echo &amp;quot;Google:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 8.8.8.8 &amp;amp;&amp;amp; echo -e &amp;quot;\nCloudflare:&amp;quot; &amp;amp;&amp;amp; mtr --report-cycles 20 1.1.1.1&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
After adding to &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt;:&lt;br /&gt;
 &amp;lt;code&amp;gt;source ~/.bashrc&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting Tips ==&lt;br /&gt;
&lt;br /&gt;
=== 1. Permission Issues ===&lt;br /&gt;
If you get permission errors with TCP mode:&lt;br /&gt;
 &amp;lt;code&amp;gt;# Use sudo for TCP on privileged ports&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo mtr --tcp --port 443 example.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Or set capabilities (one-time setup)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo setcap cap_net_raw+ep /usr/bin/mtr-packet&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 2. False Positives ===&lt;br /&gt;
&#039;&#039;&#039;Common false positive:&#039;&#039;&#039; Packet loss at intermediate hops but NOT at the destination.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;code&amp;gt;3.|-- router.isp.net            20.0%    50   15.3  16.1  14.2  19.8   1.8&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;4.|-- next-hop.net               0.0%    50   18.5  19.2  17.8  22.1   1.3&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;5.|-- destination.com            0.0%    50   25.4  26.8  24.1  32.5   2.4&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;This is OK!&#039;&#039;&#039; Hop 3 shows 20% loss, but hops 4 and 5 show 0% loss. The router at hop 3 is rate-limiting ICMP responses, but actual traffic flows normally.&lt;br /&gt;
&lt;br /&gt;
=== 3. DNS Resolution Delays ===&lt;br /&gt;
If MTR seems slow to start:&lt;br /&gt;
 &amp;lt;code&amp;gt;# Skip DNS resolution for faster results&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --no-dns target.com&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Resolve names afterward if needed&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;host 203.0.113.1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 4. Comparing Results ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Run multiple tests and compare&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report --report-cycles 50 example.com &amp;gt; test1.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sleep 60&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;mtr --report --report-cycles 50 example.com &amp;gt; test2.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;diff test1.txt test2.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== When to Use MTR vs Other Tools ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Tool&lt;br /&gt;
!Best For&lt;br /&gt;
!Limitations&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;MTR&#039;&#039;&#039;&lt;br /&gt;
|Continuous monitoring, identifying problem hops, detailed statistics&lt;br /&gt;
|Requires installation&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;ping&#039;&#039;&#039;&lt;br /&gt;
|Quick connectivity test, simple latency check&lt;br /&gt;
|Only tests endpoint&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;traceroute&#039;&#039;&#039;&lt;br /&gt;
|One-time path discovery&lt;br /&gt;
|No continuous monitoring&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;ss/netstat&#039;&#039;&#039;&lt;br /&gt;
|Local connection status&lt;br /&gt;
|Doesn&#039;t test remote paths&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Best Practices ==&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Run enough cycles&#039;&#039;&#039;: Use at least 50-100 cycles for accurate statistics&lt;br /&gt;
# &#039;&#039;&#039;Use --no-dns&#039;&#039;&#039;: Faster and avoids DNS resolution issues during testing&lt;br /&gt;
# &#039;&#039;&#039;Check multiple times&#039;&#039;&#039;: Network conditions vary; test at different times&lt;br /&gt;
# &#039;&#039;&#039;Compare protocols&#039;&#039;&#039;: Try ICMP, UDP, and TCP if one shows issues&lt;br /&gt;
# &#039;&#039;&#039;Document findings&#039;&#039;&#039;: Save reports with timestamps for trend analysis&lt;br /&gt;
# &#039;&#039;&#039;Test known-good hosts&#039;&#039;&#039;: Use 8.8.8.8 or 1.1.1.1 to verify your network first&lt;br /&gt;
# &#039;&#039;&#039;Be patient&#039;&#039;&#039;: Let MTR run for at least 30-60 seconds before drawing conclusions&lt;br /&gt;
&lt;br /&gt;
== Reading Between the Lines ==&lt;br /&gt;
&lt;br /&gt;
=== Good Network Health Example ===&lt;br /&gt;
 &amp;lt;code&amp;gt;HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;1.|-- 192.168.1.1                0.0%    50    1.1   1.2   0.9   2.1   0.2&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;2.|-- 10.0.0.1                   0.0%    50    8.2   8.5   7.5  10.2   0.5&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;3.|-- isp-gateway.net            0.0%    50   15.1  15.5  14.0  18.3   0.8&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;4.|-- google.com                 0.0%    50   24.8  25.2  23.5  28.1   1.1&amp;lt;/code&amp;gt;&lt;br /&gt;
✅ No packet loss, consistent latency, low jitter&lt;br /&gt;
&lt;br /&gt;
=== Problem Network Example ===&lt;br /&gt;
 &amp;lt;code&amp;gt;HOST: hostname                    Loss%   Snt   Last   Avg  Best  Wrst StDev&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;1.|-- 192.168.1.1                0.0%    50    1.2   1.5   1.0   2.3   0.3&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;2.|-- 10.0.0.1                   5.0%    50   45.3  52.8  8.1  245.2  45.7&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;3.|-- ???                       100.0%   50    0.0   0.0   0.0   0.0   0.0&amp;lt;/code&amp;gt;&lt;br /&gt;
   &amp;lt;code&amp;gt;4.|-- destination.com           15.0%    50   95.4 125.8  48.2 385.5  78.2&amp;lt;/code&amp;gt;&lt;br /&gt;
❌ Packet loss at hop 2 and destination, high jitter, very high worst-case latency&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
MTR is your Swiss Army knife for network diagnostics. Key takeaways:&lt;br /&gt;
&lt;br /&gt;
* Use &amp;lt;code&amp;gt;--report-cycles 50+&amp;lt;/code&amp;gt; for reliable data&lt;br /&gt;
* Watch for packet loss at the &#039;&#039;&#039;destination&#039;&#039;&#039; (intermediate losses may be false positives)&lt;br /&gt;
* High &#039;&#039;&#039;StDev&#039;&#039;&#039; indicates unstable connection&lt;br /&gt;
* High &#039;&#039;&#039;Avg&#039;&#039;&#039; latency shows slow links&lt;br /&gt;
* Use &amp;lt;code&amp;gt;--no-dns&amp;lt;/code&amp;gt; for faster results&lt;br /&gt;
* Compare &#039;&#039;&#039;ICMP&#039;&#039;&#039;, &#039;&#039;&#039;UDP&#039;&#039;&#039;, and &#039;&#039;&#039;TCP&#039;&#039;&#039; modes if issues appear&lt;br /&gt;
* Test at different times of day for comprehensive analysis&lt;br /&gt;
&lt;br /&gt;
== 4. Package Management Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Fix Broken Packages ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Update package lists&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Fix broken dependencies&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo apt --fix-broken install&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Reconfigure packages&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo dpkg --configure -a&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;(if no output, there is nothing to do)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Clean package cache&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo apt clean&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo apt autoclean&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Remove unused packages&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo apt autoremove&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Handle Held or Locked Packages ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# If apt is locked, find the process&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo lsof /var/lib/dpkg/lock-frontend&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Force remove lock (use carefully)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo rm /var/lib/dpkg/lock-frontend&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo rm /var/lib/apt/lists/lock&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Reconfigure dpkg&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo dpkg --configure -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 5. Disk &amp;amp; Filesystem Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Check Disk Health ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Check disk space&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;df -h&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check inode usage&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;df -i&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# View disk I/O statistics&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;iostat -x 1&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;(Make sure you have sysstat which includes useful performance monitoring tools other than iostat - disk I/O statistics&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;mpstat&amp;lt;/code&amp;gt; - CPU statistics&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;sar&amp;lt;/code&amp;gt; - system activity reporter&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;pidstat&amp;lt;/code&amp;gt; - process statistics&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;cifsiostat&amp;lt;/code&amp;gt; - CIFS statistics&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&#039;&#039;# Show stats in MB instead of KB&#039;&#039; iostat -xm 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&#039;&#039;# Monitor specific device&#039;&#039; iostat -x sda 1&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;# Check for disk errors in dmesg&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo dmesg | grep -i &amp;quot;error\|fail&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# SMART disk health (if smartmontools installed)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo smartctl -a /dev/sda&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Repair Filesystem ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Unmount the partition first&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo umount /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Run filesystem check&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo fsck /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# For ext4 specifically&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo e2fsck -f /dev/sdXN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 6. Performance Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Identify Resource Hogs ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# CPU usage by process&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;top -o %CPU&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Memory usage by process&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;top -o %MEM&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Disk usage by directory&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;du -sh /* | sort -h&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Find large files&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;find / -type f -size +100M 2&amp;gt;/dev/null&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check running processes&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ps aux --sort=-%mem | head -20&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== System Temperature Monitoring ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Install sensors (if not installed)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo apt install lm-sensors&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo sensors-detect&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# View temperatures&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sensors&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Real-time temperature monitoring&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;watch -n 2 sensors&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;&#039;&#039;I have it as an alias in ~/.bashrc&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;&#039;&#039;Go to 11. Useful Aliases &amp;amp; Shortcuts&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 7. Service &amp;amp; Application Errors ==&lt;br /&gt;
&lt;br /&gt;
=== Debug Service Problems ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Check service status&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo systemctl status service-name&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# View service logs&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo journalctl -u service-name&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Restart a service&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo systemctl restart service-name&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Enable service at boot&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo systemctl enable service-name&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# View recent service failures&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;journalctl -p err -b&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Application Crash Investigation ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Check for core dumps&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ls -lh /var/crash/&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# View application-specific logs&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ls /var/log/&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check syslog for application errors&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo tail -f /var/log/syslog&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 8. Permission &amp;amp; Access Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Fix Common Permission Problems ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Check file ownership&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;ls -l /path/to/file&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Change ownership&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo chown michael:michael /path/to/file&amp;lt;/code&amp;gt;&lt;br /&gt;
 user:group&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Change permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo chmod 644 /path/to/file&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Recursively fix permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo chown -R user:group /path/to/directory&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== User &amp;amp; Authentication Issues ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Check user information&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;id username&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# View user login history&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;last -a&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check failed login attempts&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo journalctl | grep &amp;quot;authentication failure&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Reset user password&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo passwd username&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 9. Hardware Issues ==&lt;br /&gt;
&lt;br /&gt;
=== Identify Hardware ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# List all hardware&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo lshw -short&amp;lt;/code&amp;gt;&lt;br /&gt;
 (May not be installed by default)&lt;br /&gt;
 sudo apt install lshw&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# PCI devices&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;lspci -v&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# USB devices&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;lspci -v&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# CPU information&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;lscpu&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Memory information&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo dmidecode --type memory&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Check Hardware Errors ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Kernel ring buffer (hardware messages)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;dmesg | less&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;(If no output, good, no errors)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;q to quit&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Search for specific hardware issues&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;dmesg | grep -i &amp;quot;error\|fail\|warn&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check for USB issues&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;dmesg | grep -i usb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 10. Quick Diagnostic Commands ==&lt;br /&gt;
&lt;br /&gt;
=== System Information at a Glance ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Uptime and load average&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;uptime&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Kernel version&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;uname -r&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Debian version&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;cat /etc/debian_version&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# System summary&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo inxi -Fxz&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emergency Toolkit ===&lt;br /&gt;
 &amp;lt;code&amp;gt;# Create a diagnostic report&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo journalctl -b &amp;gt; ~/system-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;dmesg &amp;gt;&amp;gt; ~/system-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;systemctl --failed &amp;gt;&amp;gt; ~/system-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;df -h &amp;gt;&amp;gt; ~/system-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;free -h &amp;gt;&amp;gt; ~/system-report.txt&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Watch logs in real-time&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;sudo journalctl -f&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Monitor system resources continuously&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;watch -n 1 &#039;free -h &amp;amp;&amp;amp; df -h&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 11. Useful Aliases &amp;amp; Shortcuts ==&lt;br /&gt;
Add these to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; for quick access to common troubleshooting commands:&lt;br /&gt;
 &amp;lt;code&amp;gt;# Monitor system temperatures in real-time&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias temps=&amp;quot;watch -n 2 &#039;for i in /sys/class/hwmon/hwmon*/; do echo -n \&amp;quot;\$(cat \${i}name): \&amp;quot;; cat \${i}temp*_input 2&amp;gt;/dev/null | while read temp; do echo \&amp;quot;scale=1; \$temp/1000\&amp;quot; | bc; done | tr \&amp;quot;\n\&amp;quot; \&amp;quot; \&amp;quot;; echo \&amp;quot;°C\&amp;quot;; done&#039;&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;&#039;&#039;or run the watch command in the shell without the opening and closing double quotes.&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Quick system status&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias sysstat=&#039;echo &amp;quot;=== CPU ===&amp;quot; &amp;amp;&amp;amp; uptime &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Memory ===&amp;quot; &amp;amp;&amp;amp; free -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Disk ===&amp;quot; &amp;amp;&amp;amp; df -h &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Top Processes ===&amp;quot; &amp;amp;&amp;amp; ps aux --sort=-%mem | head -10&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;(It’s a messy mayout, but I’m terrible with awk. Feel free to improve the layoput for me)&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# View last boot logs&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias lastboot=&#039;journalctl -b -1&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Check failed services&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias failedservices=&#039;systemctl --failed&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Monitor logs in real-time&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias watchlog=&#039;sudo journalctl -f&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;code&amp;gt;# Quick network status&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;alias netstat=&#039;ip addr show &amp;amp;&amp;amp; echo -e &amp;quot;\n=== Routes ===&amp;quot; &amp;amp;&amp;amp; ip route show&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
After adding these, run:&lt;br /&gt;
 &amp;lt;code&amp;gt;source ~/.bashrc&amp;lt;/code&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tips for Your Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;First check logs&#039;&#039;&#039;: &amp;lt;code&amp;gt;journalctl&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;dmesg&amp;lt;/code&amp;gt; are your best friends&lt;br /&gt;
# &#039;&#039;&#039;Work through the sections&#039;&#039;&#039;: Change one thing at a time&lt;br /&gt;
# &#039;&#039;&#039;Document changes&#039;&#039;&#039;: Keep notes on what you&#039;ve tried&lt;br /&gt;
# &#039;&#039;&#039;Search for error messages&#039;&#039;&#039;: Copy exact error messages into search engines or AI&lt;br /&gt;
# &#039;&#039;&#039;Check recent changes&#039;&#039;&#039;: What you did before it happened? Install something, update packages, kernel?&lt;br /&gt;
# &#039;&#039;&#039;Make backups&#039;&#039;&#039;: Before major changes, backup important data&lt;br /&gt;
# &#039;&#039;&#039;Use verbose mode&#039;&#039;&#039;: Add &amp;lt;code&amp;gt;-v&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-vv&amp;lt;/code&amp;gt; flags to commands for more detail&lt;br /&gt;
# &#039;&#039;&#039;Check forums&#039;&#039;&#039;: Debian forum, Reddit, Stack Exchange, and mailing lists&lt;br /&gt;
&lt;br /&gt;
----&#039;&#039;&#039;Remember&#039;&#039;&#039;: If in doubt, search for the specific error message along with &amp;quot;Debian&amp;quot; and the version number. e.g. Debian 13 or point release if needed, Debian 13,1&lt;br /&gt;
&lt;br /&gt;
This work was contributed by distro-nix on Debian User Forums on 2025-10-27 23:38:22&lt;br /&gt;
&lt;br /&gt;
I welcome comments, suggestions or resources : dev@divsmart.com .&lt;br /&gt;
&lt;br /&gt;
[[index.php?title=Category:Troubleshooting]]&lt;br /&gt;
[[index.php?title=Category:Guides]]&lt;/div&gt;</summary>
		<author><name>Distro-nix</name></author>
	</entry>
</feed>