Wipe free spaces of a partition.

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

Wipe free spaces of a partition.

Postby hack3rcon » 2019-01-30 17:11

Hello,
How can I wipe the free spaces of a partition and not whole of it? Any tool exist?

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

Re: Wipe free spaces of a partition.

Postby dilberts_left_nut » 2019-01-30 18:41

Code: Select all
dd if=/dev/zero of=/mountpoint/file; rm /mountpoint/file
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4936
Joined: 2009-10-05 07:54
Location: enzed

Re: Wipe free spaces of a partition.

Postby p.H » 2019-01-30 21:35

hack3rcon wrote:How can I wipe the free spaces of a partition and not whole of it?

It depends on the partition contents type (filesystem, LVM...).
p.H
 
Posts: 772
Joined: 2017-09-17 07:12

Re: Wipe free spaces of a partition.

Postby hack3rcon » 2019-02-01 05:53

I guess it just fill the free spaces with a file and then remove it. It may cause some problems.
hack3rcon
 
Posts: 105
Joined: 2015-02-16 09:54

Re: Wipe free spaces of a partition.

Postby Ardouos » 2019-02-01 09:13

dilberts_left_nut wrote:
Code: Select all
dd if=/dev/zero of=/mountpoint/file; rm /mountpoint/file

This is the most effective solution, just ensure that you have the correct names and locations (and backup your data beforehand).
User avatar
Ardouos
 
Posts: 1025
Joined: 2013-11-03 00:30
Location: Elicoor II

Re: Wipe free spaces of a partition.

Postby p.H » 2019-02-01 18:25

hack3rcon wrote:I guess it just fill the free spaces with a file and then remove it. It may cause some problems.

Yes and yes.
What is your actual goal ?
p.H
 
Posts: 772
Joined: 2017-09-17 07:12

Re: Wipe free spaces of a partition.

Postby hack3rcon » 2019-02-01 20:06

p.H wrote:
hack3rcon wrote:I guess it just fill the free spaces with a file and then remove it. It may cause some problems.

Yes and yes.
What is your actual goal ?

I like to make free spaces unrecoverable.
hack3rcon
 
Posts: 105
Joined: 2015-02-16 09:54

Re: Wipe free spaces of a partition.

Postby GarryRicketson » 2019-02-01 21:03

With all due respect, did the OP do any kind of search on this before asking ?
I was going to answer , back before the first reply was made, my answer was the same, but worded different, and did not include the example,
dilberts_left_nut wrote:
Code: Select all
dd if=/dev/zero of=/mountpoint/file; rm /mountpoint/file

No special tools, etc needed, the dd command is all one needs, and is very effective, it comes with almost any normal Linux or Debian default installation, ...since it is a relatively
simple , common sort of task, and the dd command is available in any linux distro, I figured for some reason this is not good enough for the OP. So, I did some searches, used the key words,:
Code: Select all
Toolls to wipe free spaces of a partition on a Debian system


To my surprise there are a few so called "tools", or aps also available, but also, since it was so easy to find them, but I have no first hand experience with any of them, only the dd command, which also was in the results, and with some various examples.
Well, when I came back, I saw that a good answer was posted, To use the 'dd' command,
I kind of figured that should solve or answer the question.
Guess I was wrong, but the OP should tell us which of the other tools they have tried and why the 'dd' is not good enough, this way we will know which utilities/tools they tried, and then , if there is one in the results that they did not yet try, I will be happy to share a link to it, however we really need to know which ones have been tried or at least looked at.
Each tool has it's own manual and tutorials, but if we know which tool or utility the OP decides to use, maybe then some one can give more details on using it, if the OP does not understand the guides available. The dd command also has a manual 'man dd', but there is more detailed tutorials available, I agree the Linux manual, that comes with dd command is not very complete, ....
User avatar
GarryRicketson
 
Posts: 5300
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Wipe free spaces of a partition.

Postby dilberts_left_nut » 2019-02-02 00:46

To be fair, man dd describes exactly the usage syntax and options of the dd tool.
It's application in a greater task is beyond the scope of a man page and there are numerous documented procedures on the net utilising it in various ways.

You wouldn't expect the instructions for a hammer to describe how to build a house would you?
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4936
Joined: 2009-10-05 07:54
Location: enzed

Re: Wipe free spaces of a partition.

Postby hack3rcon » 2019-02-02 05:03

GarryRicketson wrote:With all due respect, did the OP do any kind of search on this before asking ?
I was going to answer , back before the first reply was made, my answer was the same, but worded different, and did not include the example,
dilberts_left_nut wrote:
Code: Select all
dd if=/dev/zero of=/mountpoint/file; rm /mountpoint/file

No special tools, etc needed, the dd command is all one needs, and is very effective, it comes with almost any normal Linux or Debian default installation, ...since it is a relatively
simple , common sort of task, and the dd command is available in any linux distro, I figured for some reason this is not good enough for the OP. So, I did some searches, used the key words,:
Code: Select all
Toolls to wipe free spaces of a partition on a Debian system


To my surprise there are a few so called "tools", or aps also available, but also, since it was so easy to find them, but I have no first hand experience with any of them, only the dd command, which also was in the results, and with some various examples.
Well, when I came back, I saw that a good answer was posted, To use the 'dd' command,
I kind of figured that should solve or answer the question.
Guess I was wrong, but the OP should tell us which of the other tools they have tried and why the 'dd' is not good enough, this way we will know which utilities/tools they tried, and then , if there is one in the results that they did not yet try, I will be happy to share a link to it, however we really need to know which ones have been tried or at least looked at.
Each tool has it's own manual and tutorials, but if we know which tool or utility the OP decides to use, maybe then some one can give more details on using it, if the OP does not understand the guides available. The dd command also has a manual 'man dd', but there is more detailed tutorials available, I agree the Linux manual, that comes with dd command is not very complete, ....


I found some tools like "Scrub" but it wipe whole partition. Are you sure "dd" command is unrecoverable? Some tools like "Scrub" have special methods for wipe a partition. I found https://linoxide.com/linux-command/commands-wipe-disk-linux/.
hack3rcon
 
Posts: 105
Joined: 2015-02-16 09:54

Re: Wipe free spaces of a partition.

Postby hack3rcon » 2019-02-02 05:06

dilberts_left_nut wrote:To be fair, man dd describes exactly the usage syntax and options of the dd tool.
It's application in a greater task is beyond the scope of a man page and there are numerous documented procedures on the net utilising it in various ways.

You wouldn't expect the instructions for a hammer to describe how to build a house would you?


If you run "dd" on a server then it causes some performance problem.
hack3rcon
 
Posts: 105
Joined: 2015-02-16 09:54

Re: Wipe free spaces of a partition.

Postby dilberts_left_nut » 2019-02-02 05:08

What performance problem?
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4936
Joined: 2009-10-05 07:54
Location: enzed

Re: Wipe free spaces of a partition.

Postby hack3rcon » 2019-02-02 05:37

dilberts_left_nut wrote:What performance problem?


System become slow.
This command just fill free spaces? For example, if I run it for "/home" then my files in "home" directory will be safe?
hack3rcon
 
Posts: 105
Joined: 2015-02-16 09:54

Re: Wipe free spaces of a partition.

Postby dilberts_left_nut » 2019-02-02 07:00

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.
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4936
Joined: 2009-10-05 07:54
Location: enzed

Re: Wipe free spaces of a partition.

Postby p.H » 2019-02-02 07:40

hack3rcon wrote:make free spaces unrecoverable

You are just paraphrasing. What do you really mean ?
p.H
 
Posts: 772
Joined: 2017-09-17 07:12

Next

Return to General Questions

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable