From 17e783a5b118a69ba6d041bad0a663051549c29c Mon Sep 17 00:00:00 2001 From: RealStickman Date: Tue, 18 Oct 2022 20:43:26 +0200 Subject: [PATCH] Add command for overwriting harddisks --- pages/04.other/16.useful-commands/default.en.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pages/04.other/16.useful-commands/default.en.md b/pages/04.other/16.useful-commands/default.en.md index 86f89b3..e01f4ae 100644 --- a/pages/04.other/16.useful-commands/default.en.md +++ b/pages/04.other/16.useful-commands/default.en.md @@ -18,3 +18,11 @@ Using find with its `exec` switch one can set different permissions based on the One example would be only changing file or directory permissions. `$ find (directory) -type f -exec chmod 744 {} +` Replacing `-type f` with `-type d` would execute the `chmod` for directories instead. + +## Various +### Overwrite disk with pseudorandom data +Using openssl on CPUs with AES acceleration one can create pseudorandom data with high speeds. +Much faster than `/dev/urandom` at least +`# openssl enc -aes-128-ctr -md sha512 -pbkdf2 -nosalt -pass file:/dev/urandom < /dev/zero | pv > (target disk)` +Around 2GiB/s on my Ryzen 7 1700x if output to `/dev/null` +