[arch-general] Forced to run fsck manually on unattended system

Chris Down chris at chrisdown.name
Tue Mar 5 19:28:44 EST 2013


Hi,

On 6 March 2013 02:31, edd_smith <edwardmbsmith at gmail.com> wrote:
> I have noticed that over time the boxes are showing file system errors and
> getting stuck during the boot phase requiring manual intervention (Either
> press Control-D to continue - resulting in failure or log in to the start up
> shell using the root password and run fsck manually). I simply answer yes to
> every prompt from fsck and the errors are resolved, the box reboots and runs
> fine.

It may *appear* fine, and technically it may be correct, but your data
is more than likely not in the state that you're expecting.

> I need to be able to force an 'fsck -y'  type command at every boot as
> visiting these boxes manually isn't an option. I have already moved the
> partitions to ext2 as this seemed to show a mild improvement and also set 0
> 1 flags in /etc/fstab but still I'm seeing the freezing on boot.

You can do this by creating /forcefsck on each boot. A systemd service
like this should do (untested):

[Unit]
Description=Create /forcefsck to force fsck on next reboot

[Service]
Type=oneshot
ExecStart=touch /forcefsck

> First of all should I be re-partitioning my drives to something which can
> handle these kinds of sudden power outages or removing the swap space or
> something?

If you want to avoid data loss at the cost of performance, don't do
any disk write caching. If I recall correctly, you can do this with
`hdparm -W 0'.

Best,

Chris


More information about the arch-general mailing list