0

FSCK(8) says:

The root filesystem will be checked first unless the -P option is specified (see below). After that, filesystems will be checked in the order specified by the fs_passno (the sixth) field in the /etc/fstab file. Filesystems with a fs_passno value of 0 are skipped and are not checked at all. Filesystems with a fs_passno value of greater than zero will be checked in order, with filesystems with the lowest fs_passno number being checked first. If there are multiple filesystems with the same pass number, fsck will attempt to check them in parallel, although it will avoid running multiple filesystem checks on the same physical disk.

...

Hence, a very common configuration in /etc/fstab files is to set the root filesystem to have a fs_passno value of 1 and to set all other filesystems to have a fs_passno value of 2. This will allow fsck to automatically run filesystem checkers in parallel if it is advantageous to do so. System administrators might choose not to use this configuration if they need to avoid multiple filesystem checks running in parallel for some reason – for example, if the machine in question is short on memory so that excessive paging is a concern.

I have one physical disk on my machine, with two filesystems one vfat this is the ESP and the other is ext4 this is mounted on root /, each having fs_passno value of 1. The first paragraph in the manual page states that fsck avoids "multiple filesystem checks on the same physical disk."

Confusingly the second paragraph implies that filesystems with fs_passno of value 2 will be run in parallel and does not say that they might not run parallel on the same disk. In my case, what would be the case? Parallel or not parallel?

direprobs
  • 974
  • It is important to realize that all of this is moot as of Ubuntu 16, which employs systemd and organizes filesystem checking via service units emitted by systemd-fstab-generator. https://unix.stackexchange.com/questions/236953/ – JdeBP Aug 12 '17 at 13:09
  • Also https://unix.stackexchange.com/questions/248534/ . – JdeBP Aug 12 '17 at 13:16

1 Answers1

1

I don't see where exactly lies your confusion. First, all FS with fs_passno=1 will be checked. If they are on the same physical media (your situation), the check will be sequential: VFAT first, then /, or the other way round. Then all FS with fs_passno=2 will be checked, and so on.

xhienne
  • 17,793
  • 2
  • 53
  • 69
  • "and to set all other filesystems to have a fs_passno value of 2. This will allow fsck to automatically run filesystem checkers in parallel if it is advantageous to do so." It says here it'll run the filesystem checker in parallel and it didn't mention that except for the same physical disk. The idea is to make the filesystem checker to run in parallel whenever possible perhaps? As such other than root we set fs_passno=2 for all so that when a filesystem is on different device the checker runs the check in parallel, since they have the same value 2 but on difference devices. – direprobs Aug 12 '17 at 12:01
  • @direprobs Exactly. FS checks should be run in parallel whenever possible. fs_passno is here to ensure a specific order (i.e. in case of a crash you want your system up as soon as possible => you give / the number 1, /var and /home the number 2 and /mnt/archives the number 3). And since there is no gain checking in parallel on the same device (hardware bottleneck), the checker ensures checks are done sequentially on a given physical device. – xhienne Aug 12 '17 at 12:17