Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 39212 - /etc/init.d/checkroot ignores fs_passno in fstab
Summary: /etc/init.d/checkroot ignores fs_passno in fstab
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-23 16:50 UTC by Torne Wuff
Modified: 2004-10-25 18:37 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Torne Wuff 2004-01-23 16:50:02 UTC
checkroot always checks the root filesystem, even if the pass number in fstab is set to zero. checkfs uses the fsck -A option which doesn't check filesystems whose pass is zero. Making checkroot obey fs_passno would avoid running a fsck on filesystems which do not require it.

Reproducible: Always
Steps to Reproduce:
1. Set fs_passno to 0 for the root filesystem.
2. Reboot.

Actual Results:  
fsck runs on the root filesystem.

Expected Results:  
fsck should not run.
Comment 1 SpanKY gentoo-dev 2004-10-03 01:14:03 UTC
added -A in cvs
Comment 2 SpanKY gentoo-dev 2004-10-25 11:12:33 UTC
ok, after reading the manpage in depth (which i should have done in the first place),
-A is not the way to go about this ... -A will try to fsck more than just /

guess we can awk /etc/fstab to see if we should fsck it or not
Comment 3 SpanKY gentoo-dev 2004-10-25 18:37:09 UTC
ok, here's the diff i've tested and works for me ... will be in 1.11.4:

-                               fsck -A -C -T -a /
+                               # Obey the fs_passno setting for / (see fstab(5))
+                               # - find the / entry
+                               # - make sure we have 6 fields
+                               # - see if fs_passno is something other than 0
+                               if [ -n "$(awk '($1 ~ /^\// && $2 == "/" \
+                                               && NF == 6 && $6 != 0) { print }' /etc/fstab)" ]
+                               then
+                                       ebegin "Checking root filesystem"
+                                       fsck -C -T -a /
+                                       retval=$?
+                               else
+                                       ebegin "Skipping root filesystem check (fstab's passno == 0)"
+                                       retval=0
+                               fi