root@ubuntu-gnome:~# bash erase
dm-crypt
dd: error writing ‘/dev/mapper/random_sda4’: No space left on device
2049+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 24.1911 s, 88.8 MB/s
device-mapper: remove ioctl on random_sda4 failed: Device or resource busy
real 0m24.940s
user 0m0.004s
sys 0m1.976s
openssl
error writing output file
real 0m23.926s
user 0m0.956s
sys 0m2.628s
shred
shred: /dev/sda4: pass 1/1 (random)...
shred: /dev/sda4: pass 1/1 (random)...382MiB/2.0GiB 18%
shred: /dev/sda4: pass 1/1 (random)...830MiB/2.0GiB 40%
shred: /dev/sda4: pass 1/1 (random)...1.2GiB/2.0GiB 62%
shred: /dev/sda4: pass 1/1 (random)...1.6GiB/2.0GiB 84%
shred: /dev/sda4: pass 1/1 (random)...2.0GiB/2.0GiB 100%
real 0m22.999s
user 0m3.576s
sys 0m1.072s
root@ubuntu-gnome:~# ^C
root@ubuntu-gnome:~# cat erase
crypt_erase() {
cryptsetup create random_sda4 /dev/sda4 -d /dev/urandom
dd if=/dev/zero of=/dev/mapper/random_sda4 bs=1M
cryptsetup remove random_sda4
}
echo dm-crypt
time crypt_erase
echo
echo openssl
time openssl enc -aes-128-ctr -v -pass pass:"$(openssl rand -base64 128)" -nosalt < /dev/zero > /dev/sda4
echo
echo shred
time shred -v -n1 /dev/sda4
#root@ubuntu-gnome:~# time dd if=/dev/urandom of=/dev/sda4
#dd: writing to ‘/dev/sda4’: No space left on device
#4194305+0 records in
#4194304+0 records out
#2147483648 bytes (2.1 GB) copied, 401.988 s, 5.3 MB/s
#
#real 6m41.991s
#user 0m1.528s
#sys 5m35.732s
root@ubuntu-gnome:~#