Wipe free space (secure-delete)

I want to wipe the free space of some HD’s. I googled first and found some useful stackexchange info about a program called sfill, but I cannot find “secure-delete” in the opensuse repos.

So how can I overwrite all the free space on a drive with zeroes?

There’s no guaranteed way of doing this. With journaled file systems, there might be data in the journal. With SSDs, the sectors are periodically relocated to reduce the wear-and-tear problem.

You can zero a partition with:

# dd if=/dev/zero of=/dev/sdaN

where “/dev/sdaN” is the partition. But that is not guaranteed either, because of the problems mentioned above.

For just free space, you can copy “/dev/zero” to a new file. When the copy ends because the file system is full, delete that file. That probably doesn’t work as expected with “btrfs”.

My method: I use encrypted partitions. That way, I don’t worry about it. When the disk drive goes to the electronics graveyard, anyone trying to get data will find encryption.

Thank you, I will try that. The drive in question is an external HD, which is of file system type ntfs if that matters.

Something like LUKS and dm-crypt? Care to elaborate on your process?

Yes. I use two partitions. One for “/boot” and one for an encrypted LVM. On a UEFI box, there is also an EFI partition. And on a couple of boxes I have an additional encrypted partition that I mount at “/shared”.

The EFI and “/boot” partitions are not encrypted. But they don’t have any sensitive date, so I’m not concerned with them. Windows is also not encrypted, but I try to put most of the sensitive data on a shared samba drive (that’s the encrypted “/shared” partition in opensuse). I don’t use Windows enough to consider their “Bitlocker” encryption.