feat: add device usage check before preparing ZFS datasets
Some checks failed
Nix Format Check / check-format (push) Has been cancelled
Some checks failed
Nix Format Check / check-format (push) Has been cancelled
This commit is contained in:
@ -9,6 +9,12 @@ echo ""
|
||||
echo "Enter the device to use for the ZFS pool (e.g., /dev/sdb):"
|
||||
read device
|
||||
|
||||
# Confirm the device is not in use
|
||||
if mount | grep "$device"; then
|
||||
echo "Error: $device is already mounted. Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ask for confirmation, since this script will destroy all data on the device
|
||||
echo "This script will destroy all data on $device. Are you sure you want to continue? (y/n)"
|
||||
read confirm
|
||||
|
Reference in New Issue
Block a user