
You can completely erase data from your disk with the wipe command. Running this command gives us high confidence that restoring the data previously saved on it is virtually impossible once the disk has been erased in this manner. sudo shred -v -n 1 -random-source=/dev/urandom -z /dev/sdb Linux’s special file /dev/urandom provides an interface to the kernel’s random number generator.įinally, we’ll use the -z ( -zero) option to overwrite everything thus far with 0. Of course, we can improve the reliability of wiping data from disk by adding a few more options to the shred command.įirst, we’ll specify that the disk is overwritten with randomly generated data by using the -random-source=/dev/urandom option. Fortunately, we can specify shred to perform only one loop using the -n ( -iterations=) option.

However, the time required to complete these three subsequent cycles will be lengthy. We’ve included the -v ( -verbose) option to see the disk wipe operation in detail. It uses three passes by default, writing pseudo-random data to the device during each run.įor example, if you want to erase a device that is present as /dev/sdb on your Linux system, the command would be as follows: sudo shred -v /dev/sdb That is why it is frequently used to erase data securely.īecause shred is part of the coreutils package in Linux, you most likely have the command available by default on your system. The command helps in overwriting the data several times, such that it can only be recovered with extreme difficulty, if at all, using specialized hardware. We start with the shred command because it is one of the best ways to protect your private data on a Linux system. However, wiping the disk with one of the following commands, shred, dd, or wipe, assures that the information you erased is unrecoverable. As a result, with a high probability, a considerable portion of this data can be recovered using specific techniques. Using the rm command or a file manager to delete files just removes the pointer to the filesystem.


The truth, however, is slightly different. Many users probably believe that deleting their data using the file manager or the rm command ensures security. The most typical reason for completely and irreversibly deleting a device is when, for example, it is to be given away or sold. Sometimes we have to erase all the information from our disk in a way that ensures it is impossible to recover. This article shows you the three best ways to completely erase data from your disk using the dd, shred and wipe command.
