本文を読み飛ばす

Securely Erasing an HDD with Raspberry Pi

I wanted to securely erase an old HDD using a Raspberry Pi without installing additional tools like wipe or shred.

I found that badblocks is a convenient alternative already available on most Linux systems.

The Procedure Identify the partition:

sudo fdisk -l

Run the erase:

CAUTION: This operation will permanently destroy all data on the specified partition. Proceed with extreme caution.

CAUTION: This method is intended for Hard Disk Drives (HDD) only. Please do not use badblocks for SSDs. see final section

sudo badblocks -wns /dev/sdb6 Performance Note Device: Raspberry Pi 3B+
  • -w: write mode -n: non-destructive (uses four passes: 0xaa, 0x55, 0xff, 0x00)
  • -s: show progress

Result of my server:

  • Target Size: ~600 GB
  • Time Taken: Approximately 49 hours

Comparison with VSITR

While standard badblocks -w uses a four-pass pattern:

0xAA -> 0x55 -> 0xFF -> 0x00

the VSITR standard typically requires seven passes.

0x00 -> 0xFF ->
0x00 -> 0xFF ->
0x00 -> 0xFF -> 0xAA

While badblocks is not as rigorous as full VSITR, it is sufficient for most personal data sanitization needs.

Erasing SSD

Because SSDs use wear-leveling algorithms, the controller maps logical blocks to physical memory cells in a way that is transparent to the OS. Simply writing data to a partition does not guarantee that every physical cell on the drive has been overwritten, meaning sensitive data could potentially remain in hidden blocks.

If you need to securely erase an SSD, please use the blkdiscard command or the manufacturer's secure erase utility to trigger the drive's internal sanitization process.

コメント

Comments powered by Disqus
宣伝: