Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: fsck attempted on NFS root?



On Mon, 27 Apr 2009, John D. Baker wrote:
> I just built -current (5.99.11) for macppc from sources updated this
> morning (27 April 2009).  I've been net-booting and NFS-rooting the
> target machine for well over a year and this is the first time I saw
> the rc scripts attempt to fsck the NFS root directory.

The latest -current has a new /etc/rc.d/fsck_root script, which
runs "fsck -p /".  Unlike "fsck -p" with no args, "fsck -p /"
does not pay attention to the fs_passno field in /etc/fstab.

I see several possible solutions:

1) Make it possible for fsck_root=false in /etc/rc.conf to disable the
   /etc/rc.d/fsck_root script;
2) Make /etc/rc.d/fsck_root to parse /etc/fstab and do nothing
   if the root file system has fs_passno = 0.
3) Make fsck itself ignore file systems with fs_passno = 0, if the -p flag
   is specified (and the -f flag is not specified)

I append a patch to implement option 3.

--apb (Alan Barrett)

--- fsck.c      23 Feb 2008 21:41:47 -0000      1.47
+++ fsck.c      28 Apr 2009 11:50:59 -0000
@@ -212,6 +212,12 @@
                                errx(FSCK_EXIT_CHECK_FAILED,
                                    "%s has unknown file system type.",
                                    spec);
+                       if ((flags & (CHECK_PREEN|CHECK_FORCE)) == CHECK_PREEN
+                           && fs->fs_passno == 0) {
+                               warnx("%s skipped: fstab pass number is 0",
+                                   *argv);
+                               continue;
+                       }
                }
 
                rval = checkfs(type, blockcheck(spec), *argv, NULL, NULL);


Home | Main Index | Thread Index | Old Index