[Ubuntu-users] fsck shows errors on main partition only when mounted

Mark mhullrich at gmail.com
Tue Nov 16 19:53:49 UTC 2010


On Tue, Nov 16, 2010 at 9:03 AM, K. Frank <kfrank29.c at gmail.com> wrote:
> Hi Mark and Colin -
>
> Does this mean that even in "read-only" mode (-n) fsck assumes,
> in effect, that the partition is not mounted, and therefore errors it
> reports can be false positives?

No, it means that fsck won't act on errors it thinks it finds.  If the
volume is static (i.e., unmounted) then such error reports are more
reliable, but if the volume is mounted and active, then no they are
not.

>> When a drive is mounted, the data on it changes frequently, especially
>> if it's the system drive.  You're asking for trouble if you do this.
>
> Am I asking for trouble if I use the -n option?  I am under the impression
> that I can run fsck -n to my heart's content on mounted file systems
> completely safely (if perhaps not usefully).  Is this not correct?
>
It is safe but always useful.  to be safe and useful, the volume
should not be mounted.

> The idea, if I understand correctly, is that -n tells fsck not to attempt to
> fix anything (or otherwise modify anything), but to still go through the
> process of checking for and reporting errors.  This it seems to do.
>
Yes.

> So I was hoping to be able to check (safely) for errors by running fsck -n,
> even though the file system was mounted.  Doing so showed errors, so
> I ran fsck again with the file system unmounted, and (to my surprise) it
> showed no errors.
>
It's sort of a "who ya gonna believe?"  A live volume is inherently
more difficult to check for errors and since the data can change
underneath a check as it is occurring, you can get things that look to
fsck like errors but are not.

> Hence my original question:  Are the errors that fsck -n showed on my
> mounted file system false positives -- not really errors, but rather just
> artifacts of the file system being mounted?  Or are they a problem I
> should be worrying about (even though they don't show up when the
> system is not mounted)?
>
"Data on it changes frequently" means that fsck cannot be relied upon
to identify disk errors accurately because it depends on static data
that won't change while it is reading to verify the contents..

Answers in order from your last paragraph above: yes no (especially
when they don't show up when the system is not mounted).

Is that better?




More information about the ubuntu-users mailing list