Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 397961 - fsck on boot does not fix filesystem errors
Summary: fsck on boot does not fix filesystem errors
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-07 05:14 UTC by Nikos Chantziaras
Modified: 2012-01-10 02:50 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emergeinfo,5.12 KB, text/plain)
2012-01-07 05:15 UTC, Nikos Chantziaras
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikos Chantziaras 2012-01-07 05:14:32 UTC
Doing a (read-only) fsck on my root partition reveals errors:

/sbin/fsck.ext4 -n -f /dev/sda2
e2fsck 1.42 (29-Nov-2011)
Warning!  /dev/sda2 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
Pass 1: Checking inodes, blocks, and sizes
Inodes that were part of a corrupted orphan linked list found.  Fix? no

Inode 695 was part of the orphaned inode list.  IGNORED.
Inode 2433 was part of the orphaned inode list.  IGNORED.
Inode 2989 was part of the orphaned inode list.  IGNORED.
Inode 3397 was part of the orphaned inode list.  IGNORED.
Inode 3684 was part of the orphaned inode list.  IGNORED.
Deleted inode 6032 has zero dtime.  Fix? no

Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences:  -(247840--247848)
Fix? no

Free blocks count wrong (5114194, counted=5114048).
Fix? no

Inode bitmap differences:  -695 -2433 -2989 -3397 -3684 -6032
Fix? no

Free inodes count wrong (2511497, counted=2511466).
Fix? no

GentooRoot: ********** WARNING: Filesystem still has errors **********

GentooRoot: 750727/3262224 files (0.9% non-contiguous), 7934602/13048796 blocks

The filesystem is mounted, so I can't really fix them. So I reboot with a forced fsck (like with "touch /forcefsck"). On booting, an fsck is performed, but it doesn't seem to find or fix anything. If I perform a "/sbin/fsck.ext4 -n -f /dev/sda2" again, the same errors pop up.

Reproducible: Always
Comment 1 Nikos Chantziaras 2012-01-07 05:15:03 UTC
Created attachment 298155 [details]
emerge --info
Comment 2 Göktürk Yüksek archtester gentoo-dev 2012-01-08 02:19:10 UTC
Running the same command, I've gotten more errors than you did. Quoting e2fsck man page:

"""
Note that in general it is not safe to run e2fsck on mounted filesystems. The only exception is if the -n option is specified, and -c, -l, or -L options are not specified. However, even if it is safe to do so, the results printed by e2fsck are not valid if the filesystem is mounted.
"""

I guess the last sentence explains the situation here.

If you **really** have doubts, boot with a live cd and force fsck. But I doubt you will see the same set of errors.
Comment 3 Nikos Chantziaras 2012-01-10 02:50:14 UTC
I missed that info. It seems a read-only check on mounted fs cannot be trusted. I found out I can force a read-only remount of the root fs through SysRq (Alt+SysRq+U). When doing that, fsck does not find any errors.