12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <!DOCTYPE html>
- <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Free Up Pi-Hole Disk Space Usage</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta charset="UTF-8">
- <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">
- <meta name="author" content="i12bretro">
- <meta name="description" content="Free Up Pi-Hole Disk Space Usage">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
- <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
- <script type="text/javascript" src="includes/js/steps.js"></script>
- <link href="css/steps.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="gridContainer">
- <div class="topMargin"></div>
- <div id="listName" class="topMargin">
- <h1>Free Up Pi-Hole Disk Space Usage</h1>
- </div>
- <div></div>
- <div id="content">
- <h2>Cleaning Log Files</h2>
- <ol>
- <li>Log into the Pi-Hole server</li>
- <li>Run the following commands in a terminal window
- <div class="codeBlock"># output current pihole db size<br />
- sudo du /etc/pihole/pihole-FTL.db -h<br />
- # flush pihole logs<br />
- pihole flush<br />
- # stop pihole FTL service<br />
- sudo systemctl stop pihole-FTL<br />
- # delete the FTL database file<br />
- sudo rm /etc/pihole/pihole-FTL.db<br />
- # stop pihole FTL service<br />
- sudo systemctl start pihole-FTL<br />
- # output reduced pihole db size<br />
- sudo du /etc/pihole/pihole-FTL.db -h</div>
- </li>
- </ol>
- <h2>Reduce Long Term Log Lifespan</h2>
- <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>
- <ol>
- <li>To reduce the log lifespan, run the following commands in a terminal window
- <div class="codeBlock"># edit pihole-FTD.conf<br />
- sudo nano /etc/pihole/pihole-FTL.conf</div>
- </li>
- <li>Add or edit MAXDBDAYS value in the configuration file as needed</li>
- <li>Press CTRL+O, Enter, CTRL+X to write the changes</li>
- <li>Continue with the following command
- <div class="codeBlock"># restart pihole-FTL server<br />
- sudo systemctl restart pihole-FTL</div>
- </li>
- <li>After restarting the service the new logs lifespan will be active</li>
- </ol>
- <p>Pi-hole Documentation: <a href="https://docs.pi-hole.net/ftldns/configfile/" target="_blank">https://docs.pi-hole.net/ftldns/configfile</a></p>
- </div>
- </div>
- </body>
- </html>
-
|