3 ms·
> There’s also `sudo cat /dev/null > /dev/nvme0` That doesn't work. The redirection occurs in the current shell which unless it's already root won't have permi
by js2 2y ago
> There’s also `sudo cat /dev/null > /dev/nvme0`
That doesn't work. The redirection occurs in the current shell which unless it's already root won't have permission to write to /dev/nvme0. At the same time, running cat as root isn't needed to access /dev/null.
You want something like `sudo sh -c 'cat /dev/null > /dev/nvme0'`. You could also use a program such as `dd` that doesn't require redirection.
Edit: as pointed out below, yes, /dev/null is also the wrong device. It returns EOF on read.
- desdenova 2y agoAnd they probably want /dev/zero, that actually produces a stream to overwrite the disk, which /dev/null doesn't. Anyway, encrypting the drive and destroying the key would be easier.