[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Skipping fsck during boot with systemd?

On 10/12/2014 09:30, Frédéric Marchal wrote:
Le Tuesday 09 December 2014 16:36:53, The Wanderer a écrit :
On 12/09/2014 at 10:09 AM, Chris Bannister wrote:
On Tue, Dec 09, 2014 at 09:48:58AM +0100, Frédéric Marchal wrote:
Now, is it possible to run fsck during shutdown? Users have been
asking for this for at least 10 years. Is it now acceptable,
possible, tolerated?

That sounds like a recipe for disaster. Do you mean *before*

Obviously, "during shutdown" means "during the shutdown process", i.e.,
during the sequence of shutting-down-the-system steps which takes place
in response to a "shutdown" command.

That sequence already does several things prior to actually shutting
down the system; perhaps most obviously, it tells various "services" to
stop cleanly, kills other processes, and unmounts filesystems. There
seems as if there should be no conceptual reason why it shouldn't be
possible to add an additional "run a fsck" step into that sequence,
probably after the unmount and before the final shutdown itself.

...except that fsck of root during the boot process is possible only
because root hasn't been mounted yet, because we're still in the
initramfs and haven't pivoted into the real root yet. So making that
possible during shutdown would probably require setting up another
ramdisk during the shutdown process (which sounds like a bad idea),
pivoting into it, unmounting the original root, and then triggering the

The partition only need to be remounted read only. if I'm understanding it

That's what /etc/init.d/umountroot does during the shutdown sequence. So
everything is in place to run fsck just before /etc/rc0.d/K10halt.

Now two questions remain:

1) how to invoke an additional hypothetical /etc/rc0.d/K10fsck on demand?

2) is it wise to run fsck at that time? I have seen strong opposition in the
past. Mostly turning around the risk that the user would switch the power off
or the power supply would fail resulting in a damaged partition. As the risk
seems as high during the boot sequence, I don't understand the opposition.

All in all, while it *might* be possible, I don't think it sounds like
that would be worth the trouble.

That's probably right too...


In the case of regularly failing power it would probably be more often inconvenient to run fsck at shutdown. In general when we choose to shutdown it is for good reasons I guess, so a long wait may has more risk to be a nuisance then than during boot? But I don't see why we couldn't get a nagging prompt to run fsck at any of boot or shutdown time when it's due, with option to cancel it. After all I think even Windows gives you this control and allow the user to opt-out of a disk check for a short time before starting it (at least it's what I remember from the Windows 7 I have used). In the long run better file-systems and online check may relegate all this to the museum of horrors, but in the meantime being able to interrupt fsck seems like the best and only option covering all use cases.

Reply to: