0613.html 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Free Up Pi-Hole Disk Space Usage</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Free Up Disk Space,Free Up Storage Space,Pi-Hole Disk Cleanup,Pi-Hole,Network Wide Ad Blocking,DNS,Ad Blocker,Home Lab,Self-Hosted,Disk Space,Log Cleanup,Disk Cleanup,System Maintenance,Pi Hole,Ad Blocking,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Free Up Pi-Hole Disk Space Usage">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  12. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  13. <script type="text/javascript" src="includes/js/steps.js"></script>
  14. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  15. </head>
  16. <body>
  17. <div id="gridContainer">
  18. <div class="topMargin"></div>
  19. <div id="listName" class="topMargin">
  20. <h1>Free Up Pi-Hole Disk Space Usage</h1>
  21. </div>
  22. <div></div>
  23. <div id="content">
  24. <h2>Cleaning Log Files</h2>
  25. <ol>
  26. <li>Log into the Pi-Hole server</li>
  27. <li>Run the following commands in a terminal window
  28. <div class="codeBlock"># output current pihole db size<br />
  29. sudo du /etc/pihole/pihole-FTL.db -h<br />
  30. # flush pihole logs<br />
  31. pihole flush<br />
  32. # stop pihole FTL service<br />
  33. sudo systemctl stop pihole-FTL<br />
  34. # delete the FTL database file<br />
  35. sudo rm /etc/pihole/pihole-FTL.db<br />
  36. # stop pihole FTL service<br />
  37. sudo systemctl start pihole-FTL<br />
  38. # output reduced pihole db size<br />
  39. sudo du /etc/pihole/pihole-FTL.db -h</div>
  40. </li>
  41. </ol>
  42. <h2>Reduce Long Term Log Lifespan</h2>
  43. <p><em>By default, Pi-hole keeps long term DNS logs for 365 days. This lifespan can be changed by altering the MAXDBDAYS variable in /etc/pihole/pihole-FTL.conf</em></p>
  44. <ol>
  45. <li>To reduce the log lifespan, run the following commands in a terminal window
  46. <div class="codeBlock"># edit pihole-FTD.conf<br />
  47. sudo nano /etc/pihole/pihole-FTL.conf</div>
  48. </li>
  49. <li>Add or edit MAXDBDAYS value in the configuration file as needed</li>
  50. <li>Press CTRL+O, Enter, CTRL+X to write the changes</li>
  51. <li>Continue with the following command
  52. <div class="codeBlock"># restart pihole-FTL server<br />
  53. sudo systemctl restart pihole-FTL</div>
  54. </li>
  55. <li>After restarting the service the new logs lifespan will be active</li>
  56. </ol>
  57. <p>Pi-hole Documentation: <a href="https://docs.pi-hole.net/ftldns/configfile/" target="_blank">https://docs.pi-hole.net/ftldns/configfile</a></p>
  58. </div>
  59. </div>
  60. </body>
  61. </html>