How SSD Logging Can Cause 37TB of Writes in 3 Weeks

Resumen

Pixel shares a report of Codex logs generating 37TB of SSD writes in about 21 days, despite a SQLite database of only 1.2 GiB. The announcement introduces Disk-O-Meter, a menu bar app that tracks daily writes by disk and identifies the processes responsible, helping the community spot excessive write activity early.

DEV Community

How to (not) Destroy Your SSD

37 TeraBytes in three weeks In June 2026 a Codex user opened an issue on the openai/codex repository with a set of numbers that did not seem to belong together. The SQLite database in which Codex keeps its feedback logs, ~/.codex/logs_2.sqlite, took up about 1.2 GiB and held 506,149 rows, an unremarkable size for a log, and yet the counter that hands every new row its ID had already passed five and a half billion. Over roughly 21 days of uptime the main SSD of that machine had taken about 37 TB of writes, and the reporter's own process and file checks pointed at the Codex logs as the main continuous writer. When the reporter watched the database for 15 seconds, 36,211 new rows went in while the number of rows it kept stayed exactly where it was, because every insert at one end was matched by a deletion at the other. I came across the story on November 2, when it was retold it on dev.to under the title "Codex Was Torching Your SSD and Nobody Noticed for Months," and what stayed with me was less the bug than the second half of that title. The bug had been reported in June and the issue closed in July, so by the time the article appeared it was old news to anyone following the repository. The months before the report were what unsettled me, because the drive is the one part of a laptop that wears out without making a sound, and I realized that I had no idea how many bytes my own Mac wrote on an ordinary day, let alone which program wrote them. Six days after the article appeared I tagged the first version of Disk-O-Meter, a small menu bar app that counts what gets written to each disk every day and names the processes that wrote it. Figure 1. The chronology Some argue that the wear on a drive is measured in bytes written rather than bytes stored, and that because nothing on a Mac puts the first of those figures in front of us day after day, a runaway writer can work away for months in plain sight. I will start with the mechanics of how a file that never grows can still wear out a drive, then turn to why the usual tools missed it, and from there to how Disk-O-Meter measures writes, how it finds the process responsible, how it raises an alarm, and where its numbers stop being trustworthy. Why a small file can wear out a big drive An SSD stores data in flash cells that survive only a limited number of erase-and-rewrite cycles, which is why manufacturers state a drive's endurance as a figure called TBW, terabytes-written, the total amount of data the computer may send to the drive before the maker stops promising that the cells will hold it. The issue put the Codex numbers against that scale. At 37 TB in 21 days, a year of the same use comes to about 640 TB, which on a 1 TB drive means rewriting the whole drive some 640 times a year, and since some consumer drives are rated at around 600 TBW, the reporter concluded that such a pace could use up a drive's warranted endurance in less than a year. People were careful to call this extrapolation from one heavy user rather than a forecast for everyone, and I keep that caution here. The stakes on a Mac are, if anything, higher than on a desktop PC, because Apple doesn't publish endurance ratings for its SSDs, and in a MacBook the flash is soldered to the logic board, so worn-out storage is not a part anyone swaps on a Saturday afternoon. Figure 2. The 37 TB measured in 21 days, carried forward at the same pace, reaches the 600 TBW rating of some 1 TB drives after about 11 months, which is arithmetic on one heavy user's machine rather than a forecast for anyone else's. The harder question is how a file of 1.2 GiB can account for terabytes, and the answer lies in the way SQLite writes. A database in this mode first appends every change to a companion file, the write-ahead log or WAL, which here is logs_2.sqlite-wal, and only later folds those changes into the main file during a step called a checkpoint. Each new log row is therefore written at least twice, once into the WAL and once into ...
How SSD Logging Can Cause 37TB of Writes in 3 Weeks
Powered by Readybot.io

Lo último de Pixel

Incident Response: Look Beyond the Red Alert

Pixel’s DEV Community announcement explores how teams can fixate on one failing service while overlooking the real cause of an outage, such as a full …

Sach: AI Fact-Checks WhatsApp Forwards in India

Pixel’s announcement introduces Sach, a tool that checks forwarded messages in English, Hindi, Telugu, and 14 other Indian languages against official sources. It gives cited …

Java 25 Removes SecurityManager: What to Fix

Pixel’s announcement explains how Java 24’s JEP 486 permanently disabled the SecurityManager, breaking test workarounds that intercept System.exit. It recommends returning exit codes or throwing …