Bug 459090 - e2fsck returns wrong error code for mount with noauto option
e2fsck returns wrong error code for mount with noauto option
Product: Fedora
Classification: Fedora
Component: e2fsprogs (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Eric Sandeen
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-08-14 08:57 EDT by JW
Modified: 2008-09-24 21:54 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-09-24 21:54:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description JW 2008-08-14 08:57:32 EDT
Description of problem:
If a fstab entry has noauto option fsck should either ignore the entry or allow the device node to not exist.q

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. create fstab entry with noauto option and a LABEL=xxx device entry
2. ensure that the underlying device doesn't exist n(eg disconnected usb drive)
3. boot
Actual results:
1. fsck.ext3: Unable to resolve LABEL=xxx

Expected results:
1. fsck should ignore any entry with noauto if devive cannot be resolved

Additional info:
What does noauto mean? It means noauto!
Comment 1 Eric Sandeen 2008-08-27 15:44:25 EDT
Well, according to the fstab man page:

    Common for all types of file system are the options ‘‘noauto’’ 
    (do not mount when "mount -a" is given, e.g., at boot time), ...

but it does not mention fsck in the context of noauto.


    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 utilize parallelism available
    in the hardware.  If the sixth field is not present or zero, a value of
    zero is returned and fsck will assume that the filesystem does not need 
    to be checked.

So, if you don't want it fsck'd at boot time, shouldn't you set fs_passno to 0?

Comment 2 JW 2008-08-27 19:31:17 EDT
It would make a lot more sense if "noauto" meant that nothing what-so-ever happened automatically - including fsck. It doesn't make a lot of sense for a mount that is set to "noauto" to be automatically fsck'ed at boot time - regardless of the setting of fs_passno. After all, isn't a fsck essentially a prelude to a mount? And if there it is not going to be automatically mounted then why fsck it?
Comment 3 Eric Sandeen 2008-08-27 19:43:52 EDT
I agree that those are all interesting questions, and the behavior you see is a bit strange, but the fstab format is a pretty time-honored standard - and there are separate parameters for controlling auto-mount and auto-fsck.  I can poke around for some other opinions, but it seems to me that if you have an fs_passno field of "1" in your fstab, you're asking for a fsck pass, regardless of whether you plan to mount it.  "noauto" + "fs_passno == 1" is, I think, a misconfiguration, or at least a strange one.  Really, I think your best course of action is to just exchange your "1" for a "0" :)

Comment 4 Eric Sandeen 2008-09-24 21:54:12 EDT
Sorry, I'm going to close this.  fs_passno = 1 means: check this filesystem.  I think this is just a misconfiguration.

Note You need to log in before you can comment on or make changes to this bug.