For security reasons I want to wipe the unused disk space on my storage media. How do I do that? In other words, I want my unused disk space to be replaced with zeroes.
Asked
Active
Viewed 513 times
1
-
There are a ton of ways to do this sort of thing, and a pretty good start is already located [here](https://superuser.com/questions/19326/how-to-wipe-free-disk-space-in-linux). I'd say pick the method that suits your needs best. – KGIII Nov 06 '20 at 20:37
-
Please add hardware (disk) info - HDD / SSD? – Vlastimil Burián Nov 06 '20 at 20:38
-
1Duplicate of https://unix.stackexchange.com/questions/44234/clear-unused-space-with-zeros-ext3-ext4/44236#44236 ? – Jeff Schaller Nov 06 '20 at 20:55
-
1Also https://unix.stackexchange.com/q/44725/117549 for btrfs – Jeff Schaller Nov 06 '20 at 20:57
-
You're right. What would be the best method for a SSD though? – Sir Muffington Nov 07 '20 at 11:48
-
Does this answer your question? [Clear unused space with zeros (ext3,ext4)](https://unix.stackexchange.com/questions/44234/clear-unused-space-with-zeros-ext3-ext4) – AdminBee Nov 13 '20 at 09:36
1 Answers
3
You can use the Unix utility called zerofree to do exactly that.
Sources:
Vlastimil Burián
- 27,586
- 56
- 179
- 309
Sir Muffington
- 739
- 2
- 7
- 21