diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-12-30 21:20:10 +0000 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2019-12-30 21:20:10 +0000 |
commit | c37f1383c62f53f323f13acc9802ed50135b3be4 (patch) | |
tree | 2f60090e3bb349b4b96770d435979f96f6778b2f | |
parent | ee5db85224ab31ef290ab64022c0813fd7241a33 (diff) | |
download | dotfiles-c37f1383c62f53f323f13acc9802ed50135b3be4.tar.gz |
ata-secure-erase: improve terminal output
-rwxr-xr-x | bin/ata-secure-erase | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/ata-secure-erase b/bin/ata-secure-erase index c47f5092..17ec49b7 100755 --- a/bin/ata-secure-erase +++ b/bin/ata-secure-erase @@ -22,7 +22,7 @@ set -x device="" ! test -z "$device" -mount | grep -v "$device" +mount | grep -qv "$device" # sudo scrub "$device" # in case the ATA secure erase actually just # # bricks the device, first erase the device @@ -37,9 +37,11 @@ mount | grep -v "$device" sudo hdparm -I "$device" | grep "not frozen" sudo hdparm --user-master u --security-set-pass Eins "$device" -sudo hdparm -I "$device" | grep -v "not enabled" +sudo hdparm -I "$device" | grep -qv "not enabled" # drive may not support --security-erase-enhanced and so might need to # change following line to use --security-erase +date sudo time hdparm --user-master u --security-erase-enhanced Eins "$device" -sudo hdparm -I "$device" | grep "not enabled" +sudo hdparm -I "$device" | grep -q "not enabled" +date |