How can we delete the contents of the partition without deleting the partition table.
For example, if I have few files and folders which i need to clear and remove from the partition.
Running rm -rf in the folder will allow to recover using recovery tools. Using dd with /dev/zero we will wipe the partition table
dd if=/dev/zero of=/dev/sda1
What's the best way to delete the files and write zeroes in the same memory location, so it cannot be retrieved, without formatting the partition
dd
command does not wipe the partition table; it references/dev/sda1
so it will wipe the content of the first partition. But you'd be better off either using a decent block size (512 bytes is so small these days) or even justcat /dev/zero >/dev/sda1
– Chris Davies Jul 21 '22 at 08:02/dev/sda
(without a number at the end) would wipe the partition table, as that device refers to the whole drive./dev/sda1
(with the number at the end) is an individual partition described by the partition table. – ilkkachu Jul 21 '22 at 08:47