Skip to contentSkip to conversation

Automatic fsck behavior

DISCUSSION Daniel 3 participants 4 messages Jul 17, 2014 – Aug 17, 2014

lore
Share & tools
lore

Daniel

author
#0 lore raw

Hi,

Had some questions about automatic boot-time fsck, following a power-loss or hard-shutdown, etc.
All prior research (web searching, etc) on this has been inconclusive.

1) Does it do a real fsck or only a journal playback?

2) If it's a real fsck, is it done in repair mode or diagnostic mode?

Also, do the answers depend/vary according to ext4 version or anything else?

Thank you

#1 lore raw
Quoted 7 lines · Daniel

Hi,

Had some questions about automatic boot-time fsck, following a power-loss or hard-shutdown, etc.
All prior research (web searching, etc) on this has been inconclusive.

1) Does it do a real fsck or only a journal playback?

By default, e2fsck at boot time only replays the journal if needed.

A full fsck at boot time is generally only done if:

*) The filesystem was marked with an error prior to the fsck due
to a runtime metadata error
*) Mount-count or time-based thresholds have been reached
(newer mke2fs doesn't set these threshold by default)

Quoted 1 line

2) If it's a real fsck, is it done in repair mode or diagnostic mode?

Depends on how initscripts invoke it, but most likely it is in preen ("repair the easy stuff") mode.

Quoted 1 line

Also, do the answers depend/vary according to ext4 version or anything else?

yep, see above, w.r.t. initscript behavior, older/newer mke2fs, e2fsck.conf, mke2fs.conf, etc ;)

-Eric

Quoted 7 lines

Thank you

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 11 lines · Eric Sandeen
Quoted 7 lines · Daniel

Hi,

Had some questions about automatic boot-time fsck, following a power-loss or hard-shutdown, etc.
All prior research (web searching, etc) on this has been inconclusive.

1) Does it do a real fsck or only a journal playback?

By default, e2fsck at boot time only replays the journal if needed.

To elaborate a bit further - e2fsck will always do a sanity check of the superblock when it is opening the filesystem to replay the journal.

Quoted 4 lines

A full fsck at boot time is generally only done if:

*) The filesystem was marked with an error prior to the fsck due
to a runtime metadata error

or if the error was stored in the journal, even if it couldn't be written to the superblock.

Cheers, Andreas

Quoted 24 lines

*) Mount-count or time-based thresholds have been reached
(newer mke2fs doesn't set these threshold by default)

Quoted 1 line

2) If it's a real fsck, is it done in repair mode or diagnostic mode?

Depends on how initscripts invoke it, but most likely it is in preen ("repair the easy stuff") mode.

Quoted 1 line

Also, do the answers depend/vary according to ext4 version or anything else?

yep, see above, w.r.t. initscript behavior, older/newer mke2fs, e2fsck.conf, mke2fs.conf, etc ;)

-Eric

Quoted 7 lines

Thank you

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Cheers, Andreas

author
#3 lore raw

Ok, got it.

Thank you both very much for your help - it's greatly appreciated.