feat: remove prepare-zfs-datasets.sh script
Some checks failed
Ansible Lint Check / check-ansible (push) Failing after 19s
Nix Format Check / check-format (push) Successful in 58s
Python Lint Check / check-python (push) Failing after 14s

This commit is contained in:
Menno van Leeuwen 2025-03-19 00:14:00 +01:00
parent 85e22281b1
commit fab4224042
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE

View File

@ -1,60 +0,0 @@
#!/usr/bin/env bash
# Print available devices excluding loop devices
echo "Available devices:"
lsblk -d -o NAME,SIZE,TYPE | grep disk
echo ""
# Prompt user for device
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
if [ "$confirm" != "y" ]; then
echo "Exiting..."
exit 1
fi
# Create ZFS pool
sudo zpool create -f datapool "$device"
# Check if this went well
if [ $? -ne 0 ]; then
echo "Error creating ZFS pool. Exiting..."
exit 1
fi
# Create datasets with mountpoint=legacy
datasets=(
isos
vms
ai
downloads
services
audiobooks
music
photos
movies
tv_shows
# old_backups
)
for dataset in "${datasets[@]}"; do
sudo zfs create -o mountpoint=legacy datapool/"$dataset"
done
zfs list
echo ""
echo "ZFS datasets created successfully."
echo "You can now run \`dotf update\` and it should start mounting the datasets."
echo ""