Next you want to make room in your bpool...
I wrote this script to automate that for me on mine:
Code:
#!/bin/bash
# MAFoElffen, <mafoelffen@ubuntu.com>, 2021.12.28, last modified: 2022.02.23
# Purpose: ZFS Snapshots bpool maintenance
function ZfsShowFreeSpace ()
{
zfs list -o space
zpool list
}
function ZfsListBpool() {
zfs list -r -t snapshot -o name,used,referenced,creation bpool/BOOT | less
}
function GetZfsBpoolSnapshotCount()
{
ZfsSnapshotCount=$(zfs list -r -t snapshot -o name,used,referenced,creation bpool/BOOT | wc -l)
line_count="$(($ZfsSnapshotCount-1))"
echo -e "There are $line_count snapshots in bpool."
}
function ZfsTrimLast5()
{
# Command for removing is: zsysctl state remove --system <statename>
zfs list -r -t snapshot -o name,used,referenced,creation bpool/BOOT | \
head -n 5 | \
cut -c 35-40 | \
xargs -n 1 zsysctl state remove --system
}
function ShowMenu() {
while [[ "$menu_response" != "5" ]]
do
clear
echo -e "=== ZFS BPool Maintenance ==="
echo
echo -e "1 - Show space in Zpools"
echo -e "2 - Show list of BPool Snapshots."
echo -e "3 - Show count of BPool Snapshots"
echo -e "4 - Destroy oldest 5 BPool SnapShots"
echo -e "5 - Exit"
echo
read -p "Enter a valid menu response from 1 through 5: " menu_response
case $menu_response in
1) ZfsShowFreeSpace;;
2) ZfsListBpool;;
3) GetZfsBpoolSnapshotCount;;
4) ZfsTrimLast5;;
5) exit;;
*) echo -e "The response was not a valid choice.";;
esac
echo
read -p "Press any <Enter> key to continue" trashbin
done
}
ShowMenu
Use gedit to paste/save it into a script file named "ZfsBpoolMaintenance". Then to run, while you are in the same folder
Code:
chmod +x ./ZfsBpoolMainteance
./ZfsBpoolMaintenance