Subject: Re: fstab and fs_passno
To: Aaron J. Grier <agrier@poofygoof.com>
From: Johnny Billquist <bqt@update.uu.se>
List: netbsd-users
Date: 01/28/2006 12:15:25
Aaron J. Grier wrote:
> On Sat, Jan 28, 2006 at 12:05:26AM +0100, Geert Hendrickx wrote:
> 
>>On Fri, Jan 27, 2006 at 11:45:06AM -0500, Sridhar Ayengar wrote:
>>
>>>Is it legal to define fs_passno>2 for unimportant filesystems in
>>>/etc/fstab, or are 0, 1 and 2 the only legal values?
>>
>>I have another (related) question: is it possible to disable
>>parallellism for fsck at boot-time?  fsck will scan filesystems in
>>parallel when they're on different devices (to speed things up), but
>>also when a filesystem is e.g. on a cgd (on the same physical disk).
>>This is of course not optimal; can I disable it?  (I know -current has
>>-P, but 3.0 hasn't.)  
> 
> 
> from fstab(5) on my 2.0.2_STABLE machine:  (emphasis added)
> 
> 	The sixth field, (fs_passno), is used by the fsck(8)
> 	program to determine the order in which filesystem
> 	checks are done at reboot time.  The root filesystem
> 	should be specified with a fs_passno of 1, and other
> 	filesystems should have a fs_passno of 2.
> 
> 	Filesystems within a drive will be checked sequentially,
> 
> 	but filesystems on different drives will be checked at
> 	the same time to use parallelism available in the
> 	hardware.  If the sixth field is not present or zero, a
> 	value of zero is returned and fsck(8) will assume that
> 	the filesystem does not need to be checked.
> 
> is the man page incorrect?

I would almost say so.
There is no requirement that all other file systems should have 2.
Also, I can't really see why the root system should be 1, and all the 
others 2.
Once this made sense, back when an fsck of the root file system might 
cause the system to reboot. Back in the really old days, you didn't have 
the root system mounted r/o at boot, and fsck of the root system was 
problematic. So it fooled around a little with the root filesystem, and 
then you had to reboot the system, unless the root filesystem was clean. 
(All this was done automatically however, so you didn't have to manually 
interfere).
At that time, it made very much sense to do the root filesystem first.

But is there any good reason today?

As for all the rest, it's just a question of how much parallellism you 
want. Any number is as viable as another. fsck will do as many 
filesystems as possible in parallell when they are in the same pass.
fsck will however not do multiple filesystems on the same physical disk 
in parallell.

It would seem that the man-page implicitly assumes that everyone wants 
as much parallellism as possible. While it's probably true for most 
people, it is by no means a must.

	Johnny

-- 
Johnny Billquist                  || "I'm on a bus
                                   ||  on a psychedelic trip
email: bqt@update.uu.se           ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol