Upgraded a couple of my FreeNas servers from 8.3.0 to 8.3.0 p1 last night. That part went great. What didn’t work as well is when I got to work today and tried to connect to the VPN on one of them. Seems that the bone-head in me forgot that upgrading the FreeNas OS would wipe out the modifications to rc.conf to start OpenVPN as well as wipe out the entire /usr/local/etc/openvpn directory with all of the keys and openvpn configuration in it.
The nice folks over at FreeNas.org have anticipated me being a doof and created the upgrade process such that the old OS is preserved. You can easily roll back to that if you are infront of your server by rebooting and hitting F2 (possibly F1) at the boot loader.
My problem was I wasn’t infront of my server and needed the VPN up ASAP. So, I reached out to my big brother (Josh Paetzel) and magically the answer appeared in my inbox.
- ssh into the server.
- su to root
- mount
- You are looking for this “/dev/ufs/FreeNASs2a on / (ufs, local, read-only)”If it says that, then your old install is /dev/ufs/FreeNASs1a, if it says FreeNASs1a then the old install is FreeNASs2a
- Either way, mkdir /mnt/oldinstall
- mount /dev/ufs/FreeNASs1a /mnt/oldinstall
- or mount /dev/ufs/FreeNASs2a /mnt/oldinstall
- ls /mnt/oldinstall/conf/base/etc/local/openvpn
- mount -uw /
- cp -r /mnt/oldinstall/conf/base/etc/local/openvpn /conf/base/etc/local/.
- grep openvpn /mnt/oldinstall/conf/base/etc/rc.conf >> /conf/base/etc/rc.conf
- Either reboot or repeat steps 10 and 11 replacing /conf/base/… with /etc/rc.conf and /usr/local/etc/openvpn
A great big thanks to Brother Josh on this one. Always there saving me from myself. Hope this helps someone else in some way, shape or form.