NetBSD-Bugs archive

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

kern/50071: fsck OK but mount: incorrect super block



>Number:         50071
>Category:       kern
>Synopsis:       fsck OK but mount: incorrect super block
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 20 16:05:00 +0000 2015
>Originator:     Patrick Welche
>Release:        NetBSD 7.99.20
>Organization:
>Environment:
NetBSD-7.99.20/amd64 (today's -current)
>Description:

After updating -current from 7.99.6:

# fsck -f /home
** /dev/rraid2a
** File system is already clean
** Last Mounted on /home
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
771 files, 67335 used, 48451404 free (140 frags, 6056408 blocks, 0.0% fragmentation)
# mount /home
mount_ffs: /dev/raid2a on /home: incorrect super block

ERROR: cylinder group size mismatch: fs_cgsize = 0x4800, fs->fs_cgsize = 0x4000, CGSIZE(fs) = 0x4003

http://mail-index.netbsd.org/current-users/2015/07/20/msg027763.html

file system: /dev/rraid2a
format  FFSv1
endian  little-endian
magic   11954           time    Mon Jul 20 16:51:37 2015
superblock location     8192    id      [ 50310125 72060166 ]
cylgrp  dynamic inodes  4.4BSD  sblock  FFSv2   fslevel 4
nbfree  6056408 ndir    337     nifree  12183035        nffree  140
ncg     523     size    49288608        blocks  48518739
bsize   16384   shift   14      mask    0xffffc000
fsize   2048    shift   11      mask    0xfffff800
frag    8       shift   3       fsbtodb 2
bpg     11798   fpg     94384   ipg     23296
minfree 5%      optim   time    maxcontig 4     maxbpg  4096
symlinklen 60   contigsumsize 4
maxfilesize 0x000400400402ffff
nindir  4096    inopb   128
avgfilesize 16384       avgfpdir 64
sblkno  8       cblkno  16      iblkno  24      dblkno  1480
sbsize  2048    cgsize  16384
csaddr  1480    cssize  10240
cgrotor 0       fmod    0       ronly   0       clean   0x02
...
>How-To-Repeat:
	<code/input/activities to reproduce the problem (multiple lines)>
>Fix:

From Martin Husemann, we hit the else in src/sys/ufs/ffs/ffs_vfsops.c:

        /* Check the size of cylinder groups */
        fs_cgsize = ffs_fragroundup(fs, CGSIZE(fs));
        if (fs->fs_cgsize != fs_cgsize) {
                if (fs->fs_cgsize+1 == CGSIZE(fs)) {
                        printf("CGSIZE(fs) miscalculated by one - this file " 
                            "system may have been created by\n"
                            "  an old (buggy) userland, see\n"
                            "  http://www.NetBSD.org/";
                            "docs/ffsv1badsuperblock.html\n");
                } else {
                        printf("ERROR: cylinder group size mismatch: "
                            "fs_cgsize = 0x%zx, " 
                            "fs->fs_cgsize = 0x%zx, CGSIZE(fs) = 0x%zx\n",
                            (size_t)fs_cgsize, (size_t)fs->fs_cgsize,
                            (size_t)CGSIZE(fs));
                        return 0;
                }
        }

so treat as another case of ffsv1badsuperblock, and ignore the mismatch.
(Remove return 0;)

This allows mounting to succeed. (Haven't noticed any trouble in /home)



Home | Main Index | Thread Index | Old Index