feat: add device usage check before preparing ZFS datasets
Some checks failed
Nix Format Check / check-format (push) Has been cancelled

This commit is contained in:
2025-03-12 11:30:58 +01:00
parent 249d692d4e
commit b03278ac86

View File

@ -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