By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
(Clearing, Purging, Degaussing, Shredding – Zero Fluff, 100% Actionable)
You’re decommissioning a server, selling old laptops, or migrating cloud storage. If you don’t properly destroy data, you’re handing attackers a treasure map to your company’s secrets—passwords, PII, financial records, or trade secrets. Data sanitization isn’t just about hitting "Delete"; it’s about ensuring data cannot be recovered, even with forensic tools.
Real-world scenario: Your company is retiring 50 hard drives from an old database server. The drives contain customer credit card numbers (PCI DSS compliance). If you just reformat them and toss them in a dumpster, a hacker with a $50 USB adapter and free software (like Autopsy or FTK) can recover the data in hours. You’re now in breach of PCI DSS, GDPR, and probably 10 other regulations. Fines? Lawsuits? Reputation damage? All of the above.
This guide gives you battle-tested methods to destroy data so thoroughly that even the NSA would struggle to recover it.
A Linux machine (or Windows with WSL/WSL2). ? A target drive (HDD/SSD) you want to wipe (e.g., /dev/sdb). ? Backup any data—this is permanent. ? hdparm (for Secure Erase) and shred (for overwriting) installed.
/dev/sdb
hdparm
shred
Best for: HDDs, USB drives, or when you don’t trust Secure Erase.
# 1. Identify the target drive (BE CAREFUL - WRONG DRIVE = DATA LOSS) lsblk # Example output: # NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT # sda 8:0 0 465.8G 0 disk # sda1 8:1 0 465.8G 0 part / # sdb 8:16 0 238.5G 0 disk <-- This is our target # 2. Unmount the drive (if mounted) sudo umount /dev/sdb* # 3. Overwrite with random data (3 passes, verify) sudo shred -v -n 3 -z /dev/sdb
-v
-n 3
-z
Verification:
# Check if data is gone (should return nothing) sudo strings /dev/sdb | grep -i "password"
Best for: SSDs (faster than overwriting) or HDDs that support it.
# 1. Check if the drive supports Secure Erase sudo hdparm -I /dev/sdb | grep -i "security" # Look for: # * Security Mode feature set # * Enhanced erase supported # 2. Set a temporary password (required for Secure Erase) sudo hdparm --user-master u --security-set-pass "p@ssw0rd" /dev/sdb # 3. Execute Secure Erase (takes 1-2 minutes) sudo hdparm --user-master u --security-erase "p@ssw0rd" /dev/sdb # 4. Verify (should show "not enabled") sudo hdparm -I /dev/sdb | grep -i "security"
If Secure Erase fails: - The drive may be frozen (common in laptops). Reboot and try again. - If still failing, use shred (Method 1) or physical destruction.
Best for: Magnetic media only (HDDs, tapes). Does not work on SSDs.
Warning: - Degaussing destroys the drive permanently (it won’t boot again). - Not all degaussers are strong enough—check the Oersted (Oe) rating (HDDs need >1700 Oe).
Best for: High-security environments (government, finance).
Warning: - Never just "smash" a drive with a hammer—forensic tools can still recover data from fragments. - Use a certified destruction service (e.g., Iron Mountain, Shred-it) for compliance.
Follow NIST SP 800-88 for sanitization levels: - Clear = Basic overwrite (for non-sensitive data). - Purge = Cryptographic erasure or degaussing (for sensitive data). - Destroy = Physical destruction (for classified/secret data).
Document everything (for audits): - Serial numbers of destroyed drives. - Method used (e.g., "Secure Erase via hdparm"). - Date, time, and technician name.
For cloud storage (AWS, Azure, GCP): - S3: Use Object Lock + Versioning + Lifecycle Policies to auto-delete old data. - EBS Volumes: Use AWS KMS encryption + DeleteVolume API (cryptographic erasure). - Azure Blob Storage: Enable Immutable Blob Storage + Soft Delete.
DeleteVolume
Degaussing vs. Shredding: - Degaussing = ~$500 for a degausser (one-time cost). - Shredding = ~$10–$50 per drive (outsourced).
Reuse vs. Destroy: - If drives are still functional, Secure Erase + reimage (cheaper than buying new). - If drives are failing, shred immediately (no point in risking data leaks).
Test your methods: - After wiping, attempt data recovery (e.g., with TestDisk or Autopsy). - If data is recoverable, use a stronger method.
Automate sanitization: - For Linux servers: Script shred into your decommissioning playbook. - For Windows: Use cipher /w:C: (but not secure for SSDs).
cipher /w:C:
Log all sanitization events: - Who performed the wipe? - When was it done? - What method was used? - Verification results (e.g., "No data recovered via strings").
strings
Alert on failed wipes: - If shred or hdparm fails, trigger a ticket for manual review.
rm
format
Degaussing (only for HDDs).
"What’s the difference between clearing and purging?"
Purging = Multiple overwrites or cryptographic erasure (stronger).
"Which NIST standard covers media sanitization?"
NIST SP 800-53 (general security controls).
"You need to decommission a server with classified data. What’s the most secure method?"
You have an old SSD from a decommissioned laptop. How do you ensure no data can be recovered? (Assume you don’t have a degausser or shredder.)
# 1. Check if the SSD supports Secure Erase sudo hdparm -I /dev/sdX | grep -i "security" # 2. If supported, perform Secure Erase sudo hdparm --user-master u --security-set-pass "temp" /dev/sdX sudo hdparm --user-master u --security-erase "temp" /dev/sdX # 3. If Secure Erase fails, use cryptographic erasure sudo cryptsetup luksFormat /dev/sdX # Encrypt the drive sudo cryptsetup luksErase /dev/sdX # Destroy the key
Why it works: - Secure Erase resets all blocks to factory state. - Cryptographic erasure makes data unrecoverable by destroying the encryption key.
sudo shred -v -n 3 -z /dev/sdX
sudo hdparm --security-erase "pass" /dev/sdX
hdparm -I
sudo cryptsetup luksErase /dev/sdX
sudo strings /dev/sdX | grep -i "password"
rm -rf /path
Data destruction isn’t just a checkbox—it’s your last line of defense against breaches. A single missed drive can cost millions in fines and reputational damage. Use this guide to build a repeatable, auditable process for sanitization, and you’ll sleep easier knowing your data is truly gone.
Now go wipe something responsibly. ?
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.