en	[[!meta title="Securely deleting files"]]
pl	[[!meta title="Dateien sicher löschen und Speicherplatz bereinigen"]]

en	Tails previously included tools to *wipe* files and available disk space. We removed these tools from Tails 6.0 (February 2024), because we think that they are not reliable enough on modern storage devices, such as USB sticks and Solid-State Drives (SSDs).

en	To better protect from data recovery, use encrypted volumes, overwrite the entire device, or disintegrate it physically.

en	[[!toc levels=2]]
pl	[[!toc levels=1]]

en	Limitations of file deletion
pl	Warum sicheres Löschen verwenden?

en	See also [[!wikipedia Data_erasure desc="Wikipedia: Data Erasure"]].

en	Deleting a file does not erase its content

en	Operating systems do not actually remove the content of a file when the file is deleted, even after emptying the trash or removing the file from the command line.

en	Instead, operating systems only mark the space that was used by the deleted file as available for future files, because it is much faster to do. However, the content of the deleted file remains on the device until the operating system reuses the space for another file.

en	<div class="attack">
pl	<div class="note">

en	Simple data recovery tools can recover deleted files.

en	</div>

en	Other copies of the data might be stored elsewhere

en	Other copies of the data might exist elsewhere on the device:

en	Some applications, for example, office applications, store temporary backup versions of the file to be able to recover from failures.

en	Modern operating systems can store a *journal*, a history of recent changes to the file system, or *snapshots*, an image of the file system at a particular point in time.

en	Spare memory cells can store a hidden copy of the data

en	Flash memory devices, such as USB sticks and SSDs (Solid-State Drives), have *spare memory cells* that are used to replace broken memory cells over time. Modern hard disks also integrate small flash memories for performance and reliability.

en	Any data that was stored in the device can remain available in these spare cells.

en	These spare cells are managed directly by the device and neither the user nor the operating system can control what is stored in them.

en	Specialized data recovery companies can recover data from spare cells.

en	Mitigation techniques

en	Given the limitations described above, there is no perfect solution to file deletion.

en	To better protect from data recovery, you can use one or a combination of these mitigation techniques, depending on the sensitivity of your data and the risks.

en	Use Tails to avoid saving files
pl	Dateien sicher löschen

en	All the files that you use in Tails disappear automatically when you shut down, except the files that you choose to store in the Persistent Storage or other storage devices.

en	By making it easy to avoid saving files to storage devices in the first place, using Tails is already an important mitigation technique given the limitations of file deletion.

en	Encrypt your storage devices
pl	Sicheres Löschen von verfügbarem Speicherplatz

en	When all the data on your device is encrypted, data recovery tools can only recover encrypted data that is useless without your passphrase.

en	To better protect deleted files from data recovery, you can reformat your device and create another encryption with a different passphrase.

en	For compatibility with Tails only or with another Linux, use [[LUKS encrypted volumes|encrypted_volumes]].

en	For compatibility with Windows or macOS, use [[VeraCrypt encrypted volumes|veracrypt]].

en	Take into account that you could be forced or tricked to give out your passphrase.

en	Overwrite the entire device
pl	Sicheres Löschen von verfügbarem Speicherplatz

en	To better protect deleted files from data recovery, you can also reformat and overwrite the entire device with zeroes.

en	Even if some data could still be recovered from [[spare memory cells|secure_deletion#spare]], overwriting the entire device is especially important if the device is not encrypted.

en	To do so:

en	Open the *Disks* utility.

en	All the current storage devices are listed in the left pane.

en	Plug in the device that you want to reformat and overwrite.

en	A new device appears in the list of devices. Click on it.

en	[[!img encrypted_volumes/storage_devices_after.png link="no" alt=""]]

en	Check that the brand and size of the device in the right pane corresponds to your device.

en	Click on the [[!img lib/view-more.png alt="Drive Options" class="symbolic" link="no"]] button in the title bar and choose **Format Disk**.

en	In the **Format Disk** dialog:

en	Choose **Overwrite existing data with zeroes (Slow)** in the **Erase** menu.

en	<div class="caution">

en	Overwriting existing data does not erase all data on flash memories, such as USB sticks and SSDs (Solid-State Drives).

en	See the [[limitations of file deletion|doc/encryption_and_privacy/secure_deletion#spare]].

en	</div>

en	Choose **Compatible with all systems and devices (MBR/DOS)** in the **Partitioning** menu.

en	Click **Format**.

en	In the confirmation dialog, make sure that the device is correct.

en	Click **Format** to confirm.

en	Physically destroy the device

en	As a last resort, physically destroying the device gives the strongest guarantee against data recovery.

en	It is unreliable to break the device into a few pieces or burn it with wood fire.

en	For top secret documents, the National Security Agency ([[!wikipedia NSA]]) of the USA recommends disintegration into particles of 2 mm. This can be achieved using a [good quality household blender](https://commons.erau.edu/jdfsl/vol16/iss2/1/).