Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jun 2003 11:11:33 +0200 (CEST)
From:      Udo Erdelhoff <ue@nathan.ruhr.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/53341: dump frequency in sysinstall is always the fsck sequence number
Message-ID:  <200306150911.h5F9BXYh082210@nathan.internal>
Resent-Message-ID: <200306150930.h5F9UCcR042792@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         53341
>Category:       bin
>Synopsis:       dump frequency in sysinstall is always the fsck sequence number
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 15 02:30:11 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Udo Erdelhoff
>Release:        FreeBSD 5.1-BETA i386
>Organization:
>Environment:
System: FreeBSD nathan.internal 5.1-BETA FreeBSD 5.1-BETA #0: Mon May 19 06:45:58 CEST 2003 root@nathan.internal:/home/data/obj/home/data/src/sys/NATHAN i386

>Description:
The dump frequency and fsck pass columns in the /etc/fstab of a freshly
installed FreeBSD system will always be identical because the code in
sysinstall/config.c hardcodes that.  This make the periodic "dump these
file systems" report rather useless, because it insists on dumping the
root fs every day and every other file system every two days.

>How-To-Repeat:
Install a FreeBSD system for the first time and look into /etc/fstab

>Fix:
WARNING: Untested.  It compiles, but that is about it.

The numbers I choose (7 days for /home, 28 days for static stuff)
are what I use on my boxes, they are perfect bikeshed material.

Index: config.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/sysinstall/config.c,v
retrieving revision 1.210
diff -u -r1.210 config.c
--- config.c	31 May 2003 11:28:28 -0000	1.210
+++ config.c	15 Jun 2003 08:56:52 -0000
@@ -172,6 +172,21 @@
     return 0;
 }
 
+static int
+dump_freq(Chunk *c1)
+{
+    if (c1->type == part && c1->subtype != FS_SWAP) {
+	if (rootdev_is_od == 0 && strncmp(c1->name, "od", 2) == 0)
+	    return 0;
+	else if (strncmp(mount_point(c1), "/home", 5) == 0)
+	    return 7;
+	else
+	    return 28;
+    }
+    return 0;
+}
+
+
 int
 configFstab(dialogMenuItem *self)
 {
@@ -233,7 +248,7 @@
     fprintf(fstab, "# Device\t\tMountpoint\tFStype\tOptions\t\tDump\tPass#\n");
     for (i = 0; i < nchunks; i++)
 	fprintf(fstab, "/dev/%s\t\t%s\t\t%s\t%s\t\t%d\t%d\n", name_of(chunk_list[i]), mount_point(chunk_list[i]),
-		fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]), seq_num(chunk_list[i]));
+		fstype(chunk_list[i]), fstype_short(chunk_list[i]), dump_freq(chunk_list[i]), seq_num(chunk_list[i]));
     
     /* Now look for the CDROMs */
     devs = deviceFind(NULL, DEVICE_TYPE_CDROM);



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200306150911.h5F9BXYh082210>