Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Useful Commands

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
I just wanted to share my list of useful commands with everyone ;)

Please note that you're the only one responsible of what you do in the CLI so don't blame me if you mess your system.

Feel free to suggest me some commands (by private message to avoid cluttering the thread) ;)

Also I want to say thanks to BigDave for providing some of the commands :)



ZFS
Code:
zpool status -v #shows zpool status infos

zpool iostat 1 #shows IOps and R/W bandwidth every second

zfs list -t snapshot #lists all the snapshots, add | grep "" to filter

arc_summary.py #shows ARC stats

arcstat.py #shows ARC stats

zdb -C your_pool_name | grep ashift #shows the ashift value




SMART
Code:
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
Code:
glabel status  #shows gptids and devices names

gstat -f daX -I 1000ms #shows IOps and R/W bandwidth every second

iostat daX #shows IOps and R/W bandwidth




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




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




Misc
Code:
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 infos

cat /var/log/messages | more #shows the log (same as in the GUI footer)

freenas-debug -h more /var/tmp/fndebug #shows all debug infos

camcontrol devlist #shows all devices

usbconfig #shows all usb devices




Burn-in/Benchmark
Code:
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 times

for i in 1 2 3 4; do while : ; do : ; done & done #cpu burn test for 4 threads
 
Last edited:

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Very useful sir. I recommend the mods @jkh @cyberjock etc move it to some permanent/sticky status and/or location.
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Many thanks ;)
 

Ericloewe

Not-very-passive-but-aggressive
Moderator
Joined
Feb 15, 2014
Messages
17,013
Code:
smartctl -A /dev/adaX

Useful if you only want to check the SMART attributes, without drive information, SMART test log and other less-interesting info.
 

Snow

Senior Member
Joined
Aug 1, 2014
Messages
284
Are the Parameters for Freebsd - mv - Move commands all the same for FreeNas as they are for Freebsd?
 

Snow

Senior Member
Joined
Aug 1, 2014
Messages
284
Thanks
 

socra

Junior Member
Joined
Nov 3, 2018
Messages
16
I just wanted to share my list of useful commands with everyone ;)

Please note that you're the only one responsible of what you do in the CLI so don't blame me if you mess your system.

Feel free to suggest me some commands (by private message to avoid cluttering the thread) ;)

Also I want to say thanks to BigDave for providing some of the commands :)



ZFS
Code:
zdb -C your_pool_name | grep ashift #shows the ashift value
Should this code not be changed to

zdb -U /data/zfs/zpool.cache | grep ashift ?
 
Top