Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sorry for bad english.

How to set systemd for automatically force fsck disks after crash (hard poweroff)?

When I used sysvinit (in Arch Linux) as /sbin/init I used the hack: in the rc.local I create /forcefsck file; in the rc.local.shutdown I remove it. At boot-up rc.sysinit enable force fsck if /forcefsck exists.

How to do same in systemd? Maybe it has built-in facilities for automatic fsck after crush?

share|improve this question
up vote 8 down vote accepted

You can force fsck at boot time by passing fsck.mode=force as a kernel command line parameter (as of systemd v. 213, there's also a second parameter: fsck.repair - to control how fsck shall deal with unclean file systems at boot).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.