You are not logged in.

#1 2013-01-14 10:55:12

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Why does fsck run (automatically) after 23 mounts?

Hey all,

Just a question that popped up in my head a few days ago when fsck ran during boot, because /home had been mounted 23 times without a check.

Why does it run after 23 mounts, and not any other number? Is there a reason; did data corruption happen more after 23 mounts in testing, or what? I did a little digging on Google and nothing came up.

Can someone enlighten me on this burning question of curiosity? tongue


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#2 2013-01-14 10:59:50

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Why does fsck run (automatically) after 23 mounts?

tune2fs -l $device

Particularly, notice the 'mount count' and 'maximum mount count'. You can adjust this number with tune2fs's -c flag.

Offline

#3 2013-01-14 11:02:32

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: Why does fsck run (automatically) after 23 mounts?

falconindy wrote:

tune2fs -l $device

Particularly, notice the 'mount count' and 'maximum mount count'. You can adjust this number with tune2fs's -c flag.

I see.. does this somehow answer my question on why they chose the random number of 23? Not sure that I get it tongue


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#4 2013-01-14 11:21:17

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: Why does fsck run (automatically) after 23 mounts?

If you have other partitions, you'll find that those tend to have different numbers for max mount count.
If you want to find out which range is used and why, the sourcecode of the e2fsprogs package should be of help.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2013-01-14 11:22:43

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: Why does fsck run (automatically) after 23 mounts?

Lone_Wolf wrote:

If you have other partitions, you'll find that those tend to have different numbers for max mount count.
If you want to find out which range is used and why, the sourcecode of the e2fsprogs package should be of help.

Indeed, /dev/sda1 has -1 and /dev/sda2 has 23. I think looking into the sourcecode is a tad much to answer this question, though big_smile


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#6 2013-01-14 11:49:32

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: Why does fsck run (automatically) after 23 mounts?

The -1 probably comes from your fstab setting of not checking.

Unia wrote:

I think looking into the sourcecode is a tad much to answer this question, though big_smile

Why?  You'll read my code ... e2fsck is much more organized.  I just downloaded it and found an answer quickly enough, and learned a bit from it too.

Last edited by Trilby (2013-01-14 12:04:20)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2013-01-14 12:02:24

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: Why does fsck run (automatically) after 23 mounts?

for reference : my ext4 partitions use 24,27 and 38 as max mount count.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#8 2013-01-14 12:08:49

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: Why does fsck run (automatically) after 23 mounts?

Lone_Wolf wrote:

for reference : my ext4 partitions use 24,27 and 38 as max mount count.

Well, there goes the prime number hypothesis that I was about to float...

Offline

#9 2013-01-14 22:21:22

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: Why does fsck run (automatically) after 23 mounts?

AFAIK, it's psuedo-randomly chosen when the file-system is created to avoid all partitions being checked after the same number of mounts (ie, at the same time).

That would annoy users who suddenly have to wait for all their partitions to be checked on one particular reboot, instead of having the checks spread out.

Offline

Board footer

Powered by FluxBB