TrueNas Useful Commands

RomanAcademy
2 min readMar 23, 2023

--

https://istore.airriseinc.com/

If you’re a frequent user of the command-line interface (CLI), you know that memorizing useful commands can save you a lot of time and effort. As someone who has spent a lot of time in the terminal, I’ve compiled a list of some of the most useful commands that I’ve come across. I wanted to share them with everyone who might find them helpful.

Before diving in, however, it’s important to note that using these commands can sometimes be risky. You are the only one responsible for what you do in the CLI, so be sure to use these commands with caution. I cannot be held liable for any damages or problems that may arise from their use.

With that being said, here are some of the most useful commands that I’ve found:

ZFS

zpool status -v #shows zpool status infos
zpool iostat 1 #shows IOps and R/W bandwidth every secondzfs list -t snapshot #lists all the snapshots, add | grep "" to filterarc_summary.py #shows ARC statsarcstat.py #shows ARC statszdb -C your_pool_name | grep ashift #shows the ashift value

SMART

smartctl -h #shows smart control help, lots of commands examples

smartctl -a /dev/daX #shows all smart attributes

smartctl -A /dev/daX #same as -a but without vendor infos, last test infos, ...

smartctl -l selftest /dev/daX #shows result of last smart test

smartctl -l scttemp /dev/daX #shows the temperatures history

smartctl -t long /dev/daX #executes a long test (replace "long" by "short" for a short test)

HDD

glabel status  #shows gptids and devices names
gstat -f daX -I 1000ms #shows IOps and R/W bandwidth every secondiostat daX #shows IOps and R/W bandwidth

HBA

dmesg | grep mps #used to check FW and driver versions on HBA cards using the mps driver

UPS

upsc ups #shows all ups attributes (change "ups" with your ups name)

Misc

kldload ipmi.ko #loads ipmitool
ipmitool sensor #shows all ipmi sensors values
systat -vm #shows system infos (cpu load, ram usage, drives I/O, ...)dmidecode | more #shows all hardware bios infoscat /var/log/messages | more #shows the log (same as in the GUI footer)freenas-debug -h more /var/tmp/fndebug #shows all debug infoscamcontrol devlist #shows all devicesusbconfig #shows all usb devices

Burn-in/Benchmark

dd if=/dev/zero of=/mnt/tank/tmp.zero bs=2048k count=50k #disable shares and compression for the test!!!
dd if=/mnt/tank/tmp.zero of=/dev/null bs=2048k count=50k #disable shares and compression for the test!!! don't forget to delete tmp.zero after
diskinfo -t daX #test seek and transfer timesfor i in 1 2 3 4; do while : ; do : ; done & done #cpu burn test for 4 threads

Sponsor: https://istore.airriseinc.com/

--

--

RomanAcademy
RomanAcademy

Written by RomanAcademy

If software and web development are something you’re interested in, you’ll find a lot of helpful information on this channel.

Responses (1)