CliDeck

Linux Discard Reports: What fstrim Bytes Actually Mean

← Back to Blog

Short answer

A large byte count from fstrim is not a measurement of physically erased media. The util-linux manual describes it as bytes sent down the storage stack for potential discard. Repeating the operation can report the same ranges again; adding those reports does not establish additional sanitization coverage.

For a data-removal decision, retain the exact command, target, software version and storage path. Determine whether the selected operation is an accepted sanitization method for the device and information involved. A successful trim report cannot supply missing evidence about a different operation or inaccessible storage.

Who this is for

This guide is for Linux administrators and sanitization reviewers interpreting discard records before releasing storage. It focuses on what tool output establishes, not on scheduling routine SSD maintenance.

The examples use documented util-linux information commands. Consult the installed package's manual because distributions can ship different versions and patches. The kernel device-mapper thin-pool example below is scoped to that documented target; it is not a claim about every RAID controller, virtual disk or SSD.

Verification note: No trim, discard, overwrite or media-sanitization operation was executed for this article. No real device logs were available. The checks are prospective criteria, and the repeated-report example is hypothetical.

When to use this

Use this review when a work record treats a trim byte count as proof of removal, sums repeated reports into an erased-capacity total, or replaces a failed sanitization operation with a successful discard result.

It is also useful when a command runs against a filesystem or virtual volume while the release decision concerns a physical drive. The target name and the treatment boundary need to match the claim.

When not to use this

Do not use the article as authorization to issue discard requests on a live device. Direct block-device discard is destructive. Ownership, preservation requirements, target identity and the approved removal method must be resolved before a destructive action.

Do not retry a failed method with a weaker operation merely to obtain a successful exit. If the required result remains unsupported, retain the device as an exception rather than changing the certificate wording.

Read the fstrim number correctly

The upstream manual says fstrim operates on blocks that a mounted filesystem is not using. Its verbose result describes potential discard submitted through the block stack. It is not a count of old physical pages observed being erased.

The manual also explains that repeated calls can submit the same sectors and that lower layers may adjust ranges. Consequently, a report must remain attached to its particular target, invocation and interpretation. It cannot be turned into a universal physical coverage measurement.

Suppose a hypothetical job reports the same potential byte count on two consecutive runs. The second report does not establish that a second, disjoint set of storage was treated. A reviewer should preserve both attempts without presenting their sum as unique erased capacity.

Allocated files are another boundary. Trimming unused filesystem space does not become a whole-filesystem deletion procedure simply because the reported number is large. The treatment of data that the filesystem still uses needs its own approved method and evidence.

Identify the tools without performing removal

On the Linux host whose records are being reviewed, capture the installed versions:

lsblk --version
fstrim --version
blkdiscard --version

Then inspect the host's reported discard capabilities:

lsblk --discard

These commands report information; they do not request media removal. The lsblk manual documents its discard view. Treat that view as a description of the exposed block-device interface, not a test that proves an erase operation reached all physical data locations.

Reconcile the displayed devices with the asset record and the actual filesystem-to-device mapping. Record the model and serial through the organization's established inventory process. A logical volume, partition and underlying physical drive are different targets even when their sizes look similar.

If the installed tool does not support an option, capture its help and resolve the version difference. Do not add an erase-capable command as a substitute for missing inventory output.

Discard can stop at a mapping layer

The Linux thin-pool documentation gives a concrete counterexample to assuming end-to-end physical treatment: its no_discard_passdown option removes a mapping without passing the discard to the underlying data device.

This is a documented configuration possibility, not evidence that a particular system uses it. For the actual asset, obtain the relevant configuration and mapping evidence from the storage administrator. A command accepted above a mapping layer does not, by itself, document what happened below it.

Keep that finding scoped. It explains why the reviewer must inspect the path; it does not establish that every discard request is ignored or that every removed block remains recoverable. Both unsupported reassurance and unsupported recovery claims go beyond the available evidence.

Do not mix three different operations

The blkdiscard manual distinguishes ordinary discard, secure discard and zero-fill. Secure discard requires device support and has a stronger documented treatment of garbage-collected copies. Zero-fill is a different operation from discard. None of these names removes the need to qualify the actual device, path and required outcome.

Record in the jobAcceptance question
Filesystem trim outputWhich unused ranges were submitted, and why would that satisfy the removal requirement?
Direct block-device discardWhich device and range were targeted, and what treatment does the supported implementation establish?
Secure discard selectionWas that capability supported on this path, and what completion evidence belongs to this attempt?
Zero-fill selectionWhich logical range was written, and what remains outside that demonstrated scope?

Do not infer secure-discard support merely because ordinary discard is advertised. Do not turn zero-valued reads into proof about hidden physical regions. A read result describes the accessed interface and range; its interpretation needs the device and mapping semantics.

The upstream blkdiscard manual documents exclusive opening by default from util-linux 2.36 and says that force disables that protection. A refusal on an in-use target is a reason to resolve the conflict, not an instruction to add force. This article intentionally shows no destructive invocation.

Workflow

  1. Define the claim being accepted. State whether the job concerns filesystem cleanup, removal from a logical volume, or sanitization of a physical asset for transfer. Record the information owner, intended destination and required method.
  2. Bind the record to the target. Reconcile the filesystem, logical layers, physical asset and any selected range. Preserve the mapping at the time of the attempt. Do not rely on a device name from a different boot or host.
  3. Capture software and capability context. Save the installed util-linux version, relevant local manual, exposed capability information and applicable device documentation. An advertised capability and a completed operation are separate evidence items.
  4. Review the storage path. Identify layers that transform or stop discard. Obtain authoritative configuration evidence where needed. If that path is unresolved, keep its treatment scope unresolved too.
  5. Apply the approved method. Before any destructive action, confirm authorization, preservation decisions and the intended target. Use the qualified procedure for that exact system. Do not substitute a trim command for an unavailable sanitization method.
  6. Preserve the actual result. Retain the invocation, selected target and range, timestamps, exit status and diagnostic output. Keep failed and interrupted attempts visible. A later successful maintenance command does not overwrite the meaning of an earlier failure.
  7. Review against the original requirement. Record what each artifact establishes and what remains unknown. Release the asset only when the required acceptance criteria are met, or retain it under the approved exception process.

Verification checklist

  • The command record belongs to the same host, asset and processing attempt.
  • The operation is identified as trim, ordinary discard, secure discard, zero-fill or another documented method.
  • The target and range correspond to the authorized data-removal scope.
  • Repeated potential-discard counts have not been added as unique physical coverage.
  • The relevant mapping and capability assumptions have supporting evidence.
  • Unsupported, failed or partial results have explicit dispositions.
  • The acceptance statement does not extend logical observations into hidden physical coverage.

When stronger evidence is required, obtain the supported sanitization procedure and its defined completion checks. A zero-read scan or successful filesystem mount can be useful within a declared test, but neither substitutes for the missing method record.

Resale and evidence checklist

Retain the asset identity, authorization, approved method, actual operation record, path limitations and reviewer decision. Keep the trim report as the artifact it is, rather than relabeling it as a device-sanitize certificate.

Account for retained copies and storage outside the processed scope through their own dispositions. Deleting one logical mapping does not close an unrelated backup or physical-media release requirement.

What not to publish

Keep customer filesystem labels, unredacted device identifiers, private mount paths and confidential configuration output out of public sale listings. Preserve necessary details in the restricted record. Describe only the method and outcome that record supports.

Common mistakes

A byte count is not a physical erasure counter. A capability listing is not a successful-operation record. Ordinary discard support is not secure-discard support. A force option does not improve the assurance of a method.

Avoid changing the scope after the result arrives. If the original job required physical-device sanitization, a successful cleanup of unused filesystem space cannot silently replace that requirement.

CliDeck workflow fit

Use a repeatable checklist to preserve identity, tool versions, selected operation and authoritative completion evidence. Keep interpretation notes alongside the raw record so a later reviewer can distinguish maintenance output from accepted sanitization evidence. This workflow pattern does not claim that CliDeck implements discard or certifies a device's removal outcome.

FAQ

Can two trim reports prove twice the erased capacity?

No. The reported potential ranges can overlap or repeat. Preserve attempt history without treating the sum as unique physical coverage.

Does lsblk prove that secure discard will work?

No. Its discard view is capability information at the exposed interface. Qualify the exact operation and path separately.

Can a failed sanitization job be closed after a successful trim?

Only if the authorized acceptance requirement is actually satisfied by the documented replacement method. A successful exit alone does not justify that change.

Related guides