Shutdown Procedure for pfSense



  • With most OS I know for a fact that if the user does not execute a proper shutdown, the OS kernel can and will be corrupted. If I have learned nothing in more than 25 years with computers, I have certainly learned that.

    However with my pfSense Network Appliance, I see no "Shutdown" per se in the menu, the closest choice being "Logout" (for secure shell).

    Every time now I just turn off the UPS which of course cuts power to the Network Appliance which then results in a "cold shutdown". Problem on last bootup: The bootup was incomplete such that it appeared I may have corrupted the OS by shutting down this way.

    Is there a proper shutdown procedure for pfSense?

    Now, folks, I am pretty darned sure this time I am not asking a really stupid question about pfSense.  :o



  • @incurablegeek:

    With most OS I know for a fact that if the user does not execute a proper shutdown, the OS kernel can and will be corrupted. If I have learned nothing in more than 25 years with computers, I have certainly learned that.

    However with my pfSense Network Appliance, I see no "Shutdown" per se in the menu, the closest choice being "Logout" (for secure shell).

    Every time now I just turn off the UPS which of course cuts power to the Network Appliance which then results in a "cold shutdown". Problem on last bootup: The bootup was incomplete such that it appeared I may have corrupted the OS by shutting down this way.

    Is there a proper shutdown procedure for pfSense?

    Now, folks, I am pretty darned sure this time I am not asking a really stupid question about pfSense.  :o

    You want Diagnostics…Halt System from the menu.  There is also a "Halt" option (#6) in the console when you SSH into the firewall.

    Bill



  • You can also do /etc/rc.shutdown from a command prompt.



  • The only time a file should get corrupted from a cold shutdown is if it's currently being modified and the changes are not complete or have not been flushed completely to disk.

    So unless you're in the process to modifying PFSense, like config changes or upgrades, you shouldn't be able to get corrupted files., except logs that are always writing.



  • pfSense also has a fairly good auto-recovery procedure that runs upon subsequent boot after an improper shutdown.  My experience has been that it catches any possible corruption barring a physical drive failure.



  • Wow, you fellows have been extremely helpful. It does appear, however, that I was wrong in claiming that this is the first question I have asked that was not a stupid one. It really was a bit dim-witted of me I think.

    So, yes, there is a proper shutdown procedure as with all other OS I have used -but- it should not be corrupted as a result of several cold shutdowns?

    In short, then, I should not need to reinstall the OS because of a corrupted kernel as would be the case with every iteration of Windows, for example?  (Free BSD appears to be self-healing and therefore quite forgiving)

    Thank you so much for saving me from myself!  ;D


  • Netgate Administrator

    If you have sufficient disk corruption that the kernel can't load then it won't able to run any disk checking utility that might repair it.
    If your box is installed such that it is subjected to frequent hard shutdowns then consider using the Nano install type where the filesystem is mounted read-only and much less susceptible to corruption.

    Steve


  • Rebel Alliance Developer Netgate

    You're also more likely to see that type of corruption with a sudden power loss if you use an SSD which does not have a power loss protection capacitor/feature.



  • Steve,

    Please understand that just suddenly turning off the power to shut down a computer is something I never ever do with any of my computers. It's just that I'm new to pfSense and free BSD, so I was ignorant of the shutdown procedure.

    Actually to prevent any OS corruption I have UPS on all of my computers.

    My question was, then, in an effort to take no chances that my OS might be corrupted should I reinstall the OS and begin anew.

    Or should I assume that if it comes up to the menu that it is functioning properly?

    What I don't want is after I have configured pfSense (project for this evening) to find out the OS has in fact been corrupted.

    Sorry to be a pain but if it were you, would you just reinstall the OS and begin anew. That's kind of what I think is just good sense.



  • I don't see any reason to reinstall everything just because you did a dirty shutdown and are concerned about filesystem corruption.  If it boots without spewing errors everywhere, you're good to go.  If you're really paranoid and haven't gotten far into configuration then sure, redo it all.  Otherwise, I wouldn't bother.



  • @incurable, if you have an UPS, thing about installing the NUT package.
    My UPS (from APC) has a cable that hooks up to an USB port on my pfSEnse setup, the NUT sofware recognizes my UPS very well.

    I instructed NUT to launch a clean shut down after 10 minutes of power failure. Works for years now.



  • Thank you so much Gertjan. That was very, very helpful.

    Thus far all I've done is a simple install of pfSense with 1 WAN and 1 LAN (I'll add modules and get "cute" later."), so I was wondering how to make the UPS do its part.

    It just so happens that the UPS on my pfSense is an APC. Will definitely check out the NUT software.



  • Helloooooo, Guys.

    its very simple to shutdown our very own and lovable PFSense Router.

    Steps:
    Check The Menu Very and press the digits very Carefully

    1. Press 8 : to entering shell (CLI Mode or Terminal Mode)
    2. you will get the Root access with the Release Information and Domain Details and User:
      ROOT: Type (init 0)



  • Galactic Empire

    Please do not revive old topics.


Log in to reply