Add startup confirmation to disk utilities
This commit is contained in:
1 parent
c777cf115b
commit
33c4229848
5 files changed
+48
-1
No files matched your search
@@ -15,6 +15,8 @@ Usage: sudo ./HDD/erase-storage.sh DEVICE [zero|random]
|
||||
For a partition, writes one full pass of zeros (default) or pseudorandom data.
|
||||
For a whole disk, detects and runs a supported ATA Secure Erase or NVMe Sanitize
|
||||
operation. Whole-disk erasure requires two separate confirmations.
|
||||
At startup, asks you to confirm that you can keep the computer and drive
|
||||
powered and connected for the hours the operation may take.
|
||||
|
||||
Arguments:
|
||||
DEVICE Partition (for example /dev/sda1) or whole disk
|
||||
@@ -51,6 +53,9 @@ case "$FILL_MODE" in
|
||||
;;
|
||||
esac
|
||||
|
||||
common::log "WARNING: Erasing data may take hours. Do not power off, reboot, or suspend the computer, or disconnect power or the drive."
|
||||
common::confirm "Can the computer and drive remain powered and connected until the operation finishes?" || exit 0
|
||||
|
||||
for required_command in findmnt lsblk readlink swapon date dd sleep; do
|
||||
common::require_cmd "$required_command"
|
||||
done
|
||||
|
||||
Reference in new issue
Block a user