I was just wondering if I could run the following command on my mounted OS partition i.e. the one I booted from:
sudo dd if=/dev/zero of=/dev/sda bs=1M
I can't really experiment with this because you only get to run it once.
|show 1 more comment|
Yes, there's absolutely nothing stopping you from running that command.
However it is entirely possible that in the process of running it, the system will become unstable and you'll get a kernel panic. I can't think of anything that would cause that to happen, and I've done this without running into said issue, but it is theoretically possible (due to memory-mapped files).
Note though that as soon as the command completes, and you're dropped back to a shell, you won't be able to do a single thing.
Another possible cause of this failing would be if you have a watchdog running (if you don't know what a watchdog is, you probably don't have one). The watchdog is very likely to die, and when it does the system will reboot.
Of course you can't. Sooner or later you'll get a message saying
But if you're already looking for best ways to erase your data without physically damaging the medium, you might want to look into the SECURE ERASE command set, supported by hard drives since 2004 or so.
Yes - that will work. once running the dd-command is a running process in memory.
I once migrated a running linux VM onto other hardware and forgot to switch the underlying harddisk (so I had running processes who have lost their storage completely) - it ran about 10 minutes before crashing.