I understand that a file points to storage blocks, so why wouldn't overwriting it with shred securely delete it on a modern SSD or NVMe drive?
Does shred actually work on SSDs and NVMe drives?
Answers
Not reliably. Shred overwrites the file through the storage address the operating system sees, but an SSD can write the new data to a different physical location. The old flash pages may remain until the drive reclaims them.
So an inode pointing to the file's blocks doesn't guarantee that repeated writes reach every physical copy. Wear leveling and the drive's internal mapping get in the way.
Reply to this answer
TRIM is worth knowing about here. After a file is deleted, it can tell the SSD that the freed blocks are no longer in use. Some Linux systems run fstrim periodically, and it can also be run manually.
That still isn't a guarantee of immediate, unrecoverable deletion. The drive decides how and when to reclaim the underlying flash.
Reply to this answer
If the goal is to erase the entire drive, look into the drive's secure erase procedure rather than relying on shred for individual files. That's a different operation, though, and it removes more than the one file.
Reply to this answer
Add your answer
Answers are reviewed before publication.
m5.Cautious:
So the overwrite can succeed from the operating system's point of view while an older copy still exists on the flash?
wool-free_wicket:
Exactly. The operating system generally can't tell shred to overwrite that old physical page directly.