How to Securely Erase Data From Your Phone or Laptop
Quick formatting the hard drive or a doing a factory reset is often not sufficient, because the data can then be recovered pretty easily. We'll explain how to do it right.
[This post has been completely updated and republished several times since its initial publication in 2016.]
Do you have a new smartphone, tablet or laptop and don’t know what to do with your old device? Do you want to keep it as a replacement, give it to family or friends or sell it? To prevent the new owner from accessing your data such as private photos and videos or confidential documents, you should always delete it – so that it cannot be easily recovered.
On Windows and Mac, deleted files are moved to the Recycle Bin/Trash folder by default so that they can be recovered quickly if necessary. But even if you empty the Recycle Bin/Trash folder, the files remain on your hard drive. To keep the deletion time as short as possible, the operating system simply removes the path to a file so that it is no longer displayed in the Explorer or Finder. But the deleted information can very easily be recovered with a rescue software. To make this more difficult, the hard drive sectors in which the deleted file was located must be overwritten with new data.
The methods for securely erasing data vary depending on the operating system. Here’s what to do:
All Windows versions as of Windows 7 come with the Cipher tool, which can be run from the command line. Press Windows + R and enter cmd to open the command line. Then enter cipher /w:[folder or file name]
to delete the corresponding folder or file and overwrite it several times. You can also use this method to delete a partition (by specifying the drive letter, for example C:).
However, cipher is only suitable to a limited extent for securely erasing entire hard drives. For private users, free tools such as CCleaner, DBAN (Darik’s Boot and Nuke), Parted Magic, Secure Eraser or BlankAndSecure are recommended because they are easier to use thanks to a graphical user interface. They delete selected files or all files on a hard drive and overwrite the freed disk space, making it virtually impossible to recover the data.
Some of the tools run directly from CD/DVD or a bootable USB stick without installation and also support the complete erasure of Solid State Drives (SSDs) with the Secure Erase function. Secure Erase ensures that the SSD controller resets all storage cells as empty and thus completely removes any data that eventually remained after formatting or deletion.
Many laptops offer an option to reset the device to factory settings. This replaces the current system with a factory image, which is usually stored in a separate recovery partition. However, there is no guarantee that all data will be deleted without a trace during this process. If you want to be on the safe side before selling or passing on your device, you should delete all personal data manually.
In macOS, you can use a terminal command to delete data in a way that it is no longer recoverable. Until “OS X 10.11 El Capitan” secure erasure worked with the command srm, which disappeared with macOS 10.12 Sierra. Since this macOS release the function is part of the rm command.
Single files can be deleted with the -P option. For example, the command rm -P desktop/test.txt
removes the text file “test.txt” from the desktop and overwrites the corresponding memory sections. The additional option -R is used to delete folders and subfolders (including content). The complete command looks like this: rm -RP desktop/[folder name]
But note: The terminal command deletes files and folders without further notice, so use it with caution. To avoid data loss due to typos, it is recommended to first enter rm -RP
(with a space at the end) in the terminal, then switch to the Finder and drag the folder you want to delete into the terminal. This automatically adds the path and folder name to the command. Finally check the inputs again and confirm with Enter.
For general information on what you should do before you sell or give away your Mac, read Apple’s support article at https://support.apple.com/en-us/HT201065.
For smartphones and tablets with Android OS, a factory reset alone does not ensure that all personal data is really deleted. On Android, a factory reset or wipe only removes the links to the files – i.e. the table of contents of the internal memory – but does not necessarily overwrite the data, so that it can be restored with some effort and a recovery tool.
Therefore, users should encrypt their data on the device before resetting it. The encryption process is usually initiated in the “Security” settings and may take some time, which is why the mobile device should be fully charged or connected to the power supply. After the subsequent factory reset, during which all settings, downloads, media files, system data, app data, and user data are deleted, we recommend using an app to overwrite the freed memory with junk data. Alternatively, you can do this manually by copying non-critical data to your mobile device until its memory is full.
Finally, you should do another factory reset via the “Backup & reset” settings. However, you can never say with 100% certainty that all data fragments have been deleted. But at least even tech-savvy users may not be able to recover the deleted data with standard tools after applying the steps described above.
In order to avoid potential problems with the Factory Reset Protection/Device Protection that may be activated on smartphones and tablets running Android 5.1 or higher, you should also remove the associated Google Account. This will disable the FRP/Device Protection and the new owner can use the device without entering your credentials.
If you use an external memory card, it’s best not to sell or give it away with your old device. If you still want to give away your memory card, you can connect it to your PC using a card reader and securely erase it like a hard drive. Also remember to remove the SIM card from your mobile device.
Unlike Android devices, resetting an iPhone or an iPad to factory settings is usually sufficient to securely delete all user data. To do this, go to Settings > General > Reset and select Erase All Content and Settings and confirm.
Alternatively, you can erase your device remotely via iCloud on your computer. This also works if you no longer have your iPhone or iPad. Apple’s iOS devices are equipped with a security chip that automatically encrypts all stored data. When you reset the device the security key is destroyed, making all data unusable. Apple explains all necessary steps in a support article.
If you have deleted your private data irretrievably from your device, you can give it away or sell it without worrying.