Sometimes you can need to delete or format a hard drive for some operations. The most common use case for completely and irrevocably wiping a device will be when the device is going to be given away or sold as this is really important for data protection. There are some commands which can help you to do these operations in Linux. How do you print screen.
You can wipe your Mac's startup drive using the Disk Utility, but you need to boot your computer in a special way first. With your Mac turned off, power it on while holding the Command + R keys.
This article shows 4 commands to wipe hard disks or partitions data on your Linux system
1) dd
- With this hard disk eraser, you can wipe all data on by filling disk sector by sector, making files unrecoverable. Besides, it is a free partition manager program which is able to resize, format, clone.
- Erase a CD/DVD disc in Windows 10. As mentioned before, if you want to format a used CD-RW/DVD-RW, you need to erase the data already on the disc first. To get this job done, you can use the Windows 10 operating system's formatting tools. In case some users don't know how to erase a DVD disk, here we list the detailed steps.
The dd command can help you to copy and convert a file. The command can overwrite the whole disk with zeros and is considerably faster than generating gigabytes of random data. It offers some operands that you can use to specify what kind of formatting you want. The syntax is:
Only superuser can run this command because you can face a big data loss due to its improper usage.
You can wipe a disk is done by writing new data over every single bit. To further complicate the recovering process we will write over the entire drive with random data.
2) shred
The shred command is used to overwrite the specified files repeatedly and make it difficult for software to recover the data. The syntax is as below
The command also overwrites data in a file or a whole device with random bits, making it nearly impossible to recover. This command permanently erases the data. The command has some options which can be used to wipe a disk as:
- -f changes permissions to allow writing if needed
- -n(iterations=N) overwrites N times instead of the default (3)
- -s (size=N) specifies the number of bytestoshred
- -u truncates and removes files after overwriting
- -v shows verbose information about the progress
- -x does not round file sizes up to the next full block
- -z adds a final overwrite with zeros to hide shredding
- -u removes the file after overwriting
So, to wipe the partition you can use
It is possible to use shred with random data as below
3) wipe
The wipe command can be used to securely erase files from magnetic media. You can use the wipe command in order to wipe data on a disk. The wipe command has the command below
The command is not present by default, you need to install it.
On Ubuntu 16.04/18.04
On Centos 7, you need first to download the rpmforge
Install it
Then, install the wipe command
You can wipe a partition as below:
4) scrub
The scrub command can be used to overwrite data using patterns. The command is not available by default, you should need to install it on your Linux system. The syntax is
To scrub hard disk, you can do as below
How To Wipe A Disk Windows 10
To scrub hard disk, you can do as below
How To Wipe A Disk Windows 10
How To Wipe A Disk Drive Clean
Scrub uses some methods to operate on disks. You can use the dod method to wipe disks.
Wiping a drive is dangerous because you can lose data permanently. You have to be sure to choose the right disk. Additionally, depending on how worried you are about someone taking the data, it can be difficult to ensure that some drives are truly non-recoverable.