# disk-full

The **disk is almost full**, so the database refuses writes until there is room again.

- **Routes:** `write-events`, `register-event-schema`, `restore-backup`, and `import-events`
- **Description:** `disk is full: less than the reserve of 1 GiB is free, so the store refuses writes until at least 1 GiB has been free for 10 seconds`
- **Details:** **`operation`**, which is always `write`.

## Why It Happens

EventSourcingDB keeps a **reserve of 1 GiB** free on the file system that holds its data directory. It checks the free space when it starts and every second after that, and once **less than 1 GiB** is free, it refuses writes. Once **at least 1 GiB** has been free again for **10 seconds**, it **accepts writes again by itself**, without a restart. Reading, observing, and every other route that does not write go on as usual, see **[Read-Only Mode While the Disk Is Almost Full](/docs/eventsourcingdb/read-only-mode#read-only-mode-while-the-disk-is-almost-full)**.

If writes are refused for another reason as well, the error names the one that takes the most to lift: **[`server-shutting-down`](/docs/eventsourcingdb/errors/server-shutting-down)**, **[`store-failed`](/docs/eventsourcingdb/errors/store-failed)**, and **[`store-read-only`](/docs/eventsourcingdb/errors/store-read-only)** are reported instead of `disk-full`, and `disk-full` instead of **[`restore-in-progress`](/docs/eventsourcingdb/errors/restore-in-progress)**.

## How to Fix It

Free space on the file system of the data directory, or enlarge it, until at least 1 GiB is free, and more where you can, since the writes that follow fill whatever is free above the reserve. About 10 seconds later, the database accepts writes again, and **sending the same request again can succeed**; the refused request has changed nothing.

## Example

For a write while the disk of the data directory is almost full, EventSourcingDB answers with this error, as a line of the stream, and then ends the stream with its `end` item:

```json
{
  "type": "error",
  "data": {
    "code": "https://docs.eventsourcingdb.io/errors/disk-full",
    "description": "disk is full: less than the reserve of 1 GiB is free, so the store refuses writes until at least 1 GiB has been free for 10 seconds",
    "details": {
      "operation": "write"
    }
  }
}
```
