Best storage device for forced shutdown pfSense?



  • Hi guys! Anyone know what good storage device for pfSense for forced shutdown like turning off pfsense via powerbutton without shutting it down properly?

    SSD, HDD, Flashdrives, or compact flash?

    I installed pfSense into my SSD and its been running good for 2 - 3 months without shutting down properly, we just flip the circuit breaker and every power in the office shuts down.
    But recently my pfSense box cannot boot. I think it got corrupted. I know power is cheap and some people would recommend just turning it on 24/7 but the office caught fire once so my boss is not leaning on a device that is on while no one is in the office.

    I was hoping is there any hardware storage that can withstand forced shutdown without getting corrupted? I tried ZFS install but I can't make raidz3 work, the tutorials I found in the forum only covers ZFS on a single disk or mirrored.  :-\



  • You'll most likely experience this regardless of the storage media used.

    If it is not possible to shut it down properly manually, how about a small UPS with enough juice to shut down pfsense in an orderly manner?



  • @LeetDonkey:

    You'll most likely experience this regardless of the storage media used.

    If it is not possible to shut it down properly manually, how about a small UPS with enough juice to shut down pfsense in an orderly manner?

    Does ups have a software to shutdown pfSense? I know there some ups supporting that only windows but are there any for FreeBSD too?  ;D



  • You might want to consider booting from a CF card and keeping a backup copy of the boot slice - this isn't a solution, merely a way to repair the damage when you corrupt the default boot image.

    pFsense appears to support UPS shutdown via an addon but I've never managed to get it to work on my system.



  • Does ups have a software to shutdown pfSense? I know there some ups supporting that only windows but are there any for FreeBSD too?  ;D

    Take an small UPS from APC in use and this wont be occurring again.
    Yes there is a packet to be install on pfSense that supports APC and other UPSs.

    Any storage could be corrupted!

    To go with a read only marked medium is the only thing that might be helping you out.
    It could be a MicroDrive, CFCard or a  SDCard if you want.



  • SSD or HDD is your best bet for general purpose hardware. CF tends to not be all that reliable in that regard if it's rw mounted.

    If you're on current versions, I have my doubts that a power cycle would have corrupted anything. I just put a SG-4860 and SG-2440 running from eMMC through 1000 power cycles each this week, right after writing the passwd file, to re-test a different fix for passwd file corruption when power is lost shortly after writing the file in latest FreeBSD. 0 issue. Those boxes have been power cycled upwards of 20,000 times now. After we fixed missing fsync issues mid last year, I've yet to be able to corrupt a system. That's in more than a decade's worth of power offs if you do it once a day, and I'm intentionally doing it at the worst possible time.

    Granted, your SSD itself might have left that data in an inconsistent state. Or if you're running something like Squid that writes frequently, it may miss fsyncs and end up with inconsistent data, but that should only impact that specific service.

    What came up on the console when it wasn't working?


  • Rebel Alliance Global Moderator

    "we just flip the circuit breaker and every power in the office shuts down."

    That seems like a really horrific procedure…  So you don't have any other computers in this office?  What is the point of the router then?

    Or do those users shutdown their machines before they leave and the cb is pulled... Someone should really shutdown pfsense before you cut the power.  Or as mentioned get a ups, and have it shut down pfsense normally when it detects loss of AC...



  • @johnpoz:

    That seems like a really horrific procedure…  So you don't have any other computers in this office?

    Yeah, I'd be a lot more concerned with desktops and servers, they're generally going to be writing to their disks a lot more and hence have many more opportunities to leave inconsistent files behind if you're just pulling the plug on them.



  • Use any SATA or SAS disk with a SAS controller that has battery on it. This particular controllers write the data on fly to the disk when a sudden power outage happens.

    you can find SAS controllers with battery starting from 50$ and going up to few thousand dolars.

    http://www.ebay.com/itm/462594-001-HP-Smart-Array-P212-ZM-8-Port-SAS-SATA-RAID-Controller-w-Battery/172112080048?_trksid=p2047675.c100011.m1850&_trkparms=aid%3D222007%26algo%3DSIC.MBE%26ao%3D1%26asc%3D35828%26meid%3Df8c2d9e359a444e1ac0d20ae8550cedb%26pid%3D100011%26rk%3D5%26rkt%3D10%26sd%3D141813859748



  • Does your apliance have an (ACPI) power button? What happens if you shortly press it?
    If you're lucky enough with your hardware, pressing the power button would initiate normal shutdown.

    On the other side, I would try a NanoBSD installation (using CF card, USB stick or internal DOM). If your storage media is fast enough, you can have the default option to keep it mounted RO while running. That way, during power loss, it's less likely that anything in the operating system wants to write to the disk.

    If not, also try with mounting /tmp /var etc. to RAM. (see System: Advanced: Miscellaneous, for NanoBSD these are in RAM by default, but for full installs they are not). The goal would be to reduce disk writes as much as possible - and NanoBSD is the closest way to achieve that.



  • Another idea would be to get a RaspberryPI with a big button beside it. Write a small script on the PI to remotely shutdown your pfSense through network (pfSense would also need a small server script for that). Teach your boss to hit the big button first before he leaves, and wait until the LEDs on the appliance go down. And cut power afterwards.
    Oh - and keep a couple of PIs for spare in the drawer  ::)