Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Wipe free spaces of a partition.
Wipe free spaces of a partition.
Hello,
How can I wipe the free spaces of a partition and not whole of it? Any tool exist?
Thank you.
How can I wipe the free spaces of a partition and not whole of it? Any tool exist?
Thank you.
- dilberts_left_nut
- Administrator
- Posts: 5346
- Joined: 2009-10-05 07:54
- Location: enzed
- Has thanked: 13 times
- Been thanked: 66 times
Re: Wipe free spaces of a partition.
Code: Select all
dd if=/dev/zero of=/mountpoint/file; rm /mountpoint/file
AdrianTM wrote:There's no hacker in my grandma...
Re: Wipe free spaces of a partition.
I guess it just fill the free spaces with a file and then remove it. It may cause some problems.
- Ardouos
- Posts: 1077
- Joined: 2013-11-03 00:30
- Location: Elicoor II
- Has thanked: 1 time
- Been thanked: 4 times
Re: Wipe free spaces of a partition.
This is the most effective solution, just ensure that you have the correct names and locations (and backup your data beforehand).dilberts_left_nut wrote:Code: Select all
dd if=/dev/zero of=/mountpoint/file; rm /mountpoint/file
There is only one Debian | Do not break Debian | Stability and Debian | Backports
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀
Re: Wipe free spaces of a partition.
I like to make free spaces unrecoverable.p.H wrote:Yes and yes.hack3rcon wrote:I guess it just fill the free spaces with a file and then remove it. It may cause some problems.
What is your actual goal ?
- GarryRicketson
- Posts: 5644
- Joined: 2015-01-20 22:16
- Location: Durango, Mexico
Re: Wipe free spaces of a partition.
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,
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,:
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 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,
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 relativelydilberts_left_nut wrote:Code: Select all
dd if=/dev/zero of=/mountpoint/file; rm /mountpoint/file
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
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, ....
"What we expect you have already Done"
==========
Old Website
======================
For the Birds
==================
What Does a Parrot Know About PTSD?
==========
Old Website
======================
For the Birds
==================
What Does a Parrot Know About PTSD?
- dilberts_left_nut
- Administrator
- Posts: 5346
- Joined: 2009-10-05 07:54
- Location: enzed
- Has thanked: 13 times
- Been thanked: 66 times
Re: Wipe free spaces of a partition.
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?
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...
Re: Wipe free spaces of a partition.
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/comm ... isk-linux/.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,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 relativelydilberts_left_nut wrote:Code: Select all
dd if=/dev/zero of=/mountpoint/file; rm /mountpoint/file
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,: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.Code: Select all
Toolls to wipe free spaces of a partition on a Debian system
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, ....
Re: Wipe free spaces of a partition.
If you run "dd" on a server then it causes some performance problem.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?
- dilberts_left_nut
- Administrator
- Posts: 5346
- Joined: 2009-10-05 07:54
- Location: enzed
- Has thanked: 13 times
- Been thanked: 66 times
Re: Wipe free spaces of a partition.
What performance problem?
AdrianTM wrote:There's no hacker in my grandma...
Re: Wipe free spaces of a partition.
System become slow.dilberts_left_nut wrote:What performance problem?
This command just fill free spaces? For example, if I run it for "/home" then my files in "home" directory will be safe?
- dilberts_left_nut
- Administrator
- Posts: 5346
- Joined: 2009-10-05 07:54
- Location: enzed
- Has thanked: 13 times
- Been thanked: 66 times
Re: Wipe free spaces of a partition.
Well, of course. Continuously writing zeros as fast as it can is an I/O intensive process.hack3rcon wrote:System become slow.
Yes.This command just fill free spaces? For example, if I run it for "/home" then my files in "home" directory will be safe?
AdrianTM wrote:There's no hacker in my grandma...
Re: Wipe free spaces of a partition.
Thank you.dilberts_left_nut wrote:Well, of course. Continuously writing zeros as fast as it can is an I/O intensive process.hack3rcon wrote:System become slow.Yes.This command just fill free spaces? For example, if I run it for "/home" then my files in "home" directory will be safe?
- GarryRicketson
- Posts: 5644
- Joined: 2015-01-20 22:16
- Location: Durango, Mexico
Re: Wipe free spaces of a partition.
Is the "dd" command is unrecoverable?
Most say :https://security.stackexchange.com/ques ... e-on-linux
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,...
Most say :https://security.stackexchange.com/ques ... e-on-linux
In a nut shell, it would also depend on who was trying to recover it and what technology or tools they have.It depends what level of "unrecoverable" you are going for. ... your data from a live-boot OS, then things like shred , dd ---snip---
All though this is referring to a entire drive, the same can be applied or said about a partition, or directory, ...from: https://www.marksanborn.net/howto/wipin ... e-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.
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/questi ... coverable/Afterwards remove the file by executing : rm -f zerofillfile
Depending on how sensitive the deleted data was, consider to repeat it multiple times.
"What we expect you have already Done"
==========
Old Website
======================
For the Birds
==================
What Does a Parrot Know About PTSD?
==========
Old Website
======================
For the Birds
==================
What Does a Parrot Know About PTSD?
Re: Wipe free spaces of a partition.
Some tools can recover the data that destroyed by "dd" ?GarryRicketson wrote:Is the "dd" command is unrecoverable?
Most say :https://security.stackexchange.com/ques ... e-on-linuxIn a nut shell, it would also depend on who was trying to recover it and what technology or tools they have.It depends what level of "unrecoverable" you are going for. ... your data from a live-boot OS, then things like shred , dd ---snip---All though this is referring to a entire drive, the same can be applied or said about a partition, or directory, ...from: https://www.marksanborn.net/howto/wipin ... e-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.
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/questi ... coverable/Afterwards remove the file by executing : rm -f zerofillfile
Depending on how sensitive the deleted data was, consider to repeat it multiple times.
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
-
- Global Moderator
- Posts: 3049
- Joined: 2017-09-17 07:12
- Has thanked: 5 times
- Been thanked: 132 times
Re: Wipe free spaces of a partition.
Short answer : no.hack3rcon wrote:Some tools can recover the data that destroyed by "dd" ?
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.
Re: Wipe free spaces of a partition.
Why my "dd" command copied 844 GB?p.H wrote:Short answer : no.hack3rcon wrote:Some tools can recover the data that destroyed by "dd" ?
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.