任何 PC 中最重要和最危险的组件是硬盘驱动器。危险(Dangerous),不是因为任何物理风险,而是因为它拥有的数据。隐私(Privacy)信息、重要文件、敏感图片——它可能拥有一切。这就是为什么安全擦除您不再使用的任何硬盘驱动器很重要的原因。
但是,不要相信操作系统附带的基本格式化工具。在大多数情况下,这些工具实际上不会擦除数据,从而使您的文件有可能被恢复。您可以通过逐个扇区“零填充”硬盘驱动器来解决此问题。以下是如何使用Linux 实时环境(a Linux live environment)对硬盘驱动器进行零填充。
为什么你应该零填充硬盘(Fill)驱动器(Hard Drive)
一些技术术语非常含糊,但“零填充”就是这个意思。从头到尾,您的硬盘存储空间都充满了零,从而擦除了下面所有以前文件的痕迹。
这种格式化硬盘的方法非常有效,特别是如果您多次“归零”驱动器以删除任何可能的文件痕迹。其他方法是可能的,包括用随机字符填充驱动器,而不是零,但效果是相同的。
零填充硬盘驱动器是一个空驱动器,使任何人都无法(或几乎不可能)检索您的数据。如果您想知道这是否必要,这里有一个示例场景。
您出售一台二手 PC,在此过程中格式化驱动器,但只选择执行“快速”格式化。购买者在硬盘上运行数据恢复,并在此过程中获取您的家庭照片、纯文本密码、重要身份证件等。
如果您对硬盘驱动器进行零填充,则可以完全消除这种风险。虽然可能需要几个小时才能完成,但它可以为您在未来节省大量问题。
创建 Linux 实时环境
按照设计,擦除硬盘驱动器意味着您将没有操作系统可以运行。考虑到这一点,您需要使用Linux live DVD或USB来让您对硬盘驱动器进行零填充。
这些是可移植的Linux环境,允许您在安装它们之前测试发行版,但我们将它们用于稍微不同的目的。几乎每个Linux发行版(以及提供的Live CD/USB环境)都包含您对硬盘驱动器进行零填充所需的软件。
或者,您可以将硬盘驱动器连接到另一台运行Linux的 PC ,尽管使用Linux实时环境可以防止您意外擦除错误的驱动器。
您可以使用Ubuntu(Ubuntu)或Debian等常见发行版提供的预构建Linux实时环境,或使用 Linux Live USB 创建器创建您自己的环境。对于本指南,我们将使用最流行的Linux发行版之一的Linux实时环境- Ubuntu。
- 在另一台 PC 上,或在擦除驱动器之前,前往Ubuntu 网站(Ubuntu website)并下载包含最新桌面版本的ISO文件。(ISO)这可以是最新版本或长期支持(Term Support)版本。
- 下载后,您需要将ISO文件的内容复制到DVD或USB驱动器。如果您使用USB驱动器,请下载并安装 balenaEtcher(install balenaEtcher)以允许您在Linux、macOS 或Windows上执行此操作。本节的其余部分将假设您在Ubuntu实时环境中使用USB驱动器。
- 打开 balenaEtcher 并单击Select Image,在此过程中选择Ubuntu ISO。单击(Click) 选择目标(Select Target)并选择您的USB驱动器。选择两者后,单击Flash开始将Ubuntu ISO文件复制到您的驱动器。
- balenaEtcher 完成将文件复制到您的USB驱动器后,安全地移除驱动器,然后重新启动您的 PC。在 Ubuntu 的加载屏幕上,(Ubuntu)选择Try Ubuntu without Installation(Try Ubuntu Without Installing)。
这将启动Ubuntu实时环境,准备好开始将硬盘归零。
在Linux中使用 shred 对硬盘进行(Hard Drive)零填充(Zero Fill)
Linux上的 shred 命令是一个专业命令,可以安全地擦除您的驱动器。一旦你的Linux实时环境启动(或者一旦你切换到一个单独的Linux安装),你可以从终端运行这个命令来开始。
首先,您需要确定要擦除的正确硬盘驱动器。打开一个终端窗口(按键盘上的Ctrl+Alt+T)并输入sudo fdisk -l tol list all the connected storage devices。找到您的硬盘驱动器,记下设备标签(例如/dev/sda)。
接下来,您需要运行 shred 命令。您可以自定义 shred 以执行多次通过,这意味着它将多次零填充您的驱动器。
键入sudo shred -n 2 -z -v /dev/sda,其中-n是通过次数,-z会将驱动器归零,而-v将显示 shred 工作时的进度。
请务必使用正确的驱动器标签(Be sure to use the correct drive label),将/dev/sda替换为您自己的。没有第二次机会!
SSD 所有者(SSD owners)应减少使用次数,尤其是在您想重复使用该驱动器时。如果是这种情况,请将-n标志设置为1,使用命令sudo shred -n 1 -z -v /dev/sda并将/dev/sda替换为正确的设备标签。
准备好开始后,按 Enter 开始该过程。
使用 shred 命令将硬盘归零需要一些时间,尤其是在运行多次传递时。驱动器越大,完成该过程所需的时间就越长。它还取决于您 PC 上可用的系统资源,以及您的硬盘驱动器速度。
一旦 shred 在您的驱动器上执行完零填充格式,它将是空的——句号。然后,您可以根据自己的需要再次使用或丢弃它。
擦除(Erase)或销毁多余的(Destroy Surplus Hard)硬盘
如果您还没有为未使用的存储空间制定计划,那么您需要一个。无论您是零填充还是钻孔,知道如何安全地销毁硬盘驱动器(how to safely destroy a hard drive)都可以让您高枕无忧,确保您的数据不会被他人窃取。
从损坏或损坏的硬盘驱动器中检索文件非常困难,但您当然可以尝试。如果意外失败,您可以尝试从死硬盘驱动器中提取文件(extract files from a dead hard drive),但最好还是备份最重要的文件。
Perform a Zero Fill Using a Linux Live CD
The moѕt important аnd dangerоus component in any PC is the hard drive. Dangerous, not becausе of any physical risk, but because of the data it holds. Prіvacy information, important documents, sensitive picturеs—it potentially has it all. That’s whу it’s important to safely erasе any hard drіves you’re no longer usіng.
Don’t trust the basic formatting tools included with your operating system, however. In most cases, these tools won’t actually erase the data, leaving it possible for your files to be recovered. You can deal with this problem by ‘zero filling’ a hard drive, sector by sector. Here’s how to zero fill a hard drive using a Linux live environment.
Why You Should Zero Fill a Hard Drive
Some technical terms are pretty ambiguous, but “zero fill” means exactly that. From start to finish, your hard drive storage is filled with zeroes, erasing any trace of previous files underneath.
This method of formatting a hard drive is extremely effective, especially if you “zero” a drive multiple times to remove any possible trace of your files. Other methods are possible, including filling the drive with random characters, as opposed to zeroes, but the effect is the same.
A zero filled hard drive is an empty drive, making it impossible (or as close to impossible as it can be) for anybody to retrieve your data. If you’re wondering whether this is necessary, here’s an example scenario.
You sell a second-hand PC, formatting the drive in the process, but only choosing to perform a “quick” format. The purchaser runs data recovery on the hard drive, and in the process, acquires your family photos, plain-text passwords, important identity documents, and more.
If you zero fill a hard drive, you eliminate this risk entirely. While it may take a few hours to complete, it can save you significant problems in the future.
Creating a Linux Live Environment
Wiping a hard drive, by design, means that you won’t have an operating system left to run. With that in mind, you’ll need to use a Linux live DVD or USB to allow you to zero fill a hard drive.
These are portable Linux environments that allow you to test distributions out before installing them, but we’ll be using them for a slightly different purpose. Almost every Linux distribution (and supplied Live CD/USB environments) includes the software you need to zero fill a hard drive.
Alternatively, you could connect your hard drive to another PC running Linux, although using a Linux live environment prevents you from accidentally wiping the wrong drive.
You can use the pre-built Linux live environments that common distros like Ubuntu or Debian offer, or create your own using the Linux Live USB creator. For this guide, we’ll be using the Linux live environment of one of the most popular Linux distributions – Ubuntu.
- On another PC, or before you wipe your drive, head to the Ubuntu website and download the ISO file containing the latest desktop version. This can be either the latest release or the Long Term Support release.
- Once downloaded, you’ll need to copy the contents of your ISO file to a DVD or USB drive. If you’re using a USB drive, download and install balenaEtcher to allow you to do this on Linux, macOS, or Windows. The rest of this section will assume you’re using a USB drive for your Ubuntu live environment.
- Open balenaEtcher and click Select Image, selecting the Ubuntu ISO in the process. Click Select Target and select your USB drive. Once both are selected, click Flash to begin copying the Ubuntu ISO files to your drive.
- Once balenaEtcher has finished copying the files to your USB drive, safely remove the drive, then restart your PC. At the loading screen for Ubuntu, select Try Ubuntu Without Installing.
This will boot the Ubuntu live environment, ready for you to begin zeroing your hard drive.
Using shred to Zero Fill a Hard Drive in Linux
The shred command on Linux is a specialist command that will securely erase your drive. Once your Linux live environment has booted up (or once you’ve switched to a separate Linux installation), you can run this command from the terminal to begin.
First, you’ll need to identify the correct hard drive to wipe. Open a terminal window (press Ctrl+Alt+T on your keyboard) and type sudo fdisk -l tol list all of the attached storage devices. Locate your hard drive, taking note of the device label (for example, /dev/sda).
Next, you’ll need to run the shred command. You can customize shred to perform multiple passes, meaning it will zero fill your drive multiple times.
Type sudo shred -n 2 -z -v /dev/sda, where -n is the number of passes, -z will zero your drive, and -v will display the progress of shred as it works.
Be sure to use the correct drive label, replacing /dev/sda with your own. There are no second chances!
SSD owners should use fewer passes, especially if you want to reuse the drive. If that’s the case, set the -n flag to 1, using the command sudo shred -n 1 -z -v /dev/sda and replacing /dev/sda with the correct device label.
Once you’re ready to begin, hit enter to start the process.
It will take some time for the shred command to zero your hard drive, especially if you’re running multiple passes. The larger the drive, the longer the length of time it will take for the process to complete. It will also depend on the system resources available on your PC, as well as your hard drive speed.
Once shred finishes performing a zero fill format on your drive, it will be empty—period. You can then use it again or dispose of it, depending on your own needs.
Erase or Destroy Surplus Hard Drives
If you haven’t got a plan in mind for your unused storage, you need one. Whether you zero fill or drill, knowing how to safely destroy a hard drive can give you peace of mind, ensuring your data is safe from being stolen by others.
It’s pretty difficult to retrieve files from a damaged or destroyed hard drive, but you can certainly try. You can attempt to extract files from a dead hard drive if it fails unexpectedly, although it’s always better to backup your most important files instead.