TrueNAS Logo

I have very much fallen down the rabbit hole with TrueNAS and although the GUI is very good occasionally I need to jump to the command line. This is a list of the commands that I might need to use. I will update this page with anything else I find useful.

General Storage

Get the compression ratio of each Pool

sudo zfs get compressratio  $PoolName

Application

Install HeavyScript

curl -s https://raw.githubusercontent.com/Heavybullets8/heavy_script/main/functions/deploy.sh | bash && source "$HOME/.bashrc" 2>/dev/null && source "$HOME/.zshrc" 2>/dev/null

View the size of each application

zfs list $(cli -c 'app kubernetes config' | grep -E "pool\s\|" | awk -F '|' '{print $3}' | tr -d " \t\n\r")/ix-applications/releases -r | grep pvc | awk '{print $1, $2}' | sort -hr -k2 | column -t

List all Pods and status

sudo k3s kubectl get pods -A

Verify which pool your apps are running on

cli -c 'app kubernetes config'

View pods and network info

k3s kubectl get pods,svc -A

Update and then prune docker containers

 sudo heavyscript update -p

sudo systemctl restart middlewared 

General ZFS

Show all pools and the physical disk structure/health of all members

sudo zpool status

Get ZFS Compression ratio

sudo zfs get compressratio $Poolname
Previous post Analytics in a privacy focused world
Next post Configuring a Zen Internet and City Fibre connection with a 3rd party router