There is an option in FortiOS to enable automatic file system checks if the FortiGate shuts down ungracefully.
By default, the automatic file system check is disabled. When an administrator logs in after an ungraceful shutdown, a warning message appears advising them to manually run a file system check. A warning also appears in the CLI:
WARNING: File System Check Recommended! Unsafe reboot may have caused inconsistency in disk drive. It is strongly recommended that you check file system consistency before proceeding. Please run 'execute disk scan 17' Note: The device will reboot and scan during startup. This may take up to an hour
You can enable automatic file system checks in both the GUI and CLI.
- Go to System > Settings.
- In the Start Up Settings section, enable Auto file system check.
- Click Apply.
config system global set autorun-log-fsck enable end