# No Space Left on the Device Warning

This guide is to resolve **Storage Issues** caused by the NFS server on a node.

### Configuring logrotate for hourly rotation

You can configure `logrotate` to handle log rotation on an hourly basis to manage storage issues caused by excessive log files.

Below are the step-by-step instructions for modifying the `logrotate` configuration.

1. Open the `rsyslog` logrotate configuration file in a text editor.

   ```bash
   sudo vim /etc/logrotate.d/rsyslog
   ```
2. Modify the configuration to set up hourly rotation.
   1. Change the rotate directive to 6.\
      `rotate 6`
   2. Change the `weekly` directive to `hourly.`\
      `hourly`
   3. Add the `maxsize` directive if it is not already present.\
      `maxsize 0`
3. Test the configuration to ensure there are no syntax errors.

   ```bash
   sudo logrotate -d /etc/logrotate.conf
   ```
4. Open the logrotate timer configuration file in a text editor.

   ```bash
   sudo nano /lib/systemd/system/logrotate.timer
   ```
5. Modify the timer to trigger log rotation hourly.\
   Change `OnCalendar=daily` to `OnCalendar=hourly`
6. Restart the `logrotate.timer` to apply the changes.

   ```bash
   sudo systemctl daemon-reload
   sudo systemctl restart logrotate.timer
   ```
7. If needed, clear other log files using the following commands to free up more storage.

   ```bash
   sudo rm -f /var/log/*.gz /var/log/*.1 /var/log/*.old
   ```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.openg2p.org/1.3/deployment/deployment-guide/troubleshooting-section/no-space-left-on-the-device-warning.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
