Wipe free spaces of a partition.

If none of the more specific forums is the right place to ask

Re: Wipe free spaces of a partition.

Postby hack3rcon » 2019-02-02 11:43

dilberts_left_nut wrote:
hack3rcon wrote:System become slow.
Well, of course. Continuously writing zeros as fast as it can is an I/O intensive process.
This command just fill free spaces? For example, if I run it for "/home" then my files in "home" directory will be safe?
Yes.


Thank you.
hack3rcon
 
Posts: 105
Joined: 2015-02-16 09:54

Re: Wipe free spaces of a partition.

Postby GarryRicketson » 2019-02-02 13:45

Is the "dd" command is unrecoverable?
Most say :https://security.stackexchange.com/questions/90942/how-to-make-data-in-hard-disk-unrecoverable-on-linux
It depends what level of "unrecoverable" you are going for. ... your data from a live-boot OS, then things like shred , dd ---snip---

In a nut shell, it would also depend on who was trying to recover it and what technology or tools they have.
from: https://www.marksanborn.net/howto/wiping-a-hard-drive-with-dd/
So, in order to make deleted data unrecoverable we must write over it.
Wiping the Drive

Using dd to write over your entire drive with 0s:

dd if=/dev/zero of=/dev/hda

This would effectively write over the entire drive with ascii code 0x00 characters.

At this point the chances for recovering any data would be almost hopeless to most data recovering techniques.

All though this is referring to a entire drive, the same can be applied or said about a partition, or directory, ...
This is the main reason it is recommended to use extreme caution when using the dd command, be sure you only zero the area you want to wipe, and only write over the correct area. All though some say repeating the process a few times makes it even more unrecoverable, I don't think it is necessary, Kind of like over kill, even though the first bullet killed the target, some people keep firing over and over just to be more sure.
If it is really critical,probably best to completely destroy the drive, I mean like break it into tiny pieces with a hammer, and then melt it in a furnace,...
from: https://ask.fedoraproject.org/en/question/108481/fedora-26-how-to-wipe-free-disk-space-and-make-it-unrecoverable/Afterwards remove the file by executing : rm -f zerofillfile

Depending on how sensitive the deleted data was, consider to repeat it multiple times.
User avatar
GarryRicketson
 
Posts: 5300
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Wipe free spaces of a partition.

Postby hack3rcon » 2019-02-03 06:35

GarryRicketson wrote:Is the "dd" command is unrecoverable?
Most say :https://security.stackexchange.com/questions/90942/how-to-make-data-in-hard-disk-unrecoverable-on-linux
It depends what level of "unrecoverable" you are going for. ... your data from a live-boot OS, then things like shred , dd ---snip---

In a nut shell, it would also depend on who was trying to recover it and what technology or tools they have.
from: https://www.marksanborn.net/howto/wiping-a-hard-drive-with-dd/
So, in order to make deleted data unrecoverable we must write over it.
Wiping the Drive

Using dd to write over your entire drive with 0s:

dd if=/dev/zero of=/dev/hda

This would effectively write over the entire drive with ascii code 0x00 characters.

At this point the chances for recovering any data would be almost hopeless to most data recovering techniques.

All though this is referring to a entire drive, the same can be applied or said about a partition, or directory, ...
This is the main reason it is recommended to use extreme caution when using the dd command, be sure you only zero the area you want to wipe, and only write over the correct area. All though some say repeating the process a few times makes it even more unrecoverable, I don't think it is necessary, Kind of like over kill, even though the first bullet killed the target, some people keep firing over and over just to be more sure.
If it is really critical,probably best to completely destroy the drive, I mean like break it into tiny pieces with a hammer, and then melt it in a furnace,...
from: https://ask.fedoraproject.org/en/question/108481/fedora-26-how-to-wipe-free-disk-space-and-make-it-unrecoverable/Afterwards remove the file by executing : rm -f zerofillfile

Depending on how sensitive the deleted data was, consider to repeat it multiple times.

Some tools can recover the data that destroyed by "dd" ?
I guess my command can't working properly:
Code: Select all
$ lsblk /dev/sdb
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb      8:16   0 465.8G  0 disk
├─sdb1   8:17   0   200G  0 part /mnt/c
└─sdb2   8:18   0 265.8G  0 part /mnt/d

$ sudo dd if=/dev/zero |pv| dd of=/mnt/c/file;
1647831304+0 records in/s] [                                   <=>           ]
1647831303+0 records out
843689627136 bytes (844 GB) copied, 64564.8 s, 13.1 MB/s

As you see, the "sdb1" partition size is "200G" but "dd" did "844 GB" and I canceled it manually.
hack3rcon
 
Posts: 105
Joined: 2015-02-16 09:54

Re: Wipe free spaces of a partition.

Postby p.H » 2019-02-03 09:54

hack3rcon wrote:Some tools can recover the data that destroyed by "dd" ?

Short answer : no.
But dd may not destroy all the data that you would like to destroy.

Note : sudo is useless in your command. it applies only to the first dd command but root privilege is not needed to read /dev/zero.
p.H
 
Posts: 772
Joined: 2017-09-17 07:12

Re: Wipe free spaces of a partition.

Postby hack3rcon » 2019-02-03 10:48

p.H wrote:
hack3rcon wrote:Some tools can recover the data that destroyed by "dd" ?

Short answer : no.
But dd may not destroy all the data that you would like to destroy.

Note : sudo is useless in your command. it applies only to the first dd command but root privilege is not needed to read /dev/zero.

Why my "dd" command copied 844 GB?
hack3rcon
 
Posts: 105
Joined: 2015-02-16 09:54

Re: Wipe free spaces of a partition.

Postby p.H » 2019-02-03 12:46

Maybe a side effect of pv ?
The transfer speed is also suspiciously low for a hard drive.
Did it create the file and filled the filesystem ?
p.H
 
Posts: 772
Joined: 2017-09-17 07:12

Re: Wipe free spaces of a partition.

Postby hack3rcon » 2019-02-04 06:03

p.H wrote:Maybe a side effect of pv ?
The transfer speed is also suspiciously low for a hard drive.
Did it create the file and filled the filesystem ?

Yes, it is.
hack3rcon
 
Posts: 105
Joined: 2015-02-16 09:54

Previous

Return to General Questions

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable