Troubleshooting Disk and Filesystem Issues

pfSense® software will run a filesystem check ( fsck ) at boot when it detects an unclean UFS filesystem, typically from after a power outage or other sudden unclean reboot or shutdown. In rare cases, that isn’t always enough, as a filesystem can become corrupted in other ways that may not always leave the drive marked unclean.

Note

This is not necessary for ZFS. There is no fsck equivalent for ZFS, and it is not prone to the issues for which UFS and other filesystem types require checks and repairs.

The command zpool scrub <pool name> can validate the contents of a pool, identify potential issues, and attempt to repair damage where possible. The scrub operation is not the same as fsck; it is not necessary in cases where fsck is typically needed and it does not require a read-only filesystem so it can be run at any time.

In these cases, perform one of the following repair methods.

Automatic Filesystem Check

These methods force a filesystem check during the boot sequence even if the drive is considered clean.

Note

This option is not present on all firewalls as it is not compatible with certain hardware. To run a manual check instead, see Manual Filesystem Check.

GUI

  • Navigate to Diagnostics > Reboot

  • Set Reboot Method to Reboot with Filesystem Check

  • Click fa-wrench Submit

The firewall will reboot and run the check. Monitor the console output for errors.

Console

  • Connect to the console

  • Choose the menu option to reboot from the console menu (5)

  • Enter F (uppercase “f”)

The firewall will reboot and run the check. Monitor the console output for errors.

Manual Filesystem Check

If an automatic filesystem check is not possible, run a manual check instead:

  • Reboot the firewall into single user mode as described in Entering Single User Mode

  • Press Enter when prompted for a shell

  • Enter fsck -fy /

  • Repeat the command at least five times, or until no errors are found nor fixed, even if the filesystem is reported clean.

  • Exit single user mode as described in Exiting Single User Mode.

Example:

/boot/kernel/kernel data=0x19e4818+0x777e8 syms=[0x4+0x9a3b0+0x4+0xdc388]
|
Hit [Enter] to boot immediately, or any other key for command prompt.

Type '?' for a list of commands, 'help' for more detailed help.
loader> boot -s
[lots of boot output]
Enter full pathname of shell or RETURN for /bin/sh:
# fsck -fy /
[...]
# fsck -fy /
[...]
# fsck -fy /
[...]
# fsck -fy /
[...]
# fsck -fy /
[...]
# reboot

See also

The Netgate Resource Library contains a video which walks through the process of running a filesystem check.