Boot Loop Fix
-
I had another rare boot loop case a few days ago due to a power drop.
The fix is simple enough - at the menu, enter single user mode, then run fsck on or twice (or more), then reboot.
Simple enough if you are sitting in front of the device. Not so much when it is 2,000 miles away and you have to talk someone with little PC skills through connecting a monitor and keyboard, then walking them through the "simple" fixit procedure.It seems like there ought to be a way to just add the fsck command into the boot process somewhere early on to make this a more or less automatic fix.
To those who want to say stuff like "it should never have a power drop, etc" just don't - stuff happens...
An yes, I understand that this will lengthen the startup process. But not as much as a boot loop...Googling gets me all sorts of articles on manually fixing the boot loop issue, but I can find nothing on modifying the boot process to insert a command to run fsck automatically. Is this possible? If so, please provide detailed steps or a link.
Thanks, Roy
-
@rpitchford UFS or ZFS?
Also any text from the console or boot process would be helpful to determine why it is looping.
-
Well, thanks for a quick reply.
As I indicated, the power got dropped, leaving the hard drive in a less than ideal state. Basically, the usual cause for a boot loop I believe.
I also indicated that the usual boot loop fix worked and that the system is pretty much difficult to access, so providing detailed screen information is a challenge.The question posed is simple enough - is there a way to insert a fsck command into the boot process to automate boot loops a self-repairing process?!?
-
@rpitchford FSCK isn't a valid option for ZFS so there's a reason for the questions I posted.
https://docs.netgate.com/pfsense/en/latest/troubleshooting/filesystem-check.html
-
@rcoleman-netgate
Right, sorry - I missed that...
Since fsck fixed the problem and I don't believe that command works on ZFS, I think it's safe to assume that I'm not running ZFS on that one... -
fsck is already run at every boot. Sometimes filesystem damage is sufficiently bad that a single fsck pass cannot correct it.
-
The command was run several times, which resolved the issue and allowed the system to start up.
If what you say is true, then after going through a number of boot loop cycles, the system should have eventually started up. It did not...
-
@rpitchford it has to run multiple times in single user mode --- that is not the case in a normal boot.
-
You could force it do that every time but it would delay boot significantly. Check the script used in /etc/rc.initial.reboot.