Subject: newfs problem: "cg 0: bad magic number"
To: None <tech-kern@netbsd.org>
From: Tad Hunt <tad@entrisphere.com>
List: tech-kern
Date: 07/08/2002 17:45:13
System: NetBSD 1.5, powerpc

I attempted to run newfs on the "c" partition of the
following disk, and it spit out "cg 0: bad magic number".
It also printed a warning about inodes and cylinder groups,
which I assumed that it adjusted for.  Am I mistaken, or is
this a bug?

-Tad

-------------------------------------------------------------------------------
sh$ disklabel wd0
type: ESDI
disk: DELKIN DEVICES I
label: N20020708170926
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 15
sectors/cylinder: 945
cylinders: 1059
total sectors: 1000755
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

8 partitions:
#        size   offset     fstype   [fsize bsize   cpg]
  a:   438937        1     4.2BSD     1024  8192    16   # (Cyl.    0*- 464*)
  c:   438937   438938     4.2BSD     1024  8192    16   # (Cyl.  464*- 928*)
  d:  1000755        0     unused        0     0         # (Cyl.    0 - 1058)
  e:   122880   877875     4.2BSD     1024  8192    16   # (Cyl.  928*- 1058)
disklabel: boot block size 0

-------------------------------------------------------------------------------

sh$ newfs /dev/rwd0c
Warning: inode blocks/cyl group (84) >= data blocks (28) in last
    cylinder group. This implies 456 sector(s) cannot be allocated.
/dev/rwd0c:     438480 sectors in 464 cylinders of 15 tracks, 63 sectors
        214.1MB in 29 cyl groups (16 c/g, 7.38MB/g, 1792 i/g)
super-block backups (for fsck -b #) at:
     32,  15216,  30400,  45584,  60768,  75952,  91136, 106320, 121504,
 136688, 151872, 167056, 182240, 197424, 212608, 227792, 241952, 257136,
 272320, 287504, 302688, 317872, 333056, 348240, 363424, 378608, 393792,
 408976, 424160,
cg 0: bad magic number
cg 0: bad magic number
sh$

-------------------------------------------------------------------------------