I put an Ubuntu ISO on a USB drive, booted from that USB on my laptop, and then called
$ cat /dev/zero | pv > /dev/sda
to try to overwrite my laptop's hard drive (
sda) with zeros.
I get the following error:
bash: /dev/sda: Permission denied
This error is raised regardless of whether I pre-pend my command with
sudo. Why am I getting this? How do I circumvent this error?
(Could it have something to do with mounting/unmounting? Full disclosure: I have already partially erased
sda, but the erasure was interrupted midway -- I'm rerunning the command to make sure it is fully erased.)
I was able to erase the hard drive using the disk utility GUI instead. But I'm still curious whether it would have been possible to do it via the command line using the method I attempted first.