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

Re: why fsck does not check my hard disk, even when unconditional power loss



On Tue, Apr 01, 2014 at 09:36:22PM +0800, Zhang Cong wrote:
> Hi Theodore*,*
> 
>        Why fsck does not check hard disk, even when unconditional power
> loss, for both debian 6 and debian 7.
>        Can I mark that as the disk data is safe and no need to fsck?

It's up to each file system to decide whether it needs to do a full
check or not.  Most modern file systems have techniques which avoid
needing to do a full check after a power failure:

	http://en.wikipedia.org/wiki/Journaling_file_system

In the case of ext 3/4, the e2fsck program (aka /sbin/fsck.ext[34]) is
actually responsible for replaying the journal, so that we can do
multiple journal replays in parallel.  Other file systems will replay
the journal at mount time.

The kernel can mark a file system as containing a corruption, if it
finds a problem while it is working with the file system, in which
case e2fsck will force a full file system consistency check at the
next reboot.

Regards,

							- Ted



Reply to: