FreeNAS tricks

http://docs.gz.ro/FreeNAS-command-line.html

Locked out of GUI because of bad SSL Certificate:

ssh -L 9000:localhost:80 root@korkina-freenas.anichin.com
browse http://localhost:9000/
sqlite3 /data/freenas-v1.db “select * from system_settings” sqlite3 /data/freenas-v1.db “update system_settings set stg_guihttpsredirect = 0, stg_guiprotocol=’http’;”

Allow TCP Forwarding and make tunnel:

in /etc/ssh/sshd_config
AllowTcpForwarding yes
sockstat -l | grep 22
kill 2792
/etc/rc.d/sshd onestart

ssh -L 9000:freenas_local_ip:80 root@freenas_public_ip
browse http://localhost:9000/

or

ssh -L 9000:freenas_local_ip:443 root@freenas_public_ip
browse https://localhost:9000/

You might be able to recover from unsuccessful upgrade by connecting via SSH and running:

cd /usr/local/www/freenas/UI
python manage.py migrate system 0101 –fake
python manage.py migrate –merge

sqlite3 /data/freenas-v1.db “.schema system_advanced”
sqlite3 /data/freenas-v1.db “ALTER TABLE system_advanced ADD COLUMN adv_graphite bool NOT NULL DEFAULT false;”

Change default boot environment
beadm list
beadm activate 9.10.2-U5
reboot

Manually upgrade FreeNAS

cd /tmp
wget https://download.freenas.org/11/11.0-RELEASE/FreeNAS-11.0-RELEASE-manual-update.tar
freenas-update -v FreeNAS-11.0-RELEASE-manual-update.tar