Gentoo Archives: gentoo-user

From: Willie Wong <wwong@××××××××××××××.edu>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] running e2fsck pre-mount
Date: Wed, 09 Sep 2009 08:27:42
Message-Id: 20090909082805.GA24720@princeton.edu
In Reply to: [gentoo-user] running e2fsck pre-mount by Maxim Wexler
1 On Tue, Sep 08, 2009 at 08:37:49PM -0600, Penguin Lover Maxim Wexler squawked:
2 > On an Asus netbook during boot after the line
3 >
4 > *checking all filesystems
5 >
6 > there'll be a message something like 'filesystem mounted 36 times
7 > without being checked. Check forced' then something like '17.1%
8 > non-contiguous' then a long delay. Then one of two things, either a
9 > message saying 'errors fixed' or a forced reboot.
10
11 A feature of mount and a feature of e2fs. First, from man 5 fstab
12
13 The sixth field, (fs_passno), is used by the fsck(8) program to deter-
14 mine the order in which filesystem checks are done at reboot time. The
15 root filesystem should be specified with a fs_passno of 1, and other
16 filesystems should have a fs_passno of 2. Filesystems within a drive
17 will be checked sequentially, but filesystems on different drives will
18 be checked at the same time to utilize parallelism available in the
19 hardware. If the sixth field is not present or zero, a value of zero
20 is returned and fsck will assume that the filesystem does not need to
21 be checked.
22
23 Now you know what the last dangling number in /etc/fstab is for! For
24 most of my partitions, except the root one, I set it to 0. Mostly
25 because that my partitions are in ReiserFS.
26
27 However, it is probably set to 0 in your case, otherwise the message
28 you saw wouldn't have happened.
29
30 Next, if you look at man tune2fs, you'd see the option '-c', which
31 (just quoting the relevant parts)
32
33 Adjust the number of mounts after which the filesystem will be checked
34 by e2fsck. If [the number] is 0 or -1, the number of times the
35 filesystem is mounted will be disregarded by e2fsck.
36
37 >
38 > What does it mean 'without being checked' Does the boot process expect
39 > a filesystem check, in this case e2fsck? Why should their be errors. I
40 > shut the machine like this '#shutdown -h(or -r) now' Everything is
41 > unmounted and the machine turns off without a glitch that I''m aware
42 > of.
43
44 More from the manpage for tune2fs:
45
46 You should strongly consider the consequences of disabling
47 mount-count-dependent checking entirely. Bad disk drives, cables,
48 memory, and kernel bugs could all corrupt a filesystem without
49 makrking the filesystem dirty or in error. If you are using journaling
50 on your filesystem, your filesystem will never be marked dirty, so it
51 will not normally be checked. A filesystem error detected by the
52 kernel will still force an fsck on the next reboot, but it may already
53 be too late to prevent data loss at that point.
54
55 Basically, since you don't ask the filesystems to be checked on every
56 boot, to make sure your fs's are sane, ext2/3 will ask the filesystems
57 to be checked every X mounts (also every T period of time, see the -i
58 option in tune2fs for details). Like the manpage said, sh*t happens,
59 and it is better that you check once in a while.
60
61 However, if every single time when the fsck is run you either reboot
62 or there is an error... there maybe something wrong with your
63 hardware. If you don't have smartd installed, you should consider it,
64 your data on the harddrive should be worth your time.
65
66
67 W
68 --
69 There was a man in a nuthouse who constantly scared off all the newcomers with
70 a menacing smile and the dreadful-sounding phrase, "I differentiate you! I
71 differentiate you!"--invariably the newcomer would cower in the corner and stay
72 far away from the man. However, one day another man came in and confronted the
73 first man. Of course, the first began yelling at the newcomer, "I differentiate
74 you! I differentiate you!" But it had no effect on the newcomer. The man yelled
75 "I differentiate you!" several times to no avail. Finally, he broke down in
76 tears. "Why, why?!?" he asked.
77
78 The second man stated simply, "I'm e^x."
79 Sortir en Pantoufles: up 1006 days, 7:02

Replies

Subject Author
Re: [gentoo-user] running e2fsck pre-mount Maxim Wexler <maxim.wexler@×××××.com>