侧边栏壁纸
  • 累计撰写 99 篇文章
  • 累计创建 54 个标签
  • 累计收到 1 条评论

目 录CONTENT

文章目录

Wipe disk completely method

FlyingEagle
2025-03-16 / 0 评论 / 0 点赞 / 16 阅读 / 1,792 字

Wipe disk out completely method

HDD TOOLS

Using /dev/zero (Faster, Less Secure)

This method writes zeros across the entire disk.

dd if=/dev/zero of=/dev/sdX bs=1M status=progress

  • Replace /dev/sdX with your actual disk (e.g., /dev/sdb). This is a quick way to erase data but not the most secure, as patterns might still be detectable.

Using /dev/random (More Secure, Slower)

This method writes random data to the disk, making it harder to recover erased data.

dd if=/dev/random of=/dev/sdX bs=1M status=progress

  • This is significantly slower because /dev/random generates data at a much lower speed compared to /dev/zero.

Using shred (Multiple Passes for Better Security)

shred -vzn 3 /dev/sdX

  • v for verbose output.
  • z to write a final pass of zeros.
  • n 3 to overwrite three times (adjust as needed).

SSD TOOLS

1, Using hdparm (For SATA SSDs)

  • This method sends an ATA Secure Erase command to the SSD, resetting all data instantly.
Step 1: Check If Secure Erase is Supported
sudo hdparm -I /dev/sdX | grep -i "not frozen"

  • Replace /dev/sdX with your SSD (e.g., /dev/sda). If the drive is “frozen,” you may need to put the system into sleep mode (systemctl suspend) and wake it up to unfreeze the drive.
Step 2: Set a Temporary Password
sudo hdparm --user-master u --security-set-pass pass /dev/sdX

  • You can replace “pass” with any temporary password.
Step 3: Perform Secure Erase
sudo hdparm --user-master u --security-erase pass /dev/sdX

  • This will instantly erase all data on the SSD.

2, Using nvme-cli (For NVMe SSDs)

Step 1: Check Available NVMe Drives
  • For NVMe SSDs, use the NVMe format command, which is equivalent to a factory reset.
sudo nvme list

  • Find the correct device (e.g., /dev/nvme0n1).

Step 2: Securely Erase the Drive

sudo nvme format /dev/nvme0n1 -s 1

  • -s 1 enables secure erase.
  • This operation is instantaneous and does not wear out the SSD.

3. Manufacturer-Specific Tools

Many SSD manufacturers provide their own secure erase tools, such as:

  • Samsung Magician (for Samsung SSDs)
  • Crucial Storage Executive (for Crucial SSDs)
  • Intel SSD Toolbox (for Intel SSDs)
    These tools often work within Windows or a bootable USB.
0

评论区