如果您要出售帶有硬盤驅動器,硬盤驅動器的舊Mac,或者只是對已刪除的數據非常偏執,它很熟悉或應該熟悉光盤實用程序中的“擦除”選項卡中的“可用空間”按鈕(在此處找到應用文件夾 - >實用程序)。
編者註:該終端建議最初是在2009年3月執行的,僅對機械硬盤驅動器有用,而不是最新Mac中的SSD。
單擊此按鈕時,會提供三個選項,以安全地刪除硬盤上的自由空間:使用零(快速且相對安全)寫有關自由空間,寫3次(更安全,更安全,更安全,非常慢) ,或寫出七次關於自由空間的文章(極慢)。
每當出售帶有硬盤驅動器的舊機器時,都會使用此功能。形成單元並安裝新的MacOS副本,然後使用光盤的效用來刪除自由空間(通常只用零僅一次編寫一次)。這給了我很好的安全感,因為需要一組專業的專業人員(甚至可能是特殊的硬件)才能恢復我的任何已刪除數據。
使用終端安全保護單元
如果您想從終端執行此操作,會發生什麼?在終端,一個名為的程序diskutil
它提供了MacOS磁盤實用程序的大多數功能。
(請注意,與許多終端命令一樣,如果您在以下說明中犯錯誤,可能會發生真正的壞事。謹慎行事,並確保在嘗試以下任何人之前更新備份副本)。
知道diskutil
詳細寫man diskutil
在終端指示器中。之內man
頁面,您將找到有關如何安全地刪除專輯的自由空間的解釋diskutil
:
secureErase [freespace] level device Erase, using a "secure" (but see the NOTE below) method, either a whole-disk (including all of its partitions if partitioned), or, only the free space (not in use for files) on a currently-mounted volume. Secure erasing makes it harder to recover data using "file recovery" software. Erasing a whole-disk will leave it useless until it is partitioned again. Erasing freespace on a volume will leave your files intact, indeed, from an end-user perspective, it will appear unchanged, with the exception that it will have attempted to make it impossible to recover deleted files. If you need to erase all contents of a partition but not its hosting whole-disk, use the zeroDisk or randomDisk verbs. Ownership of the affected disk is required. Level should be one of the following: o 0 - Single-pass zero fill erase. o 1 - Single-pass random fill erase. o 2 - Seven-pass erase, consisting of zero fills and all-ones fills plus a final random fill. o 3 - Gutmann algorithm 35-pass erase. o 4 - Three-pass erase, consisting of two random fills plus a final zero fill. NOTE: This kind of secure erase is no longer considered safe. Modern devices have wear-leveling, block-sparing, and possibly-persistent cache hardware, which cannot be completely erased by these commands. The modern solution for quickly and securely erasing your data is encryption. Strongly-encrypted data can be instantly "erased" by destroying (or losing) the key (password), because this renders your data irretrievable in practical terms. Consider using APFS encryption (FileVault).
但是您如何找出要列出的內容device
什麼是試圖安全擦除的自由空間的專輯(或分區)?diskutil
您還可以提供該信息。僅使用diskutil list
查看所有單元和分區的列表。最後,您會看到一個IDENTIFIER
柱子;該列包含標識符diskutil
需要。這是一個例子list
在我的機器上出發:
IDG
您只需要知道最後一個事實才能從命令行中刪除自由空間。在UNIX中,所有設備都作為存檔系統樹的一部分出現,在MacOS中,所有設備都列在/dev
目錄。所以如果我想使用diskutil
消除我的自由空間Apple_HFS Untitled
在我的外部磁盤上,使用一個step方法,將看到最終命令:
diskutil secureErase freespace 1 /dev/disk2s1
警告!es至關重要您包括freespace
該命令的一部分。如果您不這樣做diskutil
很高興將開始安全地刪除整張專輯,而不僅僅是自由空間。是的,這真的很糟糕,尤其是因為它將安全擦除,這意味著您不可能恢復數據。
前綜合霍伊(Rob Griffiths)的前大四學生創立了Mac OS X提示。現在他是一個儀式大師許多技巧的軟件。