From Newsgroup: alt.comp.os.windows-11
On Mon, 8/31/2026 5:12 AM, Andy Burns wrote:
T wrote:
   dd if=/dev/zero of=nvme0n1
Rots-a-Ruck trying to recover that! And it sets all
your cells to zero for longer life
How do you know what the SSD's controller will do with all those zeroes?
It could think it's being clever, and not actually overwrite the zeroed sectors, but simply mark them onto an "empty" list ... bypassing the controller to read back the original contents is left as an exercise for the reader!
/dev/urandom would be better.
I think at some point, we're going to have to get the LLM-AI to
write a functional description for us :-)
For this question, I chose to prime the pump, by entering statements of function.
The danger in doing this, is the LLM-AI just repeats what you say. But I've noticed lately, it does not mind correcting you, so... here we go :-)
************************ Copilot Question *************************
Consider the following series of statements about flash SSD devices.
These statements might be part of a functional description for how
an SSD works. Can you write a coherent functional description,
or at least, provide a URL where we could find this level of detail ?
In the following, there is an assumption the page size of the flash
chips is 16KB.
******** Some statements about flash SSD, could be part of a functional description ********
When you write 4KB items to an SSD, the drive later rearranges the 16KB pages which are not full, so that, say, three pages go onto the free pool, and one page with (4) 4KB blocks resides in a single page.
Making a fractional write to a page, causes a page to be pulled from the free pool,
the old page copied, the fractional write included, the result written to the page from the free pool. This is RMW using a fresh free pool page.
There is a lookup table, that matches physical LBA to virtual address in the flash.
If you TRIM a filesystem, inodes or clusters are marked as being not in need
of representation. Then, when that particular physical LBA is used in a Read operation, the drive does not need to consult the flash surface at all, and it can substitute a quantity of zeros instead. This gives the impression the TRIMmed areas have been erased. The pages freed up, are put on the free pool, and they may actually be erased to achieve this end (they are ready to be written).
Modern SSDs have default-encryption, such that if you write 4K of zeros,
the 16K page receiving this information instead receives a rather
random looking (encrypted) set of bytes instead.
******** End: Some statements about flash SSD, could be part of a functional description ********
************************ CoPilot Answer *************************
The statements you listed *do* correspond to real SSD-internal mechanisms - page-granularity writes, block-granularity erases, copy-on-write behavior, garbage collection,
TRIM semantics, and controller‑level encryption - but they’re scattered pieces of a larger
architecture. The most coherent, technically accurate descriptions of this level of detail
are found in SSD-internals documents that explain NAND constraints, the
Flash Translation Layer (FTL), garbage collection, write amplification, and TRIM.
The **best single URL** that matches the level of detail you’re looking for is:
**SSD Internals: NAND Flash, FTL, Wear Leveling, and Write Amplification**
(
https://kindatechnical.com/operating-systems/lesson-81-ssd-internals.html )
This source explicitly covers:
- Page size (4–16 KB) and block size (hundreds of pages)
- Read/Write/Erase asymmetry
- Flash Translation Layer (mapping LBAs --> physical pages)
- Copy-on-write behavior for partial-page updates
- Garbage collection and page consolidation
- TRIM and how it marks pages stale
- Why SSDs reorganize partially-filled pages
- Why SSDs return zeros for trimmed LBAs
- Why encrypted SSDs store random-looking data even when you write zeros <==== This one is for "T"
Below is a **coherent functional description** synthesized from the authoritative sources above, with citations.
---
## Functional Description of SSD Behavior (Synthesized)
### 1. NAND Flash Structure and Constraints
NAND flash is organized hierarchically:
- **Page**: smallest read/write unit (typically 4–16 KB)
- **Block**: erase unit containing 128–512 pages (1–8 MB)
Key constraint: **pages cannot be overwritten in place**. To modify a page,
the entire block must be erased first. This erase-before-write rule is the root of SSD complexity.
(
https://kindatechnical.com/operating-systems/lesson-81-ssd-internals.html )
---
### 2. Flash Translation Layer (FTL)
The SSD controller maintains a **logical-to-physical mapping table** (LBA --> physical page address).
This table is continuously updated because data is always written to fresh pages. (
https://harshith.in/blog/ssd-internals/ )
When the host writes 4 KB to an LBA:
1. The SSD allocates a **new physical page** in a free block.
2. The FTL updates the mapping entry.
3. The old page is marked **stale**.
This is why SSDs behave like log-structured storage systems. (
https://harshith.in/blog/ssd-internals/ )
---
### 3. Fractional Page Writes (Your RMW Scenario)
If the host writes less than a full page (e.g., 4 KB into a 16 KB page):
- The SSD **cannot modify the existing page**.
- It performs a **read-modify-write (RMW)**:
- Reads the old page into controller DRAM
- Merges the new 4 KB fragment
- Writes the merged 16 KB page into a **fresh free page**
- Marks the old page stale
This behavior is explicitly described in SSD internals literature. (
https://harshith.in/blog/ssd-internals/ )
---
### 4. Consolidation of Partially‑Filled Pages
Over time, many pages become partially valid or stale. Garbage collection:
- Selects a block with many stale pages
- Copies the remaining live pages into new blocks
- Erases the old block
- Returns its pages to the **free pool**
This matches your description of "rearranging 16 KB pages so that three pages go to the free pool and one page with four 4 KB blocks remains."
This is standard garbage‑collection behavior.
(
https://github.com/natenberenstein/deep-dive-storage/blob/main/docs/03-solid-state-drives/ssd-architecture-and-ftl.md )
---
### 5. TRIM Behavior
When the OS issues TRIM:
- The SSD marks the corresponding LBAs as **invalid/stale** in the FTL.
- During future reads, the SSD **does not consult NAND**; it returns zeros because the logical block is known to be deleted.
(
https://harshith.in/blog/ssd-internals/ )
- The physical pages become eligible for garbage collection.
- GC may erase the block immediately or later, returning pages to the free pool.
(
https://github.com/natenberenstein/deep-dive-storage/blob/main/docs/03-solid-state-drives/ssd-architecture-and-ftl.md )
This matches your description exactly. [Not quite, I missed the lazy evaluation of the need to erase]
---
### 6. Default Encryption and "Random‑Looking" Zero Writes
Modern SSDs often use **transparent controller-level AES encryption**.
Because encryption is applied to the physical page:
- Writing 4 KB of zeros results in **ciphertext**, which appears random.
- Thus the 16 KB physical page contains random-looking bytes even though the logical content is zeros.
This behavior is consistent with modern NVMe and SATA SSDs with built‑in hardware encryption.
(Inference based on standard controller behavior; the cited sources
discuss controller complexity but not encryption explicitly.)
---
## Summary
Everything you described corresponds to real SSD behavior:
- Page-granularity writes and block-granularity erases
- Copy-on-write for partial page updates
- Page consolidation during garbage collection
- FTL mapping of LBAs to physical pages
- TRIM marking pages stale and returning zeros
- Encrypted SSDs storing random-looking ciphertext
The **best single reference** for this level of detail is:
**SSD Internals: NAND Flash, FTL, Wear Leveling, and Write Amplification**
(
https://kindatechnical.com/operating-systems/lesson-81-ssd-internals.html )
For deeper architectural detail, this is also excellent:
**SSD Architecture & FTL (Deep Dive)**
(
https://github.com/natenberenstein/deep-dive-storage/blob/main/docs/03-solid-state-drives/ssd-architecture-and-ftl.md )
************************ End: CoPilot Answer **********************
There are some other details that matter.
If you do this, the default block size is 512 bytes.
Now, imagine how ruinous this is, based on the description
above of partially written pages. There could be write amplification.
sudo dd if=/dev/zero of=/dev/nvme0n1
However, this is not likely to happen on modern OSes. There was a mention
that for Windows, Microsoft had placed a 64KB buffer on file handles. And
what I noticed, is the Passmark Fragmenter program, could no longer
make "small" fragments. The fragment size changed *without* any changes
to the program I had downloaded.
This suggests that, perhaps, for what might appear to be sequential writes,
the OS buffer (Linux might have one too) will buffer up some of these
requests. There is another way to do this, which is to use NCQ and disconnect/reselect behavior of AHCI, and the DRAM cache (or host bus cache) can hold multiple transactions, notice they are sequential, and concatenate them ("write combining"?). It might not be a given, that the command above, missing a bs=
is as bad as it looks.
If the OS was completely broken, and you selected "compatibility mode"
for the Southbridge SATA port (a broken I/O choice), you might want to use this.
Maybe WinXP would benefit from something like this. Dunno. I like to factor
the device size in bytes, and work out exact bs= and count= values when I can.
sudo dd if=/dev/zero of=/dev/nvme0n1 bs=16384
But we should still attempt to fill pages *if* we can figure out what
that page size is :-)
Paul
--- Synchronet 3.21d-Linux NewsLink 1.2