OPNsense Forum

Archive => 15.1 Legacy Series => Topic started by: Yordan Yordanov on May 11, 2015, 02:12:41 pm

Title: [SOLVED] OS corruption after power failure
Post by: Yordan Yordanov on May 11, 2015, 02:12:41 pm
Last night there was a prolonged power outage and the router (https://www.applianceshop.eu/opnsense-a10-quad-core-ssd-rack.html) was rebooted after power was restored. It's all connected to UPS, but the outage lasted 4 hours. After the router booted up, most if its services wouldn't start. I collected some screenshots:

Clicking the START button displays the message "dhcpd has been started", however the button does not change to STARTED and the service doesn't start. Same with ipsec, dnsmasq and apinger:

(https://imagizer.imageshack.us/v2/977x501q90/910/e2Ms3A.png)

This output is from the Status -> System Logs menu about the dhcpd service:
(https://imagizer.imageshack.us/v2/1136x201q90/540/KZoNOp.png)

Logs for the IPsec daemon:
(https://imagizer.imageshack.us/v2/708x435q90/540/38Y9nb.png)
And here for dnsmasq:
(https://imagizer.imageshack.us/v2/540x411q90/537/pnDMJw.png)

Another error that I think is related to the issue:
(https://imagizer.imageshack.us/v2/1119x183q90/537/rwr3i7.png)

I think OPNsense is somehow broken and can't find some of its users. Restoring factory defaults or backed up configuration does not help. Can someone advise how to fix this? I had a very unpleasant morning replacing the router with an older one since DHCP and IPsec are critical services to us. :/
Title: Re: OS corruption after power failure
Post by: franco on May 11, 2015, 03:53:58 pm
Try:

# pkg upgrade -f
# reboot

Reason:

The user database was lost, the initial FreeBSD user database is not enough for ports as they ship their own group and user ids. Reinstalling all packages will hopefully bring them back. :)
Title: Re: OS corruption after power failure
Post by: Yordan Yordanov on May 11, 2015, 04:11:45 pm
Thanks, I'd love to do it, however SSH doesn't start either as the user for SSH is not found. :)
Title: Re: OS corruption after power failure
Post by: franco on May 11, 2015, 05:08:40 pm
No way to get to the root console?

Otherwise, just take a latest install media, boot, choose "import configuration", then "quick/easy" install and you're back.

PS: Don't forget to back up your config just in case.
Title: Re: OS corruption after power failure
Post by: Yordan Yordanov on May 11, 2015, 05:13:20 pm
Can I boot this device using USB? It's a hardware appliance and I'm not sure how I can control the boot process.

Additionally, I tried to connect to serial and I see the POST messages, however the output freezes when it finishes and I can't control the device from there.
Title: Re: OS corruption after power failure
Post by: franco on May 11, 2015, 05:27:28 pm
Well, the question is how did you manage to install OPNsense before? :)
Title: Re: OS corruption after power failure
Post by: Yordan Yordanov on May 11, 2015, 05:38:25 pm
I didn't. Have a look at the link to the device:

https://www.applianceshop.eu/opnsense-a10-quad-core-ssd-rack.html

As said, it's a hardware appliance and it came preinstalled with OPNsense.
Title: Re: OS corruption after power failure
Post by: AdSchellevis on May 11, 2015, 06:04:20 pm
Hi Yordan,

Reinstalling the device with a bootable usb is quite easy, just download the serial install image from one of the download mirrors and write it to a usb stick (https://wiki.opnsense.org/index.php/Installation_and_Initial_Configuration).

Then connect the delivered mini usb cable to the A10 appliance and your computer and setup a terminal client (like putty) connected at a baudrate of 115200.

Next you power the device and wait for a few seconds till some output from the bios appears on screen and there's a phrase telling something like "Press F12 for boot menu." then press F12 and choose USB as boot option.

And your ready to install.

Just let me know if you have issues,

Title: Re: OS corruption after power failure
Post by: Yordan Yordanov on May 11, 2015, 08:39:31 pm
Thanks Franco and Ad. I was able to restore back to normal using the USB with serial reinstall. It remains a mystery why this situation occurred but I hope it won't reoccur. At least I got some experience reflashing the device. :)

Thanks again for the prompt replies! :)